text:
using AspectCore.DynamicProxy;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace AspectCore.Tests.Injector
{
    public class Intercept1 : AbstractInterceptorAttribute
    {
        public override Task Invoke(AspectContext context, AspectDelegate next)
        {
            context.Parameters[0] = "lemon";
            return context.Invoke(next);
        }
    }

    public interface IService1
    {
        Task<string> GetValue(string val);
    }

    public class Service1 : IService1
    {
        [Intercept1]
        public async Task<string> GetValue(string val)
        {
            await Task.Delay(3000);
            return val;
        }
    }

    public class AsyncBlockTest : InjectorTestBase
    {

        [Fact]
        public async Task AsyncBlock()
        {
            var builder = new ProxyGeneratorBuilder();
            builder.Configure(_ => { });
            var proxyGenerator = builder.Build();
            var proxy = proxyGenerator.CreateInterfaceProxy<IService1, Service1>();
            // IService proxy = new Service();
            var startTime = DateTime.Now;
            Console.WriteLine($"{startTime}:start");

            var val = proxy.GetValue("le");

            var endTime = DateTime.Now;

            Assert.True((endTime - startTime).TotalSeconds < 2);
            Console.WriteLine($"{endTime}:should return immediately");
            var result = await val;
            Console.WriteLine($"{DateTime.Now}:{result}");
        }
    }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Abh. Schles. Ges. Vaterl. Kult. Abth. Naturwiss. 2: 31 (1862)

#### Original name
Lichen fulgens Sw.

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package ingress

import (
	"context"
	"fmt"
	"net/url"
	"strconv"

	"go.uber.org/zap"
	"k8s.io/apimachinery/pkg/util/sets"
	corev1listers "k8s.io/client-go/listers/core/v1"
	"knative.dev/networking/pkg/apis/networking/v1alpha1"
	"knative.dev/networking/pkg/status"

	"knative.dev/net-gateway-api/pkg/reconciler/ingress/config"
)

func NewProbeTargetLister(logger *zap.SugaredLogger, endpointsLister corev1listers.EndpointsLister) status.ProbeTargetLister {
	return &gatewayPodTargetLister{
		logger:          logger,
		endpointsLister: endpointsLister,
	}
}

type gatewayPodTargetLister struct {
	logger          *zap.SugaredLogger
	endpointsLister corev1listers.EndpointsLister
}

func (l *gatewayPodTargetLister) ListProbeTargets(ctx context.Context, ing *v1alpha1.Ingress) ([]status.ProbeTarget, error) {
	result := make([]status.ProbeTarget, 0, len(ing.Spec.Rules))
	for _, rule := range ing.Spec.Rules {
		eps, err := l.getRuleProbes(ctx, rule, ing.Spec.HTTPOption)
		if err != nil {
			return nil, err
		}
		result = append(result, eps...)
	}
	return result, nil
}

func (l *gatewayPodTargetLister) getRuleProbes(ctx context.Context, rule v1alpha1.IngressRule, sslOpt v1alpha1.HTTPOption) ([]status.ProbeTarget, error) {
	gatewayConfig := config.FromContext(ctx).Gateway
	service := gatewayConfig.Gateways[rule.Visibility].Service

	eps, err := l.endpointsLister.Endpoints(service.Namespace).Get(service.Name)
	if err != nil {
		return nil, fmt.Errorf("failed to get endpoints: %w", err)
	}

	targets := make([]status.ProbeTarget, 0, len(eps.Subsets))
	foundTargets := 0
	for _, sub := range eps.Subsets {
		scheme := "http"
		// Istio uses "http2" for the http port
		matchSchemes := sets.NewString("http", "http2")
		if rule.Visibility == v1alpha1.IngressVisibilityExternalIP && sslOpt == v1alpha1.HTTPOptionRedirected {
			scheme = "https"
			matchSchemes = sets.NewString("https")
		}
		pt := status.ProbeTarget{PodIPs: sets.NewString()}

		portNumber := sub.Ports[0].Port
		for _, port := range sub.Ports {
			if matchSchemes.Has(port.Name) {
				// Prefer to match the name exactly
				portNumber = port.Port
				break
			}
			if port.AppProtocol != nil && matchSchemes.Has(*port.AppProtocol) {
				portNumber = port.Port
			}
		}
		pt.PodPort = strconv.Itoa(int(portNumber))

		for _, address := range sub.Addresses {
			pt.PodIPs.Insert(address.IP)
		}
		foundTargets += len(pt.PodIPs)

		pt.URLs = domainsToURL(rule.Hosts, scheme)
		targets = append(targets, pt)
	}
	if foundTargets == 0 {
		return nil, fmt.Errorf("no gateway pods available")
	}
	return targets, nil
}

func domainsToURL(domains []string, scheme string) []*url.URL {
	urls := make([]*url.URL, 0, len(domains))
	for _, domain := range domains {
		url := &url.URL{
			Scheme: scheme,
			Host:   domain,
			Path:   "/",
		}
		urls = append(urls, url)
	}
	return urls
}


text:
class CreatePlaces < ActiveRecord::Migration
  def change
    create_table :places do |t|
      t.string :name
      t.string :code

      t.timestamps null: false
    end
  end
end


text:
'use strict'

/**
 * Test
 */
class ClassName extends AnotherClass
{
    constructor( argument )
    {
        // code...
    }

    test()
    {
    	console.log('salut quentin lol')
    }
}


text:
from PIL import Image
from math import sqrt

def encode(data, path, channels=4):
    mode = "RGBA" if channels == 4 else "RGB"
    size = (len(data) + channels - 1) // channels
    width = int(sqrt(size))
    height = int(size / width)
    if width * height < size:
        height += 1
    data += bytes(width * height * channels - len(data))
    with Image.frombytes(mode, (width, height), data) as image:
        image.save(path, format="PNG", compress_level=9)

def decode(path):
    with Image.open(path) as image:
        data = image.tobytes()
    return data.rstrip(bytes(1))

def main():
    path = "data.png"
    with open("quijote.txt", "rb") as f:
        data = f.read()
    encode(data, path)
    newData = decode(path)

    if data == newData:
        print("Data coincides")
    else:
        print("Data doesn't coincide")
        print(len(data), len(newData))
        print(newData[:50])

if __name__ == "__main__":
    main()


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <errno.h>
#include <fcntl.h>
#include <sys/file.h>

#include "chrome/browser/process_singleton.h"

#include "base/file_util.h"
#include "base/metrics/histogram.h"
#include "base/posix/eintr_wrapper.h"
#include "chrome/common/chrome_constants.h"

namespace {

// From "man 2 intro", the largest errno is |EOPNOTSUPP|, which is
// |102|.  Since the histogram memory usage is proportional to this
// number, using the |102| directly rather than the macro.
const int kMaxErrno = 102;

}  // namespace

// This class is used to funnel messages to a single instance of the browser
// process. This is needed for several reasons on other platforms.
//
// On Windows, when the user re-opens the application from the shell (e.g. an
// explicit double-click, a shortcut that opens a webpage, etc.) we need to send
// the message to the currently-existing copy of the browser.
//
// On Linux, opening a URL is done by creating an instance of the web browser
// process and passing it the URL to go to on its commandline.
//
// Neither of those cases apply on the Mac. Launch Services ensures that there
// is only one instance of the process, and we get URLs to open via AppleEvents
// and, once again, the Launch Services system. We have no need to manage this
// ourselves.  An exclusive lock is used to flush out anyone making incorrect
// assumptions.

ProcessSingleton::ProcessSingleton(
    const base::FilePath& user_data_dir,
    const NotificationCallback& /* notification_callback */)
    : lock_path_(user_data_dir.Append(chrome::kSingletonLockFilename)),
      lock_fd_(-1) {
}

ProcessSingleton::~ProcessSingleton() {
  // Make sure the lock is released.  Process death will also release
  // it, even if this is not called.
  Cleanup();
}

ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
  // This space intentionally left blank.
  return PROCESS_NONE;
}

ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() {
  // Windows tries NotifyOtherProcess() first.
  return Create() ? PROCESS_NONE : PROFILE_IN_USE;
}

// Attempt to acquire an exclusive lock on an empty file in the
// profile directory.  Returns |true| if it gets the lock.  Returns
// |false| if the lock is held, or if there is an error.
// |notification_callback| is not actually used. See the comments at the top of
// this file for details.
// TODO(shess): Rather than logging failures, popup an alert.  Punting
// that for now because it would require confidence that this code is
// never called in a situation where an alert wouldn't work.
// http://crbug.com/59061
bool ProcessSingleton::Create() {
  DCHECK_EQ(-1, lock_fd_) << "lock_path_ is already open.";

  lock_fd_ = HANDLE_EINTR(open(lock_path_.value().c_str(),
                               O_RDONLY | O_CREAT, 0644));
  if (lock_fd_ == -1) {
    const int capture_errno = errno;
    DPCHECK(lock_fd_ != -1) << "Unexpected failure opening profile lockfile";
    UMA_HISTOGRAM_ENUMERATION("ProcessSingleton.OpenError",
                              capture_errno, kMaxErrno);
    return false;
  }

  // Acquire an exclusive lock in non-blocking fashion.  If the lock
  // is already held, this will return |EWOULDBLOCK|.
  int rc = HANDLE_EINTR(flock(lock_fd_, LOCK_EX|LOCK_NB));
  if (rc == -1) {
    const int capture_errno = errno;
    DPCHECK(errno == EWOULDBLOCK)
        << "Unexpected failure locking profile lockfile";

    Cleanup();

    // Other errors indicate something crazy is happening.
    if (capture_errno != EWOULDBLOCK) {
      UMA_HISTOGRAM_ENUMERATION("ProcessSingleton.LockError",
                                capture_errno, kMaxErrno);
      return false;
    }

    // The file is open by another process and locked.
    LOG(ERROR) << "Unable to obtain profile lock.";
    return false;
  }

  return true;
}

void ProcessSingleton::Cleanup() {
  // Closing the file also releases the lock.
  if (lock_fd_ != -1) {
    int rc = HANDLE_EINTR(close(lock_fd_));
    DPCHECK(!rc) << "Closing lock_fd_:";
  }
  lock_fd_ = -1;
}


text:
This plugin provides Global Search functionality in Kylo via Solr as the backend engine.

##Configuration
For configuration of the plugin, please refer to Kylo's documentation at:

http://kylo.readthedocs.io/en/latest/how-to-guides/ConfigureKyloForGlobalSearch.html


text:
var test2 = require("test2");

var sys = require("system");

var print = function(){
  sys.stdout.print.apply(sys.stdout, arguments);
}

//var callback = function(){print("running callback");};

gc();

execute(test2.callback);


text:
import logging
import os.path
import sys
import beeswax.hive_site

from django.utils.translation import ugettext_lazy as _t, ugettext as _

from desktop.conf import default_ssl_cacerts, default_ssl_validate
from desktop.lib.conf import ConfigSection, Config, coerce_bool

from beeswax.settings import NICE_NAME

LOG = logging.getLogger(__name__)

HIVE_SERVER_HOST = Config(
  key="hive_server_host",
  help=_t("Host where HiveServer2 server is running. If Kerberos security is enabled, "
         "the fully-qualified domain name (FQDN) is required"),
  default="localhost")

HIVE_SERVER_PORT = Config(
  key="hive_server_port",
  help=_t("Configure the port the HiveServer2 server runs on."),
  default=10000,
  type=int)

HIVE_CONF_DIR = Config(
  key='hive_conf_dir',
  help=_t('Hive configuration directory, where hive-site.xml is located.'),
  default=os.environ.get("HIVE_CONF_DIR", "/opt/mapr/hive/hive*/conf"))

HIVE_SERVER_BIN = Config(
  key="hive_server_bin",
  help=_t("Path to HiveServer2 start script"),
  default='/opt/mapr/hive/hive-0.12/bin/hiveserver2',
  private=True)

LOCAL_EXAMPLES_DATA_DIR = Config(
  key='local_examples_data_dir',
  default=os.path.join(os.path.dirname(__file__), "..", "..", "data"),
  help=_t('The local filesystem path containing the Hive examples.'))

SERVER_CONN_TIMEOUT = Config(
  key='server_conn_timeout',
  default=120,
  type=int,
  help=_t('Timeout in seconds for Thrift calls.'))

MECHANISM=Config("mechanism",
  default='none',
  help="Security mechanism of authentication none/GSSAPI/MAPR-SECURITY",
  type=str)

USE_GET_LOG_API = Config( # To remove in Hue 4
  key='use_get_log_api',
  default=False,
  type=coerce_bool,
  help=_t('Choose whether to use the old GetLog() thrift call from before Hive 0.14 to retrieve the logs.'
          'If false, use the FetchResults() thrift call from Hive 1.0 or more instead.')
)

BROWSE_PARTITIONED_TABLE_LIMIT = Config(
  key='browse_partitioned_table_limit',
  default=250,
  type=int,
  help=_t('Set a LIMIT clause when browsing a partitioned table. A positive value will be set as the LIMIT. If 0 or negative, do not set any limit.'))

DOWNLOAD_ROW_LIMIT = Config(
  key='download_row_limit',
  default=1000000,
  type=int,
  help=_t('A limit to the number of rows that can be downloaded from a query. A value of -1 means there will be no limit. A maximum of 65,000 is applied to XLS downloads.'))

CLOSE_QUERIES = Config(
  key="close_queries",
  help=_t("Hue will try to close the Hive query when the user leaves the editor page. "
          "This will free all the query resources in HiveServer2, but also make its results inaccessible."),
  type=coerce_bool,
  default=False
)

THRIFT_VERSION = Config(
  key="thrift_version",
  help=_t("Thrift version to use when communicating with HiveServer2."),
  type=int,
  default=7
)

SSL = ConfigSection(
  key='ssl',
  help=_t('SSL configuration for the server.'),
  members=dict(
    CACERTS = Config(
      key="cacerts",
      help=_t("Path to Certificate Authority certificates."),
      type=str,
      dynamic_default=default_ssl_cacerts,
    ),

    KEY = Config(
      key="key",
      help=_t("Path to the private key file, e.g. /etc/hue/key.pem"),
      type=str,
      default=None
    ),

    CERT = Config(
      key="cert",
      help=_t("Path to the public certificate file, e.g. /etc/hue/cert.pem"),
      type=str,
      default=None
    ),

    VALIDATE = Config(
      key="validate",
      help=_t("Choose whether Hue should validate certificates received from the server."),
      type=coerce_bool,
      dynamic_default=default_ssl_validate,
    )
  )
)

def config_validator(user):
  # dbms is dependent on beeswax.conf (this file)
  # import in method to avoid circular dependency
  from beeswax.server import dbms

  res = []
  try:
    if not 'test' in sys.argv: # Avoid tests hanging
      server = dbms.get(user)
      server.get_databases()
  except:
    msg = "The application won't work without a running HiveServer2."
    LOG.exception(msg)

    res.append((NICE_NAME, _(msg)))

  try:
    from hadoop import cluster
    warehouse = beeswax.hive_site.get_metastore_warehouse_dir()
    fs = cluster.get_hdfs()
    fs.stats(warehouse)
  except Exception:
    msg = 'Failed to access Hive warehouse: %s'
    LOG.exception(msg % warehouse)

    return [(NICE_NAME, _(msg) % warehouse)]

  return res


text:
<!DOCTYPE html>

    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1'>

    <title>[SAND] That's No Tornado</title>

    <link rel='icon' href='favicon.ico' sizes='16x16 32x32' type='image/png'>
    <meta name='description' content="A website for information on the Guild Wars 2 guild [SAND] - That's No Tornado">
    <meta name='keywords' content='GW2,Guild Wars 2,Dry Top,SAND,guild'>

    <link rel='stylesheet' type='text/css' href='css/main.css'/>

                <button type='button'
                        class='navbar-toggle collapsed'
                        data-toggle='collapse'
                        data-target='#navbar-collapse-1'
                        aria-expanded='false'>
                    Toggle navigation

                </button>
                [SAND] That's No Tornado

Events

Social

New to Dry Top?

About the Guild

Guild Leadership

Guild Recruitment

                        Site Info

Site Feedback

Contribute Updates

<canvas id="canvas" style="display:block;position:absolute;top:100px;left:0px;"></canvas>

[SAND] That's No Tornado

        Hey folks! A page has been created in order to clearly state and explain what we consider to be spoilers regarding new living story content and expansions in our guild chat. This is our policy.

Message of the Day:


text:
cmake_minimum_required(VERSION 3.3)
# Perform bundle fixup on all executables of an install directory
# and generates a standalone bundle with all required runtime dependencies.
#
# This scripts accepts the following parameters:
#   - CMAKE_INSTALL_PREFIX: install target path
#   - BUNDLE_INSTALL_PREFIX: bundle installation path
#   - BUNDLE_LIBS_PATHS: additional paths (colon separated) to look for runtime dependencies

# Blacklist from AppImage: https://github.com/AppImage/AppImages/blob/master/excludelist
set(LINUX_OS_LIB_BLACKLIST
ld-linux
ld-linux-x86-64
libanl
libBrokenLocale
libcidn
libcrypt
libc
libdl
libm
libmvec
libnsl
libnss_compat
libnss_db
libnss_dns
libnss_files
libnss_hesiod
libnss_nisplus
libnss_nis
libpthread
libresolv
librt
libthread_db
libutil
libstdc++
libGL
libdrm
libglapi
libX11
libgio-2.0
libasound
libgdk_pixbuf-2.0
libfontconfig
libthai
libfreetype
libharfbuzz
libcom_err
libexpat
libgcc_s
libglib-2.0
libgpg-error
libICE
libkeyutils
libp11-kit
libSM
libusb-1.0
libuuid
libz
libgobject-2.0
libpangoft2-1.0
libpangocairo-1.0
libpango-1.0
libgpg-error
libjack
    )

function(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
  # avoid log flood for those system libraries with non-absolute path
  if(item MATCHES "^(api-ms-win-)[^/]+dll")
    # resolve item with fake absolute system path to keep them identified as system libs
    # By doing this, fixup_bundle:
    #   - won't complain about those libraries
    #   - won't embed them in the bundle
    set(${resolved_item_var} "$ENV{SystemRoot}/system/${item}" PARENT_SCOPE)
    set(${resolved_var} TRUE PARENT_SCOPE)
  endif()
endfunction()

if(UNIX)
  function(gp_resolved_file_type_override resolved_file type_var)
    # We would like to embed all non-blacklisted "system" libs,
    # based on the AppImage blacklist.
    if("${${type_var}}" STREQUAL "system")
      get_filename_component(basename ${resolved_file} NAME_WE)
      # message(STATUS "SYSTEM LIB: ${resolved_file} [${basename}]")
      if(NOT basename IN_LIST LINUX_OS_LIB_BLACKLIST)
        # message(STATUS "${resolved_file} [${basename}]: SYSTEM => EMBEDDED")
        set(${type_var} "embedded" PARENT_SCOPE)
      endif()
    endif()
  endfunction()
endif()

include(BundleUtilities)
include(GNUInstallDirs)

message(STATUS "Starting Bundle")
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "BUNDLE_INSTALL_PREFIX: ${BUNDLE_INSTALL_PREFIX}")
message(STATUS "BUNDLE_LIBS_PATHS: ${BUNDLE_LIBS_PATHS}")

message(STATUS "CMAKE_INSTALL_FULL_LIBDIR: ${CMAKE_INSTALL_FULL_LIBDIR}")
message(STATUS "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}")

# Add installed runtime library folder to dependencies lookup path
if(WIN32)  # installed next to binaries on Windows
    set(LIBS_LOOKUPS_PATHS "${CMAKE_INSTALL_FULL_BINDIR}")
else()     # installed in library dir everywhere else
    set(LIBS_LOOKUPS_PATHS "${CMAKE_INSTALL_FULL_LIBDIR}")
    # GNUInstallDirs is not able to resolve between lib and lib64 hen cmake is called as a sub-command line.
    # As a workaround we always add a second path with "64" suffix, so it works in all cases.
    # In some cases, that will be useless and point to a non-existing directory.
    list(APPEND LIBS_LOOKUPS_PATHS ${CMAKE_INSTALL_FULL_LIBDIR}64)
endif()

if(BUNDLE_LIBS_PATHS)
list(APPEND LIBS_LOOKUPS_PATHS ${BUNDLE_LIBS_PATHS})
endif()
message(STATUS "LIBS_LOOKUPS_PATHS: ${LIBS_LOOKUPS_PATHS}")

get_bundle_all_executables(${CMAKE_INSTALL_FULL_BINDIR} BUNDLE_APPS)

file(COPY
     ${CMAKE_INSTALL_FULL_BINDIR}
     DESTINATION ${BUNDLE_INSTALL_PREFIX}
     USE_SOURCE_PERMISSIONS)

file(COPY
    ${CMAKE_INSTALL_FULL_DATADIR}
    DESTINATION ${BUNDLE_INSTALL_PREFIX}
    USE_SOURCE_PERMISSIONS
    )

# Get first bundled executable as reference app
# fixup_bundle will automatically fixup all the others executable in the bundle
get_bundle_all_executables(${BUNDLE_INSTALL_PREFIX} BUNDLE_APPS)
list(GET BUNDLE_APPS 0 MAIN_APP)
fixup_bundle(${MAIN_APP} "" "${LIBS_LOOKUPS_PATHS}")

if(UNIX)
    file(GLOB _LIBS_TO_MOVE "${BUNDLE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/lib*.so*")
    file(COPY
        ${_LIBS_TO_MOVE}
        DESTINATION ${BUNDLE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
        USE_SOURCE_PERMISSIONS
        FILES_MATCHING PATTERN "lib*.so*"
        )
    file(REMOVE
        ${_LIBS_TO_MOVE}
        )

endif()

message(STATUS "Bundle done: ${BUNDLE_INSTALL_PREFIX}")


text:
c     Exemple d'utilisation de la librairie GMF : Recopie d'un fichier mesh dans un autre

c     Inclusion des definitions d'etiquettes de la librairie GMF
      include 'libmesh4.ins'

c     Le tableau KwdTab permet de stocker un mot-clef par ligne
c     La colonne 1 donne le nombre de lignes de ce mot-clefs presents dans le fichier
c     Les colonnes suivantes ne sont utilisees que par les champs de solutions
      integer KwdTab(GmfMaxSol + 2, GmfMaxKwd)

      integer i, j, InsIdx, OutIdx, res,dim, NmbVer, NmbTri
      real CrdTab(3, 600000)
      integer RefTab(600000)
      integer TriTab(4,1200000)

c     Ouverture du fichier .meshb. Les quatre parametres a fournir sont :
c     1 : le nom du fichier avec l'extension .mesh ou .meshb
c     2 : le mode d'ouverture GmfRead ou GmfWrite
c     3 : un entier qui indique la dimension en cas de creation d'un maillage
c         ou qui recevra la dimension en cas de lecture.
c     4 : le tableau des mot-clefs qui sera rempli des l'ouverture du maillage en lecture
c         ce qui permet de preparer ses allocations memoire avant la lecture des champs
c         proprement dit.
c     L'ouverture retourne une etiquette unique permettant d'identifier les differents
c     fichiers ouverts. Elle servira d'argument a toutes les autres commandes de la librairie.
      InsIdx = GmfOpenMeshF77('in.meshb',GmfRead,dim,KwdTab)
      print*, 'InsIdx = ', InsIdx
      if(InsIdx.le.0) STOP ' InsIdx==0'

c     La colonne 1 de la ligne GmfVertices contient le nombre de vertices du fichier
      NmbVer = KwdTab(1,GmfVertices)
      print*, 'NmbVer = ', NmbVer

c     La colonne 1 de la ligne GmfTriangles contient le nombre de triangles du fichier
      NmbTri = KwdTab(1,GmfTriangles)
      print*, 'NmbTri = ', NmbTri

c     Ouverture du fichier destination en ecriture. Il est inutile de fournir un tableau de mot-clefs
      OutIdx = GmfOpenMeshf77('out.meshb',GmfWrite,dim,0)
      print*,'Outidx = ',OutIdx
      if(OutIdx.le.0) STOP ' OutIdx==0'

c     Lecture des vertices,  les quatres parametres a fournir sont :
c     1 : l'etiquette du fichier a lire
c     2 : l'etiquette du mot-clef a lire
c     3 : un tableau suffisamment grand pour contenir tous les nombres reels retournes par ce mot-clefs
c     4 : un tableau suffisamment grand pour contenir tous les nombres entiers retournes par ce mot-clefs
c     Dans le cas de lecture de vertices en 3d le tableau de reels doit contenir 3 * le nombre de noeuds
c     (pour les coordonnees) et le tableau d'entiers une fois ce nombre (pour les references)
      res = GmfReadFieldF77(InsIdx, GmfVertices, CrdTab, RefTab)
      print*,'read vertices = ',res

c     L'ecriture du mot-clefs fonctionne sur le meme principe mais 3 arguments sont ajoutes :
c     3 : le nombre de lignes a ecrire
c     4 : le nombre de type de solutions (dans le cas d'un champ de solutions)
c     5 : un tableau contenant tous les type de solutions.
      res = GmfWriteFieldf77(OutIdx,GmfVertices,NmbVer,0,0,CrdTab,
     +RefTab)
      print*,'Write vertices = ',res

c     Dans le cas des triangles qui n'utilisent que des entiers, il est inutile de fournir un tableau de reels
      res = GmfReadFieldF77(InsIdx, GmfTriangles, 0, TriTab)
      print*,'read triangles = ',res

      res = GmfWriteFieldf77(OutIdx,GmfTriangles,NmbTri,0,0,0,TriTab)
      print*,'Write triangles = ',res

c     La fermeture des fichiers est obligatoire, faute de quoi les donnees ne seront pas proprement ecrites.
      res = GmfCloseMeshF77(InsIdx)
      print*,'close read = ',res

      res = GmfCloseMeshf77(OutIdx)
      print*,'close write = ',res

      end


text:
package com.google.ads.googleads.v12.enums;

public interface MerchantCenterLinkStatusEnumOrBuilder extends
    // @@protoc_insertion_point(interface_extends:google.ads.googleads.v12.enums.MerchantCenterLinkStatusEnum)
    com.google.protobuf.MessageOrBuilder {
}


text:
![fundo](https://raw.githubusercontent.com/lusilva/fundo/master/app/imports/client/img/fundo.png)
#### Find nearby events that interest you without getting bogged down by those who don't.

This is a project for RCOS (Rensselaer Center for Open Source), built with Meteor and React.

#### Related Project

This project relies on separate workers to process eventful data. This was an architectural choice that was made
to reduce the load of the main server. The worker server can be found [here](https://github.com/lusilva/fundo-worker).
Any number of workers may connect to the main server via DDP, and they process event fetching jobs.

### Description
fundo is a web application which will allow users to discover nearby events. It's main focus is on being an event discovery tool, and the plan is for it to be tinder-like. Users will be able to upvote and like events, and the system will learn user preferences and recommend nearby events that the user is likely to attend. In time, the event suggestions should improve as users provide more data points for the recommendation algorithm. We will also recommend events to users based on what other users with similar preferences have also liked. The goal of this project is to create a one-stop shop to find something to do if you're bored, and only provide events that users are interested in attending.

### Timeline
- [x] Week 1-2: Finalize app design. Look into recommendation algorithms and get complete feature list of what we want to implement.

- [x] Weeks 3-4: Rough app skeleton, integrate event APIs to draw event data from. Implement event cache and figure out how to manage the data.

- [x] Weeks 5-6: Play around with recommendation systems. Improve app infrastructure. Test recommendations using mock users with different preferences.

- [x] Weeks 7-8: Implement bulk of recommendation system. Plug into recommendation apis and figure out how to parse events to extract important/relevant data.

- [x] Weeks 9-10: Get a working frontend up. Fix backend issues, continued development. Fine tune recommendations.

- [ ] Week 11: Squash dem bugs by thoroughly testing features. Continued work on frontend features and backend recommendations. Possibly look at more apis to plug into.

- [ ] Week 12: Release to the public. Be happy.

### The stack & features
- ES6 modules
- Meteor
- React.js
- react-router with server-rendering
- Webpack (bundle your app / assets and send them to Meteor)
- Hot-reload with no page refresh in development mode
- Optimize your code in production mode
- Give access to NPM by using packages.json

### Build Instructions

1. Install [Meteor](https://www.meteor.com/install)
2. Create settings.json file in the root directory.
   More info [here.](http://docs.meteor.com/#/full/meteor_settings)
3. Start up a redis server instance for the app to connect to. For more info, see next section.
4. Run `npm install` to install all npm packages.
5. Run `meteor run --settings settings.json`, which will install all dependencies and start up the meteor server.
6. run fundo worker [here.](https://github.com/lusilva/fundo-worker)
7. run worker with same example settings from #2 above and different port than main meteor server
		`meteor run --settings settings.json --port 4000`, this separate meteor server fetches events without delaying main site functionality
8. Go to `localhost:3000` in your web browser.

### Redis

The recommendations and ratings are stored in an intermediate data
store called Redis which performs extremely well compared to database
systems that write every change to disk before committing the transaction.
Redis holds the entire dataset in memory.

##### In order to install/run redis:

        brew install redis
        redis-server

### Example settings.json

        {
            "public": {
           	"dashboardPageSize": <NUMBER>
            },
            "kadira": {
                "appId": <KADIRA_APP_KEY_GOES_HERE>,
                "appSecret": <KADIRA_SECRET_KEY_GOES_HERE>,
                "debug": {
                "authKey": <KADIRA_AUTH_KEY_GOES_HERE>
                }
            },
            "eventfulAPIKey": <EVENTFUL_API_KEY_GOES_HERE>,
            "maxPagesPerCity": <NUMBER>,
            "hoursEventsExpiresIn": <NUMBER>,
            "refreshEventsEvery": <STRING (eg "every 2 hours")>,
            "mail": {
                "server": <STRING>,
                "username": <STRING>,
                "password": <STRING>,
                "port": <STRING>
              },
            "enableRedisRecommendations": <true OR false>
            "redis": {
               "port": <NUMBER>,
               "url": <STRING>,
               "password": <STRING or null if no password needed>
            },
            "admin": {
               "email": <STRING>,
               "password": <STRING>
            }
            "remote": <REMOTE HOST  (eg "localhost:3000")>
        }

#### Run in production mode (with SSR enabled)
`meteor run --production --settings settings.json`

#### Build for production
`meteor build .`

##### A little note about SSR (EDIT: THIS HAS BEEN TEMPORARILY DISABLED DUE TO UNKNOWN ERRORS)
This application uses SSR (Server Side Rendering) in production. Therefore, all code that relies on the global `window` object in any view must be wrapped in a conditional such as `if (typeof window != 'undefined') { code block } `, since `window` exists only on the browser and not on the server. This does not apply to code inside functions that are only run on the browser, such as `componentDidMount`.

Thanks to [thereactivestack's kickstart project](https://github.com/thereactivestack/kickstart-simple), which this project is based upon.


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Time Range - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">

Time Range

The time value is constrained in specified range.

		From 08:30 to 18:00

	<input class="easyui-timespinner" data-options="min:'08:30',max:'18:00'" style="width:80px;"></input>


text:
'use strict'

const EventEmitter = require('events')

const __mockBrowser = Object.assign(new EventEmitter(), {
  discover: jest.fn(),
  stop: jest.fn(),
})

const createBrowser = jest.fn()

const tcp = name => ({ name, protocol: 'tcp', subtypes: [], description: '' })

const __mockReset = () => {
  createBrowser.mockReset()
  __mockBrowser.removeAllListeners()
  __mockBrowser.discover.mockReset()
  __mockBrowser.stop.mockReset()
  createBrowser.mockReturnValue(__mockBrowser)
}

const ServiceType = function() {}

module.exports = { tcp, createBrowser, ServiceType, __mockBrowser, __mockReset }


text:
import os

from jenkins_jobs import parser
from jenkins_jobs import registry

from tests import base

class TestCaseModuleYamlInclude(base.SingleJobTestCase):
    fixtures_path = os.path.join(os.path.dirname(__file__), 'fixtures')
    scenarios = base.get_scenarios(fixtures_path)

class TestYamlParserExceptions(base.BaseTestCase):
    fixtures_path = os.path.join(os.path.dirname(__file__), 'exceptions')

    def test_incorrect_template_dimensions(self):
        self.conf_filename = None
        config = self._get_config()

        yp = parser.YamlParser(config)
        yp.parse(os.path.join(self.fixtures_path,
                              "incorrect_template_dimensions.yaml"))

        reg = registry.ModuleRegistry(config)

        e = self.assertRaises(Exception, yp.expandYaml, reg)
        self.assertIn("'NoneType' object is not iterable", str(e))
        self.assertIn("- branch: current\n  current: null", self.logger.output)

class TestYamlParserFailureFormattingExceptions(base.BaseScenariosTestCase):
    fixtures_path = os.path.join(os.path.dirname(__file__), 'exceptions')
    scenarios = [
        ('s1', {'name': 'template'}),
        ('s2', {'name': 'params'})
    ]

    def test_yaml_snippet(self):
        self.conf_filename = None
        config = self._get_config()

        yp = parser.YamlParser(config)
        yp.parse(os.path.join(self.fixtures_path,
                              "failure_formatting_{}.yaml".format(self.name)))

        reg = registry.ModuleRegistry(config)

        self.assertRaises(Exception, yp.expandYaml, reg)
        self.assertIn("Failure formatting {}".format(self.name),
                      self.logger.output)
        self.assertIn("Problem formatting with args", self.logger.output)


text:
//
//  LoginController.h
//  login
//
//  Created by Alaa Awad on 21/08/2014.
//  Copyright (c) 2014 Technalaa. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "AuthenticationDelegate.h"

@protocol AuthenticationDelegate;

@interface SQLoginViewController : UIViewController <UITextFieldDelegate /*,AuthenticationDelegate*/>
extern NSString *const SQLoginViewControllerDidGetAccessTokenNotification;
@property (nonatomic, weak) id<AuthenticationDelegate> authenticationDelegate;

@end


text:
'use strict';

const expect = require('chai').expect;

const Range = require('../src/source/range');

describe('range', () => {
  it('should count up from 0 with 1.', () => {
    const range = new Range();
    const iterator = range.iterator();
    var chunk = iterator.next();
    expect(chunk.data).to.equal(0);
    expect(chunk.index).to.equal(0);
    chunk = iterator.next();
    expect(chunk.data).to.equal(1);
    expect(chunk.index).to.equal(1);
    chunk = iterator.next();
    expect(chunk.data).to.equal(2);
    expect(chunk.index).to.equal(2);
  });
  it('should count up from "start" value with 1.', () => {
    const range = new Range(2);
    const iterator = range.iterator();
    var chunk = iterator.next();
    expect(chunk.data).to.equal(2);
    expect(chunk.index).to.equal(0);
    chunk = iterator.next();
    expect(chunk.data).to.equal(3);
    expect(chunk.index).to.equal(1);
    chunk = iterator.next();
    expect(chunk.data).to.equal(4);
    expect(chunk.index).to.equal(2);
  });
  it('should count up from "start" value with "step" value.', () => {
    const range = new Range(2, false, 5);
    const iterator = range.iterator();
    var chunk = iterator.next();
    expect(chunk.data).to.equal(2);
    expect(chunk.index).to.equal(0);
    chunk = iterator.next();
    expect(chunk.data).to.equal(7);
    expect(chunk.index).to.equal(1);
    chunk = iterator.next();
    expect(chunk.data).to.equal(12);
    expect(chunk.index).to.equal(2);
  });
  it('should count up from "start" value to end with "step" value.', () => {
    const range = new Range(2, 8, 5);
    const iterator = range.iterator();
    var chunk = iterator.next();
    expect(chunk.data).to.equal(2);
    expect(chunk.index).to.equal(0);
    chunk = iterator.next();
    expect(chunk.data).to.equal(7);
    expect(chunk.index).to.equal(1);
    chunk = iterator.next();
    expect(chunk.end).to.be.true;
  });
});


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

/*
Package engine provides low-level storage. It interacts with storage
backends (e.g. LevelDB, RocksDB, etc.) via the Engine interface. At
one level higher, MVCC provides multi-version concurrency control
capability on top of an Engine instance.

The Engine interface provides an API for key-value stores. InMem
implements an in-memory engine using a sorted map. RocksDB implements
an engine for data stored to local disk using RocksDB, a variant of
LevelDB.

MVCC provides a multi-version concurrency control system on top of an
engine. MVCC is the basis for Cockroach's support for distributed
transactions. It is intended for direct use from storage.Range
objects.

Notes on MVCC architecture

Each MVCC value contains a metadata key/value pair and one or more
version key/value pairs. The MVCC metadata key is the actual key for
the value, binary encoded using the SQL binary encoding scheme which
contains a sentinel byte of 0x25, following by a 7-bit encoding of the
key data with 1s in the high bit and terminated by a nil byte. The
MVCC metadata value is of type MVCCMetadata and contains the
most recent version timestamp and an optional proto.Transaction
message. If set, the most recent version of the MVCC value is a
transactional "intent". It also contains some information on the size
of the most recent version's key and value for efficient stat counter
computations.

Each MVCC version key/value pair has a key which is also
binary-encoded, but is suffixed with a decreasing, big-endian encoding
of the timestamp (8 bytes for the nanosecond wall time, followed by 4
bytes for the logical time). The MVCC version value is a message of
type MVCCValue which indicates whether the version is a deletion
timestamp and if not, contains a proto.Value object which holds the
actual value. The decreasing encoding on the timestamp sorts the most
recent version directly after the metadata key. This increases the
likelihood that an Engine.Get() of the MVCC metadata will get the same
block containing the most recent version, even if there are many
versions. We rely on getting the MVCC metadata key/value and then
using it to directly get the MVCC version using the metadata's most
recent version timestamp. This avoids using an expensive merge
iterator to scan the most recent version. It also allows us to
leverage RocksDB's bloom filters.

The binary encoding used on the MVCC keys allows arbitrary keys to be
stored in the map (no restrictions on intermediate nil-bytes, for
example), while still sorting lexicographically and guaranteeing that
all timestamp-suffixed MVCC version keys sort consecutively with the
metadata key. We use an escape-based encoding which transforms all nul
("\x00") characters in the key and is terminated with the sequence
"\x00\x01", which is guaranteed to not occur elsewhere in the encoded
value. See util/encoding/encoding.go for more details.

We considered inlining the most recent MVCC version in the
MVCCMetadata. This would reduce the storage overhead of storing the
same key twice (which is small due to block compression), and the
runtime overhead of two separate DB lookups. On the other hand, all
writes that create a new version of an existing key would incur a
double write as the previous value is moved out of the MVCCMetadata
into its versioned key. Preliminary benchmarks have not shown enough
performance improvement to justify this change, although we may
revisit this decision if it turns out that multiple versions of the
same key are rare in practice.

However, we do allow inlining in order to use the MVCC interface to
store non-versioned values. It turns out that not everything which
Cockroach needs to store would be efficient or possible using MVCC.
Examples include transaction records, response cache entries, stats
counters, time series data, and system-local config values. However,
supporting a mix of encodings is problematic in terms of resulting
complexity. So Cockroach treats an MVCC timestamp of zero to mean an
inlined, non-versioned value. These values are replaced if they exist
on a Put operation and are cleared from the engine on a delete.
Importantly, zero-timestamped MVCC values may be merged, as is
necessary for stats counters and time series data.
*/
package engine


text:
package com.perforce.p4java.core;

import java.util.Date;

import com.perforce.p4java.Log;

/**
 * Provides an interface onto, and a set of methods to access a specific
 * Perforce depot contained in a Perforce server. See the main Perforce documentation
 * and help system for a full discussion of depots and associated metadata and usage models.<p>
 *
 * IDepot objects are not updateable or refreshable, and are currently "complete" in all
 * implementations. There are no setter methods here as depots are intentionally read-only
 * in P4Java.
 */

public interface IDepot extends IServerResource {

	public enum DepotType {
		LOCAL,
		REMOTE,
		SPEC,
		STREAM,
		ARCHIVE,
		UNLOAD,
		UNKNOWN;

		/**
		 * Return a suitable Depot type as inferred from the passed-in
		 * string, which is assumed to be the string form of a Depot type.
		 * Otherwise return the UNKNOWN type
		 */
		public static DepotType fromString(String str) {
			if (str == null) {
				return null;
			}

			try {
				return DepotType.valueOf(str.toUpperCase());
			} catch (IllegalArgumentException iae) {
				Log.error("Bad conversion attempt in DepotType.fromString; string: "
						+ str + "; message: " + iae.getMessage());
				Log.exception(iae);
				return UNKNOWN;
			}
		}
	};

	/**
	 * Get the name of the depot.
	 */
	String getName();

	/**
	 * Get the Perforce user name of the depot's owner.
	 */
	String getOwnerName();

	/**
	 * Get the date the depot was last modified.
	 */
	Date getModDate();

	/**
	 * Get the description associated with this depot.
	 */
	String getDescription();

	/**
	 * Get the type of this depot.
	 */
	DepotType getDepotType();

	/**
	 * For remote depots, return the (remote) address of the depot; for other
	 * types of depot, will return null.
	 */
	String getAddress();

	/**
	 * For spec depots, return the optional suffix (default '.p4s')
	 * for the generated paths associated with the depot; for other depot types,
	 * return null.
	 */
	String getSuffix();

	/**
	 * Get the depot's path translation information.
	 */
	String getMap();
}


text:
<?xml version="1.0" encoding="utf-8"?>

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="8dp">
    <androidx.fragment.app.FragmentContainerView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:name="com.stripe.example.activity.FragmentExamplesFragment"
        android:id="@+id/fragment_container" />
</ScrollView>


text:
@rem *************************************************************************
@rem This script is used to install WebLogic Server as a Windows Service.
@rem
@rem To create your own start script for your domain, simply set the
@rem SERVER_NAME variable to your server name then call this script from your
@rem domain directory.
@rem
@rem This script sets the following variables before installing
@rem WebLogic Server as a Windows Service:
@rem
@rem WL_HOME    - The root directory of your WebLogic installation
@rem JAVA_HOME  - Location of the version of Java used to start WebLogic
@rem              Server. This variable must point to the root directory of a
@rem              JDK installation and will be set for you by the installer.
@rem              See the Oracle Fusion Middleware Supported System Configurations page
@rem              (http://www.oracle.com/technology/software/products/ias/files/fusion_certification.html)
@rem               for an up-to-date list of supported JVMs.
@rem PATH       - Adds the JDK and WebLogic directories to the system path.
@rem CLASSPATH  - Adds the JDK and WebLogic jars to the classpath.
@rem
@rem Other variables that installSvc takes are:
@rem
@rem WLS_USER     - admin username for server startup
@rem WLS_PW       - cleartext password for server startup
@rem ADMIN_URL    - if this variable is set, the server started will be a
@rem                managed server, and will look to the url specified (i.e.
@rem                http://localhost:7001) as the admin server.
@rem PRODUCTION_MODE    - set to true for production mode servers, false for
@rem                development mode
@rem JAVA_OPTIONS - Java command-line options for running the server. (These
@rem                will be tagged on to the end of the JAVA_VM and MEM_ARGS)
@rem JAVA_VM      - The java arg specifying the VM to run.  (i.e. -server,
@rem                -client, etc.)
@rem MEM_ARGS     - The variable to override the standard memory arguments
@rem                passed to java
@rem
@rem
@rem MAX_CONNECT_RETRIES - Number of attempts the Windows Service will make to check
@rem                if the Weblogic Server is started. If this variable
@rem                is specified along with HOST and PORT, the Windows Service will
@rem                wait until the Weblogic Server is started.
@rem HOST         - IP address of the Weblogic Server
@rem PORT         - Port number where the WebLogic Server is listening for requests
@rem
@rem jDriver for Oracle users: This script assumes that native libraries
@rem required for jDriver for Oracle have been installed in the proper
@rem location and that your system PATH variable has been set appropriately.
@rem
@rem For additional information, refer to "Managing Server Startup and Shutdown for Oracle WebLogic Server"
@rem (@DOCSWEBROOT/START/overview.htm).
@rem *************************************************************************

@echo off
SETLOCAL

@rem Check if SERVER_NAME is set
: check_server_name
if not defined SERVER_NAME (
@echo You need to set SERVER_NAME before
@echo installing WebLogic Server as a Windows Service
exit /b 1
)

@rem Check if DOMAIN_NAME is set
: check_domain_name
if not defined DOMAIN_NAME (
@echo You need to set DOMAIN_NAME before
@echo installing WebLogic Server as a Windows Service
exit /b 1
)

@rem Check if USERDOMAIN_NAME is set
: check_userdomain_home
if not defined USERDOMAIN_HOME (
@echo You need to set USERDOMAIN_HOME before
@echo installing WebLogic Server as a Windows Service
exit /b 1
)

@rem Check if SERVICE_DESCRIPTION is set
: check_server_name
if not defined SERVICE_DESCRIPTION (
set SERVICE_DESCRIPTION="WebLogicServer"
)

set WL_HOME=%MW_HOME%\wlserver
call "%WL_HOME%\..\oracle_common\common\bin\commEnv.cmd"

@rem Check that the WebLogic classes are where we expect them to be
:checkWLS
if exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJava
echo The WebLogic Server wasn't found in directory %WL_HOME%\server.
echo Please edit your script so that the WL_HOME variable points
echo to the WebLogic installation directory.
goto finish

@rem Check that java is where we expect it to be
:checkJava
if exist "%JAVA_HOME%\bin\java.exe" goto runWebLogic
echo The JDK wasn't found in directory %JAVA_HOME%.
echo Please edit your script so that the JAVA_HOME variable
echo points to the location of your JDK.
goto finish

:runWebLogic

@rem the service loads dll file, so the JAVA_VM *must* be correct
if exist %JRE_HOME%\bin\client (
set JAVA_VM=-client
) else if exist %JRE_HOME%\bin\server (
set JAVA_VM=-server
) else if exist %JRE_HOME%\bin\jrockit (
set JAVA_VM=-jrockit
)

:noResetJavaVM
if not "%MEM_ARGS%" == "" goto noResetMemArgs
set MEM_ARGS=-Xms32m -Xmx200m

:noResetMemArgs

@echo on

call %1

set CLASSPATH=%WEBLOGIC_CLASSPATH%;%CLASSPATH%

@echo ***************************************************
@echo *  To start WebLogic Server, use the password     *
@echo *  assigned to the system user.  The system       *
@echo *  username and password must also be used to     *
@echo *  access the WebLogic Server console from a web  *
@echo *  browser.                                       *
@echo ***************************************************

rem *** Set Command Line for service to execute within created JVM

@echo off

if "%ADMIN_URL%" == "" goto runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.management.server=\"%ADMIN_URL%\" -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"
goto finish

:runAdmin
@echo on
set CMDLINE="%JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -classpath \"%CLASSPATH%\" -Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=\"%WL_HOME%\server\lib\weblogic.policy\" weblogic.Server"

:finish
rem *** Set up extrapath for win32 and win64 platform separately
set WLSVC_EXE_TO_USE=wlsvcx64
if "%WL_USE_X86DLL%" == "true" (
 set EXTRAPATH=%WL_HOME%\server\native\win\32;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\32\oci920_8
 set WLSVC_EXE_TO_USE=wlsvc
)

if "%WL_USE_IA64DLL%" == "true" (
 set EXTRAPATH=%WL_HOME%\server\native\win\64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\64\oci920_8
 set WLSVC_EXE_TO_USE=wlsvc64
)

if "%WL_USE_AMD64DLL%" == "true" (
 set EXTRAPATH=%WL_HOME%\server\native\win\x64\;%WL_HOME%\server\bin;%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%WL_HOME%\server\native\win\x64\oci920_8
 set WLSVC_EXE_TO_USE=wlsvcx64
)

rem *** Install the service
"%WL_HOME%\server\bin\%WLSVC_EXE_TO_USE%" -install -svcname:"wlsvc %DOMAIN_NAME%_%SERVER_NAME%" -svcdescription:"%SERVICE_DESCRIPTION%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE% -log:"%USERDOMAIN_HOME%\logs\%SERVER_NAME%.out"

ENDLOCAL


text:
import { createMaze } from './maze';
import { Bullet } from './bullet';
import { Human } from './human';
import { createImages } from './img';
import { Keys } from './keys';
import { levels } from './levels';

const GAME_MODE_LOSE = 1;
const GAME_MODE_GAME = 2;
const GAME_MODE_FINISH = 3;

export class Klad {

    constructor(context) {
        var that = this;
        document.addEventListener('DOMContentLoaded', function () {
            that.run(context);
        });
    }

    run(context) {
        this.gameMode = GAME_MODE_GAME;
        this.currentLevel = 0;
        this.ctx = context.getElementById('canvas').getContext('2d');
        this.delayUpdate = 0;
        this.delayUpdateAliens = 0;
        this.maze = createMaze();
        this.player = new Human(false, this.maze);
        this.alien = new Human(true, this.maze);
        this.alien1 = null;
        this.bullet = new Bullet(this.maze);
        this.images = createImages();
        this.keys = new Keys(context);

        this.ctx.scale(2, 2);
        this.restartLevel();
        requestAnimationFrame(this.frame.bind(this));
    }

    restartLevel() {
        this.maze.loadLevel(this.currentLevel, levels);
        this.bullet = new Bullet(this.maze);
        this.player.resetFinished();
        this.player.respawn(levels[this.currentLevel].player.x, levels[this.currentLevel].player.y);
        this.player.resetKeyFound();
        this.alien.respawn(levels[this.currentLevel].aliens[0].x, levels[this.currentLevel].aliens[0].y);
        this.alien1 = null;
        if (levels[this.currentLevel].aliens[1]) {
            this.alien1 = new Human(true, this.maze);
            this.alien1.respawn(levels[this.currentLevel].aliens[1].x, levels[this.currentLevel].aliens[1].y);
        }
    }

    updateLose() {
        if (this.delayUpdate < 60) {
            this.delayUpdate += 1;
            return;
        }
        this.gameMode = GAME_MODE_GAME;
        this.restartLevel();
    }

    updateFinish() {
        if (this.delayUpdate < 30) {
            this.delayUpdate += 1;
            return;
        }
        this.gameMode = GAME_MODE_GAME;
        this.currentLevel += 1;
        if (this.currentLevel >= 5) {
            this.currentLevel = 0;
        }
        this.restartLevel();
    }

    updateGame() {
        this.delayUpdate += 1;
        if (this.delayUpdate < 2) {
            return;
        }
        this.delayUpdate = 0;

        this.delayUpdateAliens += 1;
        if (this.delayUpdateAliens > 2) {
            this.delayUpdateAliens = 0;
        } else {
            this.alien.moveToHuman(this.player);
            if (this.alien1) {
                this.alien1.moveToHuman(this.player);
            }
        }

        let caught = this.player.caught(this.alien);
        if (this.alien1) {
            if (this.alien1.caught(this.player)) {
                caught = true;
            }
        }

        if (caught) {
            this.player.kill();
            this.alien.kill();
            if (this.alien1) {
                this.alien1.kill();
            }
        }

        this.bullet.move();
        this.maze.wallRegen();

        this.player.move(this.keys.isLeft(), this.keys.isRight(),
            this.keys.isUp(), this.keys.isDown());

        if (this.keys.isFireLeft()) {
            this.bullet.shotLeft(this.player.getPos());
        }
        if (this.keys.isFireRight()) {
            this.bullet.shotRight(this.player.getPos());
        }

        if (this.player.isFinished()) {
            this.gameMode = GAME_MODE_FINISH;
            return;
        }

        if (this.player.isDead()) {
            this.gameMode = GAME_MODE_LOSE;
        }
    }

    update() {
        switch (this.gameMode) {
            case GAME_MODE_LOSE:
                this.updateLose();
                break;
            case GAME_MODE_GAME:
                this.updateGame();
                break;
            case GAME_MODE_FINISH:
                this.updateFinish();
                break;
        }
    }

    render() {
        this.maze.render(this.ctx, this.images);
        this.player.render(this.ctx, this.images);
        this.alien.render(this.ctx, this.images);
        if (this.alien1) {
            this.alien1.render(this.ctx, this.images);
        }
        this.bullet.render(this.ctx, this.images);
    }

    frame() {
        this.update();
        this.render();
        requestAnimationFrame(this.frame.bind(this));
    }
}


text:
package au.com.noojee.acceloapi.dao;

import java.io.FileNotFoundException;
import java.time.LocalDateTime;
import java.util.List;

import org.junit.Test;

import au.com.noojee.acceloapi.AcceloApi;
import au.com.noojee.acceloapi.AcceloSecret;
import au.com.noojee.acceloapi.entities.Ticket;
import au.com.noojee.acceloapi.entities.Ticket.Standing;
import au.com.noojee.acceloapi.entities.meta.Ticket_;
import au.com.noojee.acceloapi.filter.AcceloFilter;

public class TicketDaoMissingContracts
{

	@Test
	public void test() throws FileNotFoundException
	{
		AcceloSecret secret = AcceloSecret.load();
		AcceloApi.getInstance().connect(secret);
		TicketDao daoTicket = new TicketDao();

		AcceloFilter<Ticket> filter = new AcceloFilter<>();

		filter.where(filter.eq(Ticket_.contract, 0)).and(filter.after(Ticket_.date_submitted, LocalDateTime.of(2017, 03, 01, 0, 0, 0)).and(filter.eq(Ticket_.standing, Standing.closed)));

		filter.limit(AcceloFilter.UNLIMITED);

		List<Ticket> tickets = daoTicket.getByFilter(filter);

		System.out.println("Total Tickets with No Contract" + tickets.size());

	}

}


text:
@interface GXShareCopyLinkTask ()

@end

@implementation GXShareCopyLinkTask

- (instancetype)init {
    if(self = [super init]) {
        _shareType = SNSTypeyLinkCopy;
    }
    return self;
}

- (BOOL)willCallbackWhenShareStop {
    return NO;
}

- (void)shareImage:(id)image
           caption:(NSString *)caption
       description:(NSString *)description
             model:(GXShareCellModel *)shareModel
          shareUrl:(NSURL *)shareURL
         albumName:(NSString *)albumName
   andAssociatedVC:(UIViewController *)controller {

    if(description) {
        UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
        [pasteboard setString:description];
        if(_delegate && [_delegate respondsToSelector:@selector(requestShareManagerToShowAlert:message:confirmInfo:cancelInfo:delay:completion:)]) {
            [_delegate requestShareManagerToShowAlert:shareModel.requestTitle
                                                  message:shareModel.requestDesc
                                              confirmInfo:shareModel.confirmStr
                                               cancelInfo:shareModel.cancelStr
                                                    delay:shareModel.delayInterval
                                               completion:^(BOOL success) {
                                                   if(success) {

                                                   }
                                               }];
        }
    }
}

- (void)shareVideo:(NSURL *)videoURL
           caption:(NSString *)caption
       description:(NSString *)description
             model:(GXShareCellModel *)shareModel
          shareUrl:(NSURL *)shareURL
         albumName:(NSString *)albumName
   andAssociatedVC:(UIViewController *)controller {

    if(description) {
        UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
        [pasteboard setString:description];
        if(_delegate && [_delegate respondsToSelector:@selector(requestShareManagerToShowAlert:message:confirmInfo:cancelInfo:delay:completion:)]) {
            [_delegate requestShareManagerToShowAlert:shareModel.requestTitleForVideo
                                              message:shareModel.requestDesc
                                          confirmInfo:shareModel.confirmStr
                                           cancelInfo:shareModel.cancelStr
                                                delay:shareModel.delayInterval
                                           completion:^(BOOL success) {
                                               if(success) {

                                               }
                                           }];
        }
    }
}

- (void)associateDelegate:(id<GXShareTaskDelegate>)delegate {
    [super associateDelegate:delegate];
}

@end


text:
package org.apache.ignite.internal.processors.hadoop;

import org.apache.ignite.*;
import org.apache.ignite.internal.processors.hadoop.counter.*;

import java.util.*;
import java.util.concurrent.*;

/**
 * Task context.
 */
public abstract class HadoopTaskContext {
    /** */
    protected final HadoopJob job;

    /** */
    private HadoopTaskInput input;

    /** */
    private HadoopTaskOutput output;

    /** */
    private HadoopTaskInfo taskInfo;

    /**
     * @param taskInfo Task info.
     * @param job Job.
     */
    protected HadoopTaskContext(HadoopTaskInfo taskInfo, HadoopJob job) {
        this.taskInfo = taskInfo;
        this.job = job;
    }

    /**
     * Gets task info.
     *
     * @return Task info.
     */
    public HadoopTaskInfo taskInfo() {
        return taskInfo;
    }

    /**
     * Set a new task info.
     *
     * @param info Task info.
     */
    public void taskInfo(HadoopTaskInfo info) {
        taskInfo = info;
    }

    /**
     * Gets task output.
     *
     * @return Task output.
     */
    public HadoopTaskOutput output() {
        return output;
    }

    /**
     * Gets task input.
     *
     * @return Task input.
     */
    public HadoopTaskInput input() {
        return input;
    }

    /**
     * @return Job.
     */
    public HadoopJob job() {
        return job;
    }

    /**
     * Gets counter for the given name.
     *
     * @param grp Counter group's name.
     * @param name Counter name.
     * @return Counter.
     */
    public abstract <T extends HadoopCounter> T counter(String grp, String name, Class<T> cls);

    /**
     * Gets all known counters.
     *
     * @return Unmodifiable collection of counters.
     */
    public abstract HadoopCounters counters();

    /**
     * Sets input of the task.
     *
     * @param in Input.
     */
    public void input(HadoopTaskInput in) {
        input = in;
    }

    /**
     * Sets output of the task.
     *
     * @param out Output.
     */
    public void output(HadoopTaskOutput out) {
        output = out;
    }

    /**
     * Gets partitioner.
     *
     * @return Partitioner.
     * @throws IgniteCheckedException If failed.
     */
    public abstract HadoopPartitioner partitioner() throws IgniteCheckedException;

    /**
     * Gets serializer for values.
     *
     * @return Serializer for keys.
     * @throws IgniteCheckedException If failed.
     */
    public abstract HadoopSerialization keySerialization() throws IgniteCheckedException;

    /**
     * Gets serializer for values.
     *
     * @return Serializer for values.
     * @throws IgniteCheckedException If failed.
     */
    public abstract HadoopSerialization valueSerialization() throws IgniteCheckedException;

    /**
     * Gets sorting comparator.
     *
     * @return Comparator for sorting.
     */
    public abstract Comparator<Object> sortComparator();

    /**
     * Gets comparator for grouping on combine or reduce operation.
     *
     * @return Comparator.
     */
    public abstract Comparator<Object> groupComparator();

    /**
     * Execute current task.
     *
     * @throws IgniteCheckedException If failed.
     */
    public abstract void run() throws IgniteCheckedException;

    /**
     * Cancel current task execution.
     */
    public abstract void cancel();

    /**
     * Prepare local environment for the task.
     *
     * @throws IgniteCheckedException If failed.
     */
    public abstract void prepareTaskEnvironment() throws IgniteCheckedException;

    /**
     *  Cleans up local environment of the task.
     *
     * @throws IgniteCheckedException If failed.
     */
    public abstract void cleanupTaskEnvironment() throws IgniteCheckedException;

    /**
     * Executes a callable on behalf of the job owner.
     * In case of embedded task execution the implementation of this method
     * will use classes loaded by the ClassLoader this HadoopTaskContext loaded with.
     * @param c The callable.
     * @param <T> The return type of the Callable.
     * @return The result of the callable.
     * @throws IgniteCheckedException On any error in callable.
     */
    public abstract <T> T runAsJobOwner(Callable<T> c) throws IgniteCheckedException;
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
 <status>OK</status>
 <result>
  <type>locality</type>
  <type>political</type>
  <formatted_address>3550 Langenlois, Austria</formatted_address>
  <address_component>
   <long_name>Langenlois</long_name>
   <short_name>Langenlois</short_name>
   <type>locality</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Gemeinde Langenlois</long_name>
   <short_name>Gemeinde Langenlois</short_name>
   <type>administrative_area_level_3</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Krems-Land District</long_name>
   <short_name>Krems-Land District</short_name>
   <type>administrative_area_level_2</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Lower Austria</long_name>
   <short_name>Lower Austria</short_name>
   <type>administrative_area_level_1</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>Austria</long_name>
   <short_name>AT</short_name>
   <type>country</type>
   <type>political</type>
  </address_component>
  <address_component>
   <long_name>3550</long_name>
   <short_name>3550</short_name>
   <type>postal_code</type>
  </address_component>
  <geometry>
   <location>
    <lat>48.4738543</lat>
    <lng>15.6928430</lng>
   </location>
   <location_type>APPROXIMATE</location_type>
   <viewport>
    <southwest>
     <lat>48.4664564</lat>
     <lng>15.6768356</lng>
    </southwest>
    <northeast>
     <lat>48.4812511</lat>
     <lng>15.7088504</lng>
    </northeast>
   </viewport>
  </geometry>
  <partial_match>true</partial_match>
  <place_id>ChIJJa12x5-cckcRBtfx_anMBXs</place_id>
 </result>
</GeocodeResponse>


text:
require 'penta_git/version'

module PentaGit
end


text:
import EdgeProxy = require("EdgeProxy");

class EdgeFable implements IFable {

    private edge: any;
    private proxy: EdgeProxy;

    constructor(assembly: string, private fableName: string) {
        this.proxy = new EdgeProxy(assembly, "Fable.EdgeHost");
    }

    topic(topicName: string) : ITopic {
        return {
            subscribe: sink => this.subscribeTopic(topicName, sink),
            unsubscribe: sink => this.unsubscribeTopic(topicName, sink)
        };
    }

    private subscribeTopic(name: string, sink: IEventSink): Q.IPromise<any[]> {
        return this.proxy.call<any[]>("SubscribeTopic", {
            fable: this.fableName,
            topic: name,
            sink: (e: string) => sink(JSON.parse(e)),
            id: "aaa"
        });
    }

    private unsubscribeTopic(name: string, sink: IEventSink): Q.IPromise<void> {
        return this.proxy.call<void>("UnsubscribeTopic", "aaa");
    }
}

export = EdgeFable;


text:
package androidx.camera.camera2.internal;

import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraDevice;
import android.hardware.camera2.CaptureRequest;
import android.os.Build;
import android.os.Handler;
import android.view.Surface;

import androidx.annotation.DoNotInline;
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.camera.camera2.internal.annotation.CameraExecutor;
import androidx.camera.camera2.internal.compat.CameraCaptureSessionCompat;
import androidx.camera.camera2.internal.compat.CameraDeviceCompat;
import androidx.camera.camera2.internal.compat.params.OutputConfigurationCompat;
import androidx.camera.camera2.internal.compat.params.SessionConfigurationCompat;
import androidx.camera.core.Logger;
import androidx.camera.core.impl.DeferrableSurface;
import androidx.camera.core.impl.DeferrableSurfaces;
import androidx.camera.core.impl.utils.executor.CameraXExecutors;
import androidx.camera.core.impl.utils.futures.FutureCallback;
import androidx.camera.core.impl.utils.futures.FutureChain;
import androidx.camera.core.impl.utils.futures.Futures;
import androidx.concurrent.futures.CallbackToFutureAdapter;
import androidx.concurrent.futures.CallbackToFutureAdapter.Completer;
import androidx.core.util.Preconditions;

import com.google.common.util.concurrent.ListenableFuture;

import java.util.List;
import java.util.Objects;
import java.util.concurrent.CancellationException;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;

/**
 * The basic implementation of {@link SynchronizedCaptureSession} to forward the feature calls
 * into the {@link CameraCaptureSession}. It will not synchronize methods with the other
 * SynchronizedCaptureSessions.
 *
 * The {@link StateCallback} to receives the state callbacks from the
 * {@link CameraCaptureSession.StateCallback} and convert the {@link CameraCaptureSession} to the
 * SynchronizedCaptureSession object.
 */
@RequiresApi(21) // TODO(b/200306659): Remove and replace with annotation on package-info.java
class SynchronizedCaptureSessionBaseImpl extends SynchronizedCaptureSession.StateCallback implements
        SynchronizedCaptureSession, SynchronizedCaptureSessionOpener.OpenerImpl {

    private static final String TAG = "SyncCaptureSessionBase";

    @SuppressWarnings("WeakerAccess") /* synthetic accessor */
    final Object mLock = new Object();

    @NonNull
    final CaptureSessionRepository mCaptureSessionRepository;
    @NonNull
    final Handler mCompatHandler;
    @NonNull
    @CameraExecutor
    final Executor mExecutor;
    @NonNull
    private final ScheduledExecutorService mScheduledExecutorService;

    @Nullable
    StateCallback mCaptureSessionStateCallback;
    @Nullable
    CameraCaptureSessionCompat mCameraCaptureSessionCompat;

    @Nullable
    @GuardedBy("mLock")
    ListenableFuture<Void> mOpenCaptureSessionFuture;
    @SuppressWarnings("WeakerAccess") /* synthetic accessor */
    @Nullable
    @GuardedBy("mLock")
    Completer<Void> mOpenCaptureSessionCompleter;

    @Nullable
    @GuardedBy("mLock")
    private ListenableFuture<List<Surface>> mStartingSurface;

    @Nullable
    @GuardedBy("mLock")
    private List<DeferrableSurface> mHeldDeferrableSurfaces = null;

    @GuardedBy("mLock")
    private boolean mClosed = false;
    @GuardedBy("mLock")
    private boolean mOpenerDisabled = false;
    @GuardedBy("mLock")
    private boolean mSessionFinished = false;

    SynchronizedCaptureSessionBaseImpl(@NonNull CaptureSessionRepository repository,
            @NonNull @CameraExecutor Executor executor,
            @NonNull ScheduledExecutorService scheduledExecutorService,
            @NonNull Handler compatHandler) {
        mCaptureSessionRepository = repository;
        mCompatHandler = compatHandler;
        mExecutor = executor;
        mScheduledExecutorService = scheduledExecutorService;
    }

    @NonNull
    @Override
    public StateCallback getStateCallback() {
        return this;
    }

    @NonNull
    @Override
    public ListenableFuture<Void> getOpeningBlocker() {
        return Futures.immediateFuture(null);
    }

    @NonNull
    @Override
    public ListenableFuture<Void> openCaptureSession(@NonNull CameraDevice cameraDevice,
            @NonNull SessionConfigurationCompat sessionConfigurationCompat,
            @NonNull List<DeferrableSurface> deferrableSurfaces) {
        synchronized (mLock) {
            if (mOpenerDisabled) {
                return Futures.immediateFailedFuture(
                        new CancellationException("Opener is disabled"));
            }
            mCaptureSessionRepository.onCreateCaptureSession(this);
            CameraDeviceCompat cameraDeviceCompat =
                    CameraDeviceCompat.toCameraDeviceCompat(cameraDevice, mCompatHandler);
            mOpenCaptureSessionFuture = CallbackToFutureAdapter.getFuture(
                    completer -> {
                        synchronized (mLock) {
                            // Attempt to set all the configured deferrable surfaces is in used
                            // before adding them to the session.
                            holdDeferrableSurfaces(deferrableSurfaces);

                            Preconditions.checkState(mOpenCaptureSessionCompleter == null,
                                    "The openCaptureSessionCompleter can only set once!");

                            mOpenCaptureSessionCompleter = completer;
                            cameraDeviceCompat.createCaptureSession(sessionConfigurationCompat);
                            return "openCaptureSession[session="
                                    + SynchronizedCaptureSessionBaseImpl.this + "]";
                        }
                    });

            Futures.addCallback(mOpenCaptureSessionFuture, new FutureCallback<Void>() {
                @Override
                public void onSuccess(@Nullable Void result) {
                    // Nothing to do.
                }

                @Override
                public void onFailure(@NonNull Throwable t) {
                    SynchronizedCaptureSessionBaseImpl.this.finishClose();
                    mCaptureSessionRepository.onCaptureSessionConfigureFail(
                            SynchronizedCaptureSessionBaseImpl.this);
                }
            }, CameraXExecutors.directExecutor());

            return Futures.nonCancellationPropagating(mOpenCaptureSessionFuture);
        }
    }

    boolean isCameraCaptureSessionOpen() {
        synchronized (mLock) {
            return mOpenCaptureSessionFuture != null;
        }
    }

    @NonNull
    @Override
    public SessionConfigurationCompat createSessionConfigurationCompat(
            int sessionType,
            @NonNull List<OutputConfigurationCompat> outputsCompat,
            @NonNull StateCallback stateCallback) {
        mCaptureSessionStateCallback = stateCallback;
        return new SessionConfigurationCompat(sessionType, outputsCompat, getExecutor(),
                new CameraCaptureSession.StateCallback() {

                    @Override
                    public void onReady(@NonNull CameraCaptureSession session) {
                        createCaptureSessionCompat(session);
                        SynchronizedCaptureSessionBaseImpl.this.onReady(
                                SynchronizedCaptureSessionBaseImpl.this);
                    }

                    @Override
                    public void onActive(@NonNull CameraCaptureSession session) {
                        createCaptureSessionCompat(session);
                        SynchronizedCaptureSessionBaseImpl.this.onActive(
                                SynchronizedCaptureSessionBaseImpl.this);
                    }

                    @RequiresApi(api = Build.VERSION_CODES.O)
                    @Override
                    public void onCaptureQueueEmpty(@NonNull CameraCaptureSession session) {
                        createCaptureSessionCompat(session);
                        SynchronizedCaptureSessionBaseImpl.this.onCaptureQueueEmpty(
                                SynchronizedCaptureSessionBaseImpl.this);
                    }

                    @RequiresApi(api = Build.VERSION_CODES.M)
                    @Override
                    public void onSurfacePrepared(
                            @NonNull CameraCaptureSession session,
                            @NonNull Surface surface) {
                        createCaptureSessionCompat(session);
                        SynchronizedCaptureSessionBaseImpl.this.onSurfacePrepared(
                                SynchronizedCaptureSessionBaseImpl.this, surface);
                    }

                    @Override
                    public void onConfigured(@NonNull CameraCaptureSession session) {
                        try {
                            createCaptureSessionCompat(session);
                            SynchronizedCaptureSessionBaseImpl.this.onConfigured(
                                    SynchronizedCaptureSessionBaseImpl.this);
                        } finally {
                            // Finish the mOpenCaptureSessionCompleter after callback.
                            Completer<Void> completer;
                            synchronized (mLock) {
                                Preconditions.checkNotNull(mOpenCaptureSessionCompleter,
                                        "OpenCaptureSession completer should not null");
                                completer = mOpenCaptureSessionCompleter;
                                mOpenCaptureSessionCompleter = null;
                            }
                            completer.set(null);
                        }
                    }

                    @Override
                    public void onConfigureFailed(@NonNull CameraCaptureSession session) {
                        try {
                            createCaptureSessionCompat(session);
                            SynchronizedCaptureSessionBaseImpl.this.onConfigureFailed(
                                    SynchronizedCaptureSessionBaseImpl.this);
                        } finally {
                            // Finish the mOpenCaptureSessionCompleter after callback.
                            Completer<Void> completer;
                            synchronized (mLock) {
                                Preconditions.checkNotNull(mOpenCaptureSessionCompleter,
                                        "OpenCaptureSession completer should not null");
                                completer = mOpenCaptureSessionCompleter;
                                mOpenCaptureSessionCompleter = null;
                            }
                            completer.setException(new IllegalStateException("onConfigureFailed"));
                        }
                    }

                    @Override
                    public void onClosed(@NonNull CameraCaptureSession session) {
                        createCaptureSessionCompat(session);
                        SynchronizedCaptureSessionBaseImpl.this.onClosed(
                                SynchronizedCaptureSessionBaseImpl.this);
                    }
                });
    }

    @NonNull
    @Override
    @CameraExecutor
    public Executor getExecutor() {
        return mExecutor;
    }

    void createCaptureSessionCompat(@NonNull CameraCaptureSession session) {
        if (mCameraCaptureSessionCompat == null) {
            mCameraCaptureSessionCompat = CameraCaptureSessionCompat.toCameraCaptureSessionCompat(
                    session, mCompatHandler);
        }
    }

    @SuppressWarnings("ConstantConditions") // Implied non-null type use for surfaces.
    @NonNull
    @Override
    public ListenableFuture<List<Surface>> startWithDeferrableSurface(
            @NonNull List<DeferrableSurface> deferrableSurfaces, long timeout) {
        synchronized (mLock) {
            if (mOpenerDisabled) {
                return Futures.immediateFailedFuture(
                        new CancellationException("Opener is disabled"));
            }

            mStartingSurface = FutureChain.from(
                    DeferrableSurfaces.surfaceListWithTimeout(deferrableSurfaces, false, timeout,
                            getExecutor(), mScheduledExecutorService)).transformAsync(surfaces -> {
                                Logger.d(TAG,
                                        "[" + SynchronizedCaptureSessionBaseImpl.this
                                                + "] getSurface...done");
                                // If a Surface in configuredSurfaces is null it means the
                                // Surface was not retrieved from the ListenableFuture. Only
                                // handle the first failed Surface since subsequent calls to
                                // CaptureSession.open() will handle the other failed Surfaces if
                                // there are any.
                                if (surfaces.contains(null)) {
                                    DeferrableSurface deferrableSurface = deferrableSurfaces.get(
                                            surfaces.indexOf(null));
                                    return Futures.immediateFailedFuture(
                                            new DeferrableSurface.SurfaceClosedException(
                                                    "Surface closed", deferrableSurface));
                                }

                                if (surfaces.isEmpty()) {
                                    return Futures.immediateFailedFuture(
                                            new IllegalArgumentException(
                                                    "Unable to open capture session without "
                                                            + "surfaces"));
                                }

                                return Futures.immediateFuture(surfaces);
                            }, getExecutor());

            return Futures.nonCancellationPropagating(mStartingSurface);
        }
    }

    @Override
    public boolean stop() {
        ListenableFuture<List<Surface>> startingSurface = null;
        try {
            synchronized (mLock) {
                if (!mOpenerDisabled) {
                    if (mStartingSurface != null) {
                        startingSurface = mStartingSurface;
                    }
                    mOpenerDisabled = true;
                }

                // Return true if the CameraCaptureSession creation has not been started yet.
                return !isCameraCaptureSessionOpen();
            }
        } finally {
            if (startingSurface != null) {
                startingSurface.cancel(true);
            }
        }
    }

    @NonNull
    @Override
    public CameraCaptureSessionCompat toCameraCaptureSessionCompat() {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat);
        return mCameraCaptureSessionCompat;
    }

    @NonNull
    @Override
    public CameraDevice getDevice() {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat);
        return mCameraCaptureSessionCompat.toCameraCaptureSession().getDevice();
    }

    @Nullable
    @Override
    public Surface getInputSurface() {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            return Api23Impl.getInputSurface(mCameraCaptureSessionCompat.toCameraCaptureSession());
        } else {
            return null;
        }
    }

    @Override
    public int captureSingleRequest(@NonNull CaptureRequest request,
            @NonNull CameraCaptureSession.CaptureCallback listener) throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        return mCameraCaptureSessionCompat.captureSingleRequest(request, getExecutor(), listener);
    }

    @Override
    public int captureBurstRequests(
            @NonNull List<CaptureRequest> requests,
            @NonNull CameraCaptureSession.CaptureCallback listener)
            throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        return mCameraCaptureSessionCompat.captureBurstRequests(requests, getExecutor(), listener);
    }

    @Override
    public int setSingleRepeatingRequest(
            @NonNull CaptureRequest request,
            @NonNull CameraCaptureSession.CaptureCallback listener)
            throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        return mCameraCaptureSessionCompat.setSingleRepeatingRequest(request, getExecutor(),
                listener);
    }

    @Override
    public int setRepeatingBurstRequests(
            @NonNull List<CaptureRequest> requests,
            @NonNull CameraCaptureSession.CaptureCallback listener)
            throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        return mCameraCaptureSessionCompat.setRepeatingBurstRequests(requests, getExecutor(),
                listener);
    }

    @Override
    public int captureSingleRequest(@NonNull CaptureRequest request, @NonNull Executor executor,
            @NonNull CameraCaptureSession.CaptureCallback listener) throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat,
                "Need to call openCaptureSession before using this API.");
        return mCameraCaptureSessionCompat.captureSingleRequest(request, executor, listener);
    }

    @Override
    public int captureBurstRequests(@NonNull List<CaptureRequest> requests,
            @NonNull Executor executor, @NonNull CameraCaptureSession.CaptureCallback listener)
            throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat,
                "Need to call openCaptureSession before using this API.");
        return mCameraCaptureSessionCompat.captureBurstRequests(requests, executor, listener);
    }

    @Override
    public int setSingleRepeatingRequest(@NonNull CaptureRequest request,
            @NonNull Executor executor, @NonNull CameraCaptureSession.CaptureCallback listener)
            throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat,
                "Need to call openCaptureSession before using this API.");
        return mCameraCaptureSessionCompat.setSingleRepeatingRequest(request, executor, listener);
    }

    @Override
    public int setRepeatingBurstRequests(@NonNull List<CaptureRequest> requests,
            @NonNull Executor executor, @NonNull CameraCaptureSession.CaptureCallback listener)
            throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat,
                "Need to call openCaptureSession before using this API.");
        return mCameraCaptureSessionCompat.setRepeatingBurstRequests(requests, executor, listener);
    }

    @Override
    public void stopRepeating() throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        mCameraCaptureSessionCompat.toCameraCaptureSession().stopRepeating();
    }

    @Override
    public void abortCaptures() throws CameraAccessException {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        mCameraCaptureSessionCompat.toCameraCaptureSession().abortCaptures();
    }

    @Override
    public void close() {
        Preconditions.checkNotNull(mCameraCaptureSessionCompat, "Need to call openCaptureSession "
                + "before using this API.");
        mCaptureSessionRepository.onCaptureSessionClosing(this);
        mCameraCaptureSessionCompat.toCameraCaptureSession().close();
        // Invoke the onSessionFinished callback directly to inform the closing
        // step can be finished.
        getExecutor().execute(() -> onSessionFinished(this));
    }

    @Override
    public void onReady(@NonNull SynchronizedCaptureSession session) {
        Objects.requireNonNull(mCaptureSessionStateCallback);
        mCaptureSessionStateCallback.onReady(session);
    }

    @Override
    public void onActive(@NonNull SynchronizedCaptureSession session) {
        Objects.requireNonNull(mCaptureSessionStateCallback);
        mCaptureSessionStateCallback.onActive(session);
    }

    @RequiresApi(api = Build.VERSION_CODES.O)
    @Override
    public void onCaptureQueueEmpty(@NonNull SynchronizedCaptureSession session) {
        Objects.requireNonNull(mCaptureSessionStateCallback);
        mCaptureSessionStateCallback.onCaptureQueueEmpty(session);
    }

    @RequiresApi(api = Build.VERSION_CODES.M)
    @Override
    public void onSurfacePrepared(@NonNull SynchronizedCaptureSession session,
            @NonNull Surface surface) {
        Objects.requireNonNull(mCaptureSessionStateCallback);
        mCaptureSessionStateCallback.onSurfacePrepared(session, surface);
    }

    @Override
    public void onConfigured(@NonNull SynchronizedCaptureSession session) {
        Objects.requireNonNull(mCaptureSessionStateCallback);
        mCaptureSessionRepository.onCaptureSessionCreated(this);
        mCaptureSessionStateCallback.onConfigured(session);
    }

    @Override
    public void onConfigureFailed(@NonNull SynchronizedCaptureSession session) {
        Objects.requireNonNull(mCaptureSessionStateCallback);
        finishClose();
        mCaptureSessionRepository.onCaptureSessionConfigureFail(this);
        mCaptureSessionStateCallback.onConfigureFailed(session);
    }

    /**
     * The onClosed will be invoked when the CameraCaptureSession is closed or when we apply the
     * workaround the issues like b/140955560, b/144817309 to force close the session.
     *
     * <p>This callback will be invoked after the SynchronizedCaptureSession#openCaptureSession
     * is completed, and at most be called once.
     *
     * @param session the SynchronizedCaptureSession that is created by
     * {@link SynchronizedCaptureSessionImpl#openCaptureSession}
     */
    @Override
    public void onClosed(@NonNull SynchronizedCaptureSession session) {
        ListenableFuture<Void> openFuture = null;
        synchronized (mLock) {
            if (!mClosed) {
                mClosed = true;
                Preconditions.checkNotNull(mOpenCaptureSessionFuture,
                        "Need to call openCaptureSession before using this API.");
                // Only callback onClosed after the capture session is configured.
                openFuture = mOpenCaptureSessionFuture;
            }
        }
        finishClose();
        if (openFuture != null) {
            openFuture.addListener(() -> {
                // Set the CaptureSession closed before invoke the state callback.
                mCaptureSessionRepository.onCaptureSessionClosed(
                        SynchronizedCaptureSessionBaseImpl.this);

                // Invoke the onSessionFinished since the SynchronizedCaptureSession receives
                // the onClosed callback, we can treat this session is already in closed state.
                onSessionFinished(session);

                Objects.requireNonNull(mCaptureSessionStateCallback);
                mCaptureSessionStateCallback.onClosed(session);
            }, CameraXExecutors.directExecutor());
        }
    }

    @Override
    void onSessionFinished(@NonNull SynchronizedCaptureSession session) {
        ListenableFuture<Void> openFuture = null;
        synchronized (mLock) {
            if (!mSessionFinished) {
                mSessionFinished = true;
                Preconditions.checkNotNull(mOpenCaptureSessionFuture,
                        "Need to call openCaptureSession before using this API.");
                // Only callback onClosed after the capture session is configured.
                openFuture = mOpenCaptureSessionFuture;
            }
        }
        if (openFuture != null) {
            openFuture.addListener(() -> {
                Objects.requireNonNull(mCaptureSessionStateCallback);
                mCaptureSessionStateCallback.onSessionFinished(session);
            }, CameraXExecutors.directExecutor());
        }
    }

    /**
     * Hold the DeferrableSurfaces to be used for this session to prevent the DeferrableSurfaces
     * from being released.
     *
     * <p>Only one set of DeferrableSurfaces will be set to in used at the same time, it will unset
     * the previous deferrableSurfaces if it has been set before.
     *
     * @param deferrableSurfaces will be set to in used.
     * @throws DeferrableSurface.SurfaceClosedException if the deferrableSurfaces contains any
     * closed surface.
     */
    void holdDeferrableSurfaces(@NonNull List<DeferrableSurface> deferrableSurfaces)
            throws DeferrableSurface.SurfaceClosedException {
        synchronized (mLock) {
            releaseDeferrableSurfaces();
            DeferrableSurfaces.incrementAll(deferrableSurfaces);
            mHeldDeferrableSurfaces = deferrableSurfaces;
        }
    }

    /**
     * Release the DeferrableSurfaces that is held by the holdDeferrableSurfaces()
     */
    void releaseDeferrableSurfaces() {
        synchronized (mLock) {
            if (mHeldDeferrableSurfaces != null) {
                DeferrableSurfaces.decrementAll(mHeldDeferrableSurfaces);

                // Clears the mRegisteredDeferrableSurfaces to prevent from duplicate
                // decrement calls.
                mHeldDeferrableSurfaces = null;
            }
        }
    }

    @Override
    public void finishClose() {
        releaseDeferrableSurfaces();
    }

    /**
     * Nested class to avoid verification errors for methods introduced in Android 6.0 (API 23).
     */
    @RequiresApi(23)
    private static class Api23Impl {

        private Api23Impl() {
        }

        @DoNotInline
        static Surface getInputSurface(CameraCaptureSession cameraCaptureSession) {
            return cameraCaptureSession.getInputSurface();
        }
    }
}


text:
module Soan
  class Server::Router
    attr_reader :routes

    def initialize(&block)
      @routes = Hash.new{[]}
      instance_exec &block
    end

    def route(method, path, constraints={}, &block)
      method = method.to_sym
      @routes[method] += [Route.new(method, path, constraints, block)]
    end

    def recognize(request)
      match = nil
      route = @routes[request.method].detect do |route|
        match = route.matches request
      end
      [route, match]
    end

    def get(*args, &block)    ; route("get", *args, &block)     ; end
    def post(*args, &block)   ; route("post", *args, &block)    ; end
    def put(*args, &block)    ; route("put", *args, &block)     ; end
    def patch(*args, &block)  ; route("patch", *args, &block)   ; end
    def delete(*args, &block) ; route("delete", *args, &block)  ; end

  end

  class Route < Struct.new(:method, :path, :constraints, :block)
    attr_reader :regex

    def initialize(*args)
      super
      compile
    end

    def compile
      if path == "/"
        @regex = Regexp.new("^/$")
        return
      end

      segments = path.split "/"

      regex_string = segments.each_with_object("") do |s, result|
        next if s.blank?

        result << "/"

        result << if s.start_with? ":"
                    name = s[1..-1]
                    "(?<#{name}>[^/]+?)"
                  else
                    s
                  end
        @regex = Regexp.new("^#{result}$")
      end
    end

    def matches(request)
      match = path_matches(request)
      match if constraints_match?(request)
    end

    private
    def path_matches(request)
      @regex.match(request.path)
    end

    def constraints_match?(request)
      true
    end

  end

end


text:
package org.kaaproject.kaa.client.channel;

public enum ServerType {
  BOOTSTRAP,
  OPERATIONS
}


text:
@interface GeoPackageCacheOverlay ()

@property (strong, nonatomic) NSMutableArray<CacheOverlay *> * tables;

@end

@implementation GeoPackageCacheOverlay

-(instancetype) initWithName: (NSString *) name andPath: (NSString *) filePath andTables: (NSArray<GeoPackageTableCacheOverlay *> *) tables{
    self = [super initWithName:name andType:GEOPACKAGE andSupportsChildren:true];
    if(self){
        self.filePath = filePath;
        self.tables = [[NSMutableArray alloc] init];
        for(GeoPackageTableCacheOverlay * table in tables){
            [table setParent:self];
            if([table getType] == GEOPACKAGE_FEATURE_TABLE){
                GeoPackageFeatureTableCacheOverlay * featureTable = (GeoPackageFeatureTableCacheOverlay *) table;
                for(GeoPackageTileTableCacheOverlay * linkedTileTable in [featureTable getLinkedTileTables]){
                    [linkedTileTable setParent:self];
                }
            }
            [self.tables addObject:table];
        }
    }
    return self;
}

-(void) removeFromMap: (MKMapView *) mapView{
    for(CacheOverlay * cacheOverlay in [self getChildren]){
        [cacheOverlay removeFromMap:mapView];
    }
}

-(NSString *) getIconImageName{
    return @"geopackage";
}

-(NSArray<CacheOverlay *> *) getChildren{
    return self.tables;
}

@end


text:
<?php

namespace Aisel\SettingsBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * Form for Disqus in Backend
 *
 * @author Ivan Proskoryakov <volgodark@gmail.com>
 */
class ConfigDisqusType extends AbstractType
{

    /**
     * {@inheritDoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('shortname', 'text', array('label' => 'Shortname', 'attr' => array('class' => 'form-control')))
            ->add('status', 'choice', array('choices' => array(
                '0' => 'Disabled',
                '1' => 'Enabled'),
                'label' => 'Status', 'attr' => array('class' => 'form-control')
            ))
            ->add('save', 'submit', array('label' => 'Save', 'attr' => array('class' => 'btn btn-primary')));
    }

    /**
     * {@inheritDoc}
     */
    public function getName()
    {
        return 'config_meta';
    }

}


text:
Javascript Draggable Selectable
=============

Light-weight javascript and event handler to enable dragging, dropping, and selecting on any element in the document.

Installation
-------

* Copy files into your working directory.
* Link to draggable-selectable.css within your header, and eventUtility.js and draggable-selectable.js before the closing body element.
* Add the class "draggable" and/or "selectable" to any element you wish.
* Optionally modify the "select-*" selectors to your liking.

Contributing
------------

1. Fork it.
2. Create a branch (`git checkout -b my_markup`)
3. Commit your changes (`git commit -am "Clean redundant CSS"`)
4. Push to the branch (`git push origin my_markup`)
5. Open a [Pull Request][1]
6. Eat some bacon while you wait