text:
<?php

namespace Joli\SeoOverride\Bridge\Symfony\DependencyInjection\CompilerPass;

use ReflectionClass;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\LogicException;

abstract class AbstractRegisterServicePass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        $serviceByAlias = $this->assertTagsDefineUniqueAliases(
            $container->findTaggedServiceIds($this->getTag())
        );

        $serviceDefinitionsByType = [];
        $servicesConfiguration = $container->getParameter($this->getConfigurationParameterName());

        foreach ($servicesConfiguration as $serviceConfiguration) {
            // Retrieve and remove the type from the configuration
            $type = $serviceConfiguration['type'];
            unset($serviceConfiguration['type']);

            // Check if the configured type correspond to an existing service
            if (!array_key_exists($type, $serviceByAlias)) {
                throw new LogicException(sprintf(
                    'Unkown "%s" %s. Available %s are: %s',
                    $type,
                    $this->getName(false),
                    $this->getName(true),
                    implode(',', array_keys($serviceByAlias))
                ));
            }

            // Check service will receive mandatory options
            $this->assertServiceHasMandatoryOption(
                $serviceConfiguration,
                $serviceByAlias[$type]['attributes'],
                $type
            );

            $serviceDefinition = $container->getDefinition($serviceByAlias[$type]['id']);
            $arguments = $this->getContructorArguments($serviceDefinition);

            // Configure service constructor's argument
            foreach ($serviceConfiguration as $option => $value) {
                $optionNormalized = $this->camelize($option);

                $index = array_search($optionNormalized, $arguments, true);

                // Ensure the option matches a constructor's argument
                if (false === $index) {
                    throw new LogicException(sprintf(
                        'Unkown "%s" option for %s "%s"',
                        $option,
                        $this->getName(false),
                        $type
                    ));
                }

                $serviceDefinition->replaceArgument($index, $value);
            }

            $serviceDefinitionsByType[$type] = $serviceDefinition;
        }

        $this->processServiceList($container, $serviceDefinitionsByType);

        // Remove now useless parameter
        $container->getParameterBag()->remove($this->getConfigurationParameterName());
    }

    abstract protected function getTag(): string;

    abstract protected function getName(bool $plurial): string;

    abstract protected function getConfigurationParameterName(): string;

    abstract protected function processServiceList(ContainerBuilder $container, array $serviceDefinitionsByType);

    private function assertTagsDefineUniqueAliases(array $availableServiceIds): array
    {
        $servicesByAlias = [];
        $serviceIdsMissingAlias = [];

        // Iterate on all services and retrieve their alias attribute (or not if missing)
        foreach ($availableServiceIds as $serviceId => $tags) {
            foreach ($tags as $attributes) {
                // Missing alias attribute
                if (!array_key_exists('alias', $attributes)) {
                    $serviceIdsMissingAlias[] = $serviceId;
                    continue;
                }

                // Stock alias attribute
                $servicesByAlias[$attributes['alias']][] = [
                    'id' => $serviceId,
                    'attributes' => $attributes,
                ];
            }
        }

        // Error here if at least one service is missing an alias
        if (count($serviceIdsMissingAlias) > 0) {
            throw new LogicException(sprintf(
                'These %s services do not define an "alias" attribute on their "%s" tags: %s',
                $this->getName(false),
                $this->getTag(),
                implode(', ', array_unique($serviceIdsMissingAlias))
            ));
        }

        // Iterate over services list, ensure aliases are unique and flatten the service list
        $serviceByAlias = [];
        foreach ($servicesByAlias as $alias => $services) {
            if (count($services) > 1) {
                throw new LogicException(sprintf(
                    '%s aliases should be unique. The "%s" alias is defined by these %s: %s',
                    ucfirst($this->getName(false)),
                    $alias,
                    $this->getName(true),
                    implode(', ', array_column($services, 'id'))
                ));
            }

            $serviceByAlias[$alias] = $services[0];
        }

        return $serviceByAlias;
    }

    private function assertServiceHasMandatoryOption(array $serviceConfiguration, array $tagAttributes, string $type)
    {
        if (array_key_exists('required_options', $tagAttributes)) {
            $requiredOptions = explode(',', $tagAttributes['required_options']);
            foreach ($requiredOptions as $option) {
                if (!array_key_exists($option, $serviceConfiguration)) {
                    throw new LogicException(sprintf(
                        'The "%s" option is mandatory for %s "%s"',
                        $option,
                        $this->getName(false),
                        $type
                    ));
                }
            }
        }
    }

    private function getContructorArguments(Definition $definition): array
    {
        $argumentsOrderByName = [];
        $class = new ReflectionClass($definition->getClass());
        $constructor = $class->getConstructor();

        if (!$constructor) {
            return [];
        }

        $parameters = $constructor->getParameters();

        foreach ($parameters as $index => $parameter) {
            $argumentsOrderByName[$index] = $parameter->getName();
        }

        return $argumentsOrderByName;
    }

    private function camelize(string $input, string $separator = '_'): string
    {
        return lcfirst(str_replace($separator, '', ucwords($input, $separator)));
    }
}


text:
from oslo_config import cfg

from keystone.conf import utils

config_file = cfg.StrOpt(
    'config_file',
    default='keystone-paste.ini',
    help=utils.fmt("""
Name of (or absolute path to) the Paste Deploy configuration file that composes
middleware and the keystone application itself into actual WSGI entry points.
See http://pythonpaste.org/deploy/ for additional documentation on the file's
format.
"""))

GROUP_NAME = __name__.split('.')[-1]
ALL_OPTS = [
    config_file,
]

def register_opts(conf):
    conf.register_opts(ALL_OPTS, group=GROUP_NAME)

def list_opts():
    return {GROUP_NAME: ALL_OPTS}

redpajama_set_name: RedPajamaGithub


text:
//
//  ZYTextField.h
//  Sisters
//
//  Created by ZhouYong on 16/6/20.
//  Copyright © 2016年 ZhouYong. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ZYTextField : UITextField

/**占位文字的颜色属性,为外界提供一个接口,这样以后利用当前的类(ZYTextField),通过alloc init 的方式创建UITextfield控件的时候,就容易更改占位文字的颜色!**/
@property(nonatomic, strong)UIColor* placeholderLabelTextColor;

@end


text:
import pandas as pd
from datetime import timedelta
import matplotlib.pyplot as plt
import matplotlib
from sklearn.cluster import KMeans

matplotlib.style.use('ggplot') # Look Pretty

#
# INFO: This dataset has call records for 10 users tracked over the course of
# 3 years. Your job is to find out where the users likely live at!

def showandtell(title=None):
    if title is not None:
        plt.savefig(title + ".png", bbox_inches='tight', dpi=300)
    plt.show()
    exit()

def clusterInfo(model):
    print("Cluster Analysis Inertia: ", model.inertia_)
    print('------------------------------------------')
    for i in range(len(model.cluster_centers_)):
        print("\n  Cluster ", i)
        print("    Centroid ", model.cluster_centers_[i])
        print("    #Samples ", (model.labels_ == i).sum())  # NumPy Power

# Find the cluster with the least # attached nodes
def clusterWithFewestSamples(model):
    # Ensure there's at least on cluster...
    minSamples = len(model.labels_)
    minCluster = 0
    for i in range(len(model.cluster_centers_)):
        if minSamples > (model.labels_ == i).sum():
            minCluster = i
            minSamples = (model.labels_ == i).sum()
    print("\n  Cluster With Fewest Samples: ", minCluster)
    return (model.labels_ == minCluster)

def doKMeans(data, clusters=0):
    #
    # TODO: Be sure to only feed in Lat and Lon coordinates to the KMeans algo,
    # since none of the other data is suitable for your purposes. Since both
    # Lat and Lon are (approximately) on the same scale, no feature scaling is
    # required. print out the centroid locations and add them onto your scatter
    # plot. Use a distinguishable marker and color.
    #
    # Hint: Make sure you fit ONLY the coordinates, and in the CORRECT order
    # (lat first). This is part of your domain expertise.
    #
    model = KMeans(clusters)
    model.fit(data[['TowerLat', 'TowerLon']])

    return model

#
# TODO: Load up the dataset and take a peek at its head and dtypes.
# Convert the date using pd.to_datetime, and the time using pd.to_timedelta
#
cdr = pd.read_csv('Datasets/CDR.csv')
cdr.CallDate = pd.to_datetime(cdr.CallDate)
cdr.CallTime = pd.to_timedelta(cdr.CallTime)
cdr.Duration = pd.to_timedelta(cdr.Duration)

#
# TODO: Get a distinct list of "In" phone numbers (users) and store the value
# in a regular python list.
# Hint:
# https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.tolist.html
#
unique_in = cdr.In.unique().tolist()

#
# INFO: The locations map above should be too "busy" to really wrap your head
# around. Thi is where domain expertise comes into play. Your intuition tells
# you that people are likely to behave differently on weekends:
#
# On Weekends:
#   1. People probably don't go into work
#   2. They probably sleep in late on Saturday
#   3. They probably run a bunch of random errands, since they couldn't during
#      the week
#   4. They should be home, at least during the very late hours, e.g. 1-4 AM
#
# On Weekdays:
#   1. People probably are at work during normal working hours
#   2. They probably are at home in the early morning and during the late night
#   3. They probably spend time commuting between work and home everyday

print("\n\nExamining person: ", 0)
#
# TODO: Create a slice called user1 that filters to only include dataset
# records where the "In" feature (user phone number) is equal to the first
# number on your unique list above
#
user1 = cdr[cdr.In == unique_in[0]]

#
# TODO: Alter your slice so that it includes only Weekday (Mon-Fri) values.
#
cdr = cdr[(cdr.DOW != 'Sun') & (cdr.DOW != 'Sat')]

#
# TODO: The idea is that the call was placed before 5pm. From Midnight-730a,
# the user is probably sleeping and won't call / wake up to take a call. There
# should be a brief time in the morning during their commute to work, then
# they'll spend the entire day at work. So the assumption is that most of the
# time is spent either at work, or in 2nd, at home.
#
cdr = cdr[cdr.CallTime < '17:00:00']

#
# TODO: Plot the Cell Towers the user connected to
#
fig = plt.figure()
ax = fig.add_subplot(111)
ax.scatter(user1.TowerLat, user1.TowerLon, alpha=0.5, c='g')

#
# INFO: Run K-Means with K=3 or K=4. There really should only be a two areas of
# concentration. If you notice multiple areas that are "hot" (multiple areas
# the user spends a lot of time at that are FAR apart from one another), then
# increase K=5, with the goal being that all centroids except two will sweep up
# the annoying outliers and not-home, not-work travel occasions. the other two
# will zero in on the user's approximate home location and work locations. Or
# rather the location of the cell tower closest to them.....
model = doKMeans(user1, 4)
print(model.cluster_centers_)
ax.scatter(model.cluster_centers_[:, 0], model.cluster_centers_[:, 1],
           marker='x', s=169, color='r', linewidths=3, alpha=0.5)

#colors = ['green', 'pink', 'blue']
#labels = [colors[i] for i in model.labels_]

#
# INFO: print(out the mean CallTime value for the samples belonging to the
# cluster with the LEAST samples attached to it. If our logic is correct, the
# cluster with the MOST samples will be work. The cluster with the 2nd most
# samples will be home. And the K=3 cluster with the least samples should be
# somewhere in between the two. What time, on average, is the user in between
# home and work, between the midnight and 5pm?
midWayClusterIndices = clusterWithFewestSamples(model)
midWaySamples = user1[midWayClusterIndices]
print("    Its Waypoint Time: ", midWaySamples.CallTime.mean())

#
# Let's visualize the results!
# First draw the X's for the clusters:
#ax.scatter(model.cluster_centers_[:, 1], model.cluster_centers_[:, 0], s=169,
#           c='r', marker='x', alpha=0.5, linewidths=2)
#
# Then save the results:
# Comment the line below out when you're ready to proceed
# showandtell('Weekday Calls Centroids')


text:
package com.intellij.history.integration;

import com.intellij.openapi.diff.impl.patch.FilePatch;
import com.intellij.openapi.diff.impl.patch.PatchReader;
import com.intellij.openapi.diff.impl.patch.PatchVirtualFileReader;
import com.intellij.openapi.diff.impl.patch.formove.PatchApplier;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.testFramework.VfsTestUtil;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public abstract class PatchingTestCase extends IntegrationTestCase {
  protected String patchFilePath;

  @Override
  protected void setUpInWriteAction() throws Exception {
    super.setUpInWriteAction();

    File dir = createTempDirectory();
    patchFilePath = new File(dir, "patch").getPath();
  }

  protected void clearRoot() {
    for (VirtualFile f : myRoot.getChildren()) {
      VfsTestUtil.deleteFile(f);
    }
  }

  protected void applyPatch() throws Exception {
    PatchReader reader = PatchVirtualFileReader.create(LocalFileSystem.getInstance().refreshAndFindFileByPath(patchFilePath));

    List<FilePatch> patches = new ArrayList<>(reader.readTextPatches());

    new PatchApplier(myProject, myRoot, patches, null, null).execute();
  }

  protected static void createChildDataWithContent(@NotNull VirtualFile dir, @NotNull String name) {
    createChildData(dir, name);
    VirtualFile file = dir.findChild(name);
    setFileText(file, "some content");
  }
}


text:
@echo off
setlocal

if "%1" == "--help" (
echo Usage: rbenv ^<command^> [^<args^>]
echo.
echo Some useful rbenv commands are:
echo    commands    List all available rbenv commands
echo    local       Set or show the local application-specific Ruby version
echo    global      Set or show the global Ruby version
echo    shell       Set or show the shell-specific Ruby version
echo    install     Install a Ruby version using ruby-build
echo    uninstall   Uninstall a specific Ruby version
echo    rehash      Rehash rbenv shims (run this after installing executables)
echo    version     Show the current Ruby version and its origin
echo    versions    List all Ruby versions available to rbenv
echo    which       Display the full path to an executable
echo    whence      List all Ruby versions that contain the given executable
echo.
echo See `rbenv help ^<command^>' for information on a specific command.
echo For full documentation, see: https://github.com/rbenv/rbenv#readme
echo.
EXIT /B
)

rem Implementation of this command is in the rbenv.vbs file .


text:
package com.saptarshibasu.poc.oracleaqclient.initializer;

import java.util.List;
import java.util.concurrent.BlockingQueue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ServerInitializer implements Initializer{

	private static final Logger LOG = LoggerFactory.getLogger(ServerInitializer.class);

	private List<Initializer> initializers;

	private BlockingQueue<String> blockingQueue;

	public ServerInitializer(List<Initializer> initializers, BlockingQueue<String> blockingQueue)
	{
		this.initializers = initializers;
		this.blockingQueue = blockingQueue;
	}

	public void init()
	{
		for(Initializer initializer : initializers)
		{
			initializer.init();
		}
		LOG.info("Server started.");
		blockingQueue.poll();
	}
}


text:
This documentation supplements the installing instructions in the [README](/nbdserver/readme.md) of the [`nbdserver`](/nbdserver) source directory.

The below documentation uses a Docker container with JumpScale 8.2 installed, as documented in the [Jumpscale/developer](https://github.com/Jumpscale/developer) GitHub repository.

Using this Docker container you can after having build the NDB Server, as documented here below, easily test it by following the instructions in the [Using your NBD Server](using.md) section.

First set following environment variables:
```
GIGHOME="/Users/$USER/gig"
ZEROTIER_NETWORK_ID="..."
```

Create a new Docker image and start a container, using the `js_builder_js82_zerotier.sh` script from the [Jumpscale/developer](https://github.com/Jumpscale/developer) GitHub repository:
```
curl -sL https://raw.githubusercontent.com/Jumpscale/developer/master/scripts/js_builder_js82_zerotier.sh | bash -s <your-ZeroTier-network-ID>
```

Or in case you already have the image, start a new container using the existing image:
```
docker rm --force js8
docker run --name js82 -h js82 -d --device=/dev/net/tun --cap-add=NET_ADMIN --cap-add=SYS_ADMIN -v ${GIGHOME}/zerotier-one/:/var/lib/zerotier-one/ -v ${GIGHOME}/code/:/opt/code/ -v ${GIGHOME}/data/:/optvar/data jumpscale/js82 /root/init.sh ${ZEROTIER_NETWORK_ID}
```

As a result you'll have a Docker container with JumpScale 8.2 installed and connected to your ZeroTier network.

Then start the SSH daemon in the container, so you can SSH into the container:
```
docker exec -t js82 bash -c "/usr/sbin/sshd"
```

Get the ZeroTier IP address your container got assigned, and save it in a environment variable:
```
ZEROTIER_IP_ADDRESS=`docker exec -t js82 bash -c "ip -4 addr show zt0 | grep -oP 'inet\s\d+(\.\d+){3}' | sed 's/inet //' | tr -d '\n\r'"`
```

For the next steps we'll SSH into your container over the ZeroTier network:
```
ssh root@$ZEROTIER_IP_ADDRESS
```

First we need to install Go into the Docker container. JumpScale makes that very easy:
```
jspython -c "from JumpScale import j; j.tools.cuisine.local.development.golang.install()"
```

Next:
```
mkdir -p /usr/local/go
export GOROOT=/opt/go/root/
export PATH=$PATH:$GOROOT/bin
export GOPATH=/opt/go/proj
```

Clone the code to your GOPATH:
```
go get -d github.com/zero-os/0-Disk/nbdserver
```

Build (totally static) the binary:
```
cd $GOPATH/src/github.com/zero-os/0-Disk
make nbdserver
```

Optionally you can now create a flist for your NBD server so you can easily start a container on a Zero-OS with your NBD server. Below the steps.

First put 'nbdserver' binary somewhere alone:
```
mkdir /tmp/nbdserver
cp /bin/nbdserver /tmp/nbdserver
```

Then, using JumpScale:

```
REMOTE_ARDB_SERVER="IP address of an ARDB server"
kvs = j.servers.kvs.getRocksDBStore(name='flist', namespace=None, dbpath="/tmp/flist-nbdserver.db")
f = j.tools.flist.getFlist(rootpath='/tmp/nbdserver', kvs=kvs)
f.add('/tmp/nbdserver/')
f.upload("REMOTE_ARDB_SERVER", 16379)
```

And finally, pack your RocksDB database, and you're done:
```
cd /tmp/flist-nbdserver.db/
tar -cf ../flist-nbdserver.db.tar *
cd ..
gzip flist-nbdserver.db.tar
```


text:
package com.alain898.dscache.cache;

/**
 * Created by alain on 16/8/25.
 */
public class CacheZnode {
    private String version;
    private String name;

    private String entryClassName;
    private int partitionsPerSubCache;
    private int blockCapacity;
    private int blocksPerPartition;

    private String cacheGroup;
    private String forwardCache;
    private long forwardThreshold;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getName() {
        return name;
    }

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

    public String getEntryClassName() {
        return entryClassName;
    }

    public void setEntryClassName(String entryClassName) {
        this.entryClassName = entryClassName;
    }

    public int getPartitionsPerSubCache() {
        return partitionsPerSubCache;
    }

    public void setPartitionsPerSubCache(int partitionsPerSubCache) {
        this.partitionsPerSubCache = partitionsPerSubCache;
    }

    public int getBlockCapacity() {
        return blockCapacity;
    }

    public void setBlockCapacity(int blockCapacity) {
        this.blockCapacity = blockCapacity;
    }

    public int getBlocksPerPartition() {
        return blocksPerPartition;
    }

    public void setBlocksPerPartition(int blocksPerPartition) {
        this.blocksPerPartition = blocksPerPartition;
    }

    public String getCacheGroup() {
        return cacheGroup;
    }

    public void setCacheGroup(String cacheGroup) {
        this.cacheGroup = cacheGroup;
    }

    public String getForwardCache() {
        return forwardCache;
    }

    public void setForwardCache(String forwardCache) {
        this.forwardCache = forwardCache;
    }

    public long getForwardThreshold() {
        return forwardThreshold;
    }

    public void setForwardThreshold(long forwardThreshold) {
        this.forwardThreshold = forwardThreshold;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using Livet;

namespace Grabacr07.KanColleWrapper.Globalization
{
	public class ResourceService : NotificationObject
	{
		#region static members

		private static readonly ResourceService current = new ResourceService();

		public static ResourceService Current
		{
			get { return current; }
		}

		#endregion

		/// <summary>
		/// サポートされているカルチャの名前。
		/// </summary>
		private readonly string[] supportedCultureNames =
		{
			"ja", // Resources.resx
			"en",
			"zh-CN",
			"zh-TW",
		};

		/// <summary>
		/// 多言語化されたリソースを取得します。
		/// </summary>
		internal Resources Resources { get; private set; }

		/// <summary>
		/// サポートされているカルチャを取得します。
		/// </summary>
		public IReadOnlyCollection<CultureInfo> SupportedCultures { get; private set; }

		/// <summary>
		/// サポートされているカルチャを取得します。
		/// </summary>
		private ResourceService()
		{
			this.Resources = new Resources();
			this.SupportedCultures = this.supportedCultureNames
				.Select(x =>
				{
					try
					{
						return CultureInfo.GetCultureInfo(x);
					}
					catch (CultureNotFoundException)
					{
						return null;
					}
				})
				.Where(x => x != null)
				.ToList();
		}

		/// <summary>
		/// 指定されたカルチャ名を使用して、リソースのカルチャを変更します。
		/// </summary>
		/// <param name="name">カルチャの名前。</param>
		public void ChangeCulture(string name)
		{
			Resources.Culture = this.SupportedCultures.SingleOrDefault(x => x.Name == name);

			this.RaisePropertyChanged("Resources");
		}
	}
}


text:
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Mailbox.Config;
using Mailbox.Options;

namespace Mailbox
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddServiceFabricConfig("Config") // Add Service Fabric configuration settings
                .AddEnvironmentVariables();

            // Note: See https://blogs.msdn.microsoft.com/azurecat/2017/04/06/using-a-custom-service-fabric-configuration-provider-with-asp-net-core/
            //       for ASP.NET Core configuration with Service Fabric.
            Configuration = builder.Build();
        }

        public IConfigurationRoot Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.Configure<MyOptions>(Configuration);
            services.AddMvc();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            app.UseMvc();
        }
    }
}


text: Test overhanging floats


text:
<!DOCTYPE html>
<html>

<head>
    <title></title>
    <link rel="stylesheet" href="style/main.css">
    <link rel="stylesheet" href="style/bootstrap/bootstrap.min.css">
</head>

<body ng-app="demo1">
    <div ui-view></div>
    <script type="text/javascript" src="script/react/build/react.js"></script>
    <script type="text/javascript" src="script/angular/angular.js"></script>
    <script type="text/javascript" src="script/angular-ui-router/angular-ui-router.js"></script>
    <!-- modules -->
    <script type="text/javascript" src="script/mainModule.js"></script>
    <script type="text/javascript" src="script/provider/providerModule.js"></script>
    <script type="text/javascript" src="script/controllers/controllerModule.js"></script>
    <!-- Providers -->
    <script type="text/javascript" src="script/provider/randomaizerFactory.js"></script>
    <!-- Controllers -->
    <script type="text/javascript" src="script/controllers/mainCtrl.js"></script>
    <script type="text/javascript" src="script/controllers/reactCtrl.js"></script>
    <script type="text/javascript" src="script/controllers/repeatCtrl.js"></script>
</body>

</html>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using Microsoft.Common.Core;

namespace Microsoft.R.Host.Client {
    public class ComponentBinaryMissingException : Exception {
        public ComponentBinaryMissingException(string name)
            : base(Resources.Error_BinaryMissing15.FormatInvariant(name)) { }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/tableLinkTitleTextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_gravity="center"
        android:textSize="22sp" />

    <ListView
        android:id="@+id/tableLinkListView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>


text:
package org.usagram.clarify.validator

import org.usagram.clarify.error.ShouldEqualTo

import org.scalatest._
import org.scalatest.OptionValues._

class EqualToSpec extends FunSpec {
  import Matchers._

  describe(".apply") {
    it("returns an EqualTo with given that") {
      val validator = EqualTo("A value")
      val error = validator.validate("a value")
      error.value.asInstanceOf[ShouldEqualTo[String]].value should be("A value")
    }
  }

  describe("#validate") {
    val validator = EqualTo("a value")

    describe("when equal to that") {
      it("returns no errors") {
        val error = validator.validate("a value")
        error should be(empty)
      }
    }

    describe("when don't equal to that") {
      it("returns ShouldEqualTo") {
        val error = validator.validate("other value")
        error should be(defined)
        error.value.asInstanceOf[ShouldEqualTo[String]].value should be("a value")
      }
    }
  }
}


text:
/* -*- Mode: objc; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
 * @copyright See LICENCE for copyright and license information.
 *
 * @author Alexander Afanasyev <alexander.afanasyev@ucla.edu>
 * @author Ilya Moiseenko <iliamo@ucla.edu>
 */

#import <Cocoa/Cocoa.h>

@interface FibTableController : NSObject <NSTableViewDataSource, NSXMLParserDelegate>
{
  NSXMLDocument *m_document;
}

@property NSTableView *m_tableView;

- (void)loadStatus:(NSXMLDocument *)document;
- (NSString *)getFaceByRowIndex:(NSInteger)index;
- (NSString *)getPrefixByRowIndex:(NSInteger)index;

@end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace NCast.Devices.Chromecast.Entities.Response
{
    [DataContract]
    public class SupportedTimezone
    {
        [DataMember(IsRequired = true, Name = "timezone")]
        public string Timezone { get; set; }

        [DataMember(IsRequired = true, Name = "display_string")]
        public string DisplayString { get; set; }

        [DataMember(IsRequired = true, Name = "offset")]
        public int Offset { get; set; }
    }
}


text: Copy for learning


text:
// Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System;
using Splat;

#if COCOA
using Foundation;
#endif

#if ANDROID
using Android.App;
#endif

namespace Akavache.Core
{
    /// <summary>
    /// Performs registration inside the Splat DI container.
    /// </summary>
    [Preserve(AllMembers = true)]
    public class Registrations : IWantsToRegisterStuff
    {
        /// <inheritdoc />
        public void Register(IMutableDependencyResolver resolver, IReadonlyDependencyResolver readonlyDependencyResolver)
        {
            if (resolver is null)
            {
                throw new ArgumentNullException(nameof(resolver));
            }

#if XAMARIN_MOBILE
            var fs = new IsolatedStorageProvider();
#elif WINDOWS_UWP
            var fs = new WinRTFilesystemProvider();
#else
            var fs = new SimpleFilesystemProvider();
#endif
            resolver.Register(() => fs, typeof(IFilesystemProvider), null);

#if WINDOWS_UWP
            var enc = new WinRTEncryptionProvider();
#else
            var enc = new EncryptionProvider();
#endif
            resolver.Register(() => enc, typeof(IEncryptionProvider), null);

            var localCache = new Lazy<IBlobCache>(() => new InMemoryBlobCache());
            var userAccount = new Lazy<IBlobCache>(() => new InMemoryBlobCache());
            var secure = new Lazy<ISecureBlobCache>(() => new InMemoryBlobCache());

            resolver.Register(() => localCache.Value, typeof(IBlobCache), "LocalMachine");
            resolver.Register(() => userAccount.Value, typeof(IBlobCache), "UserAccount");
            resolver.Register(() => secure.Value, typeof(ISecureBlobCache), null);

            resolver.Register(() => new AkavacheHttpMixin(), typeof(IAkavacheHttpMixin), null);

#if COCOA
            BlobCache.ApplicationName = NSBundle.MainBundle.BundleIdentifier;
            resolver.Register(() => new MacFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif

#if ANDROID

            var packageManager = Application.Context.PackageManager;
            var packageName = Application.Context.PackageName ?? "Unknown Package";
            var applicationLabel = packageManager?.GetApplicationInfo(packageName, 0)?.LoadLabel(packageManager);

            BlobCache.ApplicationName = applicationLabel ?? "Unknown";

            resolver.Register(() => new AndroidFilesystemProvider(), typeof(IFilesystemProvider), null);
#endif
        }
    }
}


text:
Labyrinth::Labyrinth(const int& width, const int& height, const std::vector<std::string>& map)
    :_data(width, height), _visited(width, height)
{

    for (int i = 0; i < width; ++i) {
        for (int j = 0; j < height; ++j) {
            _visited.set(i, j, false); //None visited yet
            _data.set(i, j, map[i][j]);
            if (_data.get(i, j) == 'E') {
                _start = Point2U(i, j);
            }
        }
    }
}

bool Labyrinth::isValid(const Point2U& point) const {
    return _data.valid(point);
}

bool Labyrinth::isCheese(const Point2U& point) const {
    return _data.get(point) == 'Q';
}

bool Labyrinth::isEntrance(const Point2U& point) const {
    return _data.get(point) == 'E';
}

bool Labyrinth::isExit(const Point2U& point) const {
    return _data.get(point) == 'S';
}

bool Labyrinth::isWall(const Point2U& point) const {
    return _data.get(point) == '1';
}

bool Labyrinth::isPath(const Point2U& point) const {
    return _data.get(point) == '0';
}

Point2U Labyrinth::getStart() const {
    return _start;
}

bool Labyrinth::checkRight(const Point2U &point) const {
    auto right = point + Point2U(1, 0);

    if (isWall(right)) return false;

    return true;
}
bool Labyrinth::checkLeft(const Point2U &point) const {
    auto left = point + Point2U(-1, 0);

    if (isWall(left)) return false;

    return true;
}

bool Labyrinth::checkUp(const Point2U &point) const {
    auto up = point + Point2U(0, 1);

    if (isWall(up)) return false;

    return true;
}

bool Labyrinth::checkDown(const Point2U &point) const {
    auto down = point + Point2U(0, -1);

    if (isWall(down)) return false;

    return true;
}

void Labyrinth::setVisited(const Point2U& point) {
    _visited.set(point, true);
}

bool Labyrinth::visited(const Point2U& point) const {
    return _visited.get(point);
}

bool Labyrinth::getNeighbor(const Point2U& point, Point2U& neighbor) const {
    auto down = point + Point2U(0, -1);
    auto up = point + Point2U(0, 1);
    auto left = point + Point2U(-1, 0);
    auto right = point + Point2U(1, 0);
    auto dright = down + Point2U(1, 0);
    auto dleft = down + Point2U(-1, 0);
    auto uright = up + Point2U(1, 0);
    auto uleft = up + Point2U(-1, 0);

    std::vector<Point2U> moves = {down, up, left, right, dright, dleft, uright, uleft};

    for (auto& move : moves) {
        if (isValid(move))
            if (!visited(move) && !isWall(move))  {
                neighbor = move;
                return true;
        }
    }
    return false;
}


text:
layout: model
title: Sentence Embeddings - sbert medium (tuned)
author: John Snow Labs
name: sbiobert_jsl_rxnorm_cased
date: 2021-12-23
tags: [licensed, embeddings, clinical, en]
task: Entity Resolution
language: en
edition: Healthcare NLP 3.3.4
spark_version: 2.4
supported: true
annotator: BertSentenceEmbeddings
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---

## Description

This model maps sentences & documents to a 768 dimensional dense vector space by using average pooling on top of BioBert model. It's also fine-tuned on RxNorm dataset to help generalization over medication-related datasets.

## Predicted Entities

{:.btn-box}
<button class="button button-orange" disabled>Live Demo</button>
<button class="button button-orange" disabled>Open in Colab</button>
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/clinical/models/sbiobert_jsl_rxnorm_cased_en_3.3.4_2.4_1640271525048.zip){:.button.button-orange.button-orange-trans.arr.button-icon}

## How to use

<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python
sentence_embeddings = BertSentenceEmbeddings.pretrained("sbiobert_jsl_rxnorm_cased", "en", "clinical/models")\
.setInputCols(["sentence"])\
.setOutputCol("sbioert_embeddings")
```
```scala
val sentence_embeddings = BertSentenceEmbeddings.pretrained('sbiobert_jsl_rxnorm_cased', 'en','clinical/models')\
.setInputCols("sentence")\
.setOutputCol("sbioert_embeddings")
```

{:.nlu-block}
```python
import nlu
nlu.load("en.embed_sentence.biobert.rxnorm").predict("""Put your text here.""")
```

</div>

## Results

```bash
Gives a 768-dimensional vector representation of the sentence.
```

{:.model-param}
## Model Information

{:.table-model}
|---|---|
|Model Name:|sbiobert_jsl_rxnorm_cased|
|Compatibility:|Healthcare NLP 3.3.4+|
|License:|Licensed|
|Edition:|Official|
|Language:|en|
|Size:|402.0 MB|


text:
package de.vandermeer.skb.interfaces.coin;

import java.util.LinkedHashSet;
import java.util.Set;

import org.apache.commons.lang3.text.StrBuilder;

import de.vandermeer.skb.interfaces.messagesets.IsInfoSet;
import de.vandermeer.skb.interfaces.render.DoesRender;

/**
 * A heads (success) coin with a value and further information.
 *
 * @author     Sven van der Meer <vdmeer.sven@mykolab.com>
 * @version    v0.0.2 build 170502 (02-May-17) for Java 1.8
 * @since      v0.0.1
 */
public interface HeadsSuccessWithInfo<R, M> extends HeadsSuccess<R>, IsInfoSet<M> {

	@Override
	default boolean reportsInfo(){
		return true;
	}

	@Override
	default boolean hasInfoReports(){
		return this.hasInformation();
	}

	/**
	 * Renders the info set.
	 * The method uses {@link DoesRender} or simple toString to render infos.
	 * Each element in the information set is rendered in a single line, preceded by the type (info).
	 * @return rendered object
	 */
	@Override
	default String render() {
		StrBuilder ret = new StrBuilder(100);
		for(M m : this.getInfoMessages()){
			ret.append("info: ");
			if(m instanceof DoesRender){
				ret.append(((DoesRender)m).render());
			}
			else{
				ret.append(m);
			}
			ret.appendNewLine();
		}
		return ret.toString();
	}

	/**
	 * Creates a new success coin with given value and information.
	 * @param <R> type of the return value
	 * @param <M> the message type for the set
	 * @param value the actual return value
	 * @return new success coin
	 */
	static <R, M> HeadsSuccessWithInfo<R, M> create(final R value){
		return new HeadsSuccessWithInfo<R, M>() {
			final Set<M> infoSet = new LinkedHashSet<>();

			@Override
			public R getReturn() {
				return value;
			}

			@Override
			public Set<M> getInfoMessages() {
				return this.infoSet;
			}
		};
	}
}


text:
'use strict';

// [START functions_label_gce_instance]
const functions = require('@google-cloud/functions-framework');

const compute = require('@google-cloud/compute');
const instancesClient = new compute.InstancesClient();

// Register a CloudEvent callback with the Functions Framework that labels
// newly-created GCE instances with the entity (person or service account)
// that created them.
functions.cloudEvent('autoLabelInstance', async cloudEvent => {
  // Extract parameters from the CloudEvent + Cloud Audit Log data
  const payload = cloudEvent.data && cloudEvent.data.protoPayload;
  const authInfo = payload && payload.authenticationInfo;
  let creator = authInfo && authInfo.principalEmail;

  // Get relevant VM instance details from the CloudEvent's `subject` property
  // Example value:
  //   compute.googleapis.com/projects/<PROJECT>/zones/<ZONE>/instances/<INSTANCE>
  const params = cloudEvent.subject && cloudEvent.subject.split('/');

  // Validate data
  if (!creator || !params || params.length !== 7) {
    throw new Error('Invalid event structure');
  }

  // Format the 'creator' parameter to match GCE label validation requirements
  creator = creator.toLowerCase().replace(/\W/g, '_');

  // Get the newly-created VM instance's label fingerprint
  // This is required by the Compute Engine API to prevent duplicate labels
  const getInstanceRequest = {
    project: params[2],
    zone: params[4],
    instance: params[6],
  };
  const [instance] = await instancesClient.get(getInstanceRequest);

  // Label the instance with its creator
  const setLabelsRequest = Object.assign(
    {
      instancesSetLabelsRequestResource: {
        labels: {creator},
        labelFingerprint: instance.labelFingerprint,
      },
    },
    getInstanceRequest
  );

  return instancesClient.setLabels(setLabelsRequest);
});
// [END functions_label_gce_instance]


text:
require 'rails_helper'

RSpec.describe "projects/new", type: :view do
  before(:each) do
    assign(:project, Project.new(
      :name => "MyString",
      :description => "MyText",
      :institution => "MyString",
      :url => "MyString",
      :status => 1,
      :voluntary => nil
    ))
  end

  it "renders new project form" do
    render

    assert_select "form[action=?][method=?]", projects_path, "post" do

      assert_select "input#project_name[name=?]", "project[name]"

      assert_select "textarea#project_description[name=?]", "project[description]"

      assert_select "input#project_institution[name=?]", "project[institution]"

      assert_select "input#project_url[name=?]", "project[url]"

      assert_select "input#project_status[name=?]", "project[status]"

      assert_select "input#project_voluntary_id[name=?]", "project[voluntary_id]"
    end
  end
end


text:
package org.apache.beam.runners.direct;

import org.joda.time.Instant;

/**
 * Access to the current time.
 */
interface Clock {
  /**
   * Returns the current time as an {@link Instant}.
   */
  Instant now();
}


text:
/**
 * Created by raj on 13/8/14.
 */
var fs = require('fs');

var content = fs.read ('animeList.json');/*
 console.log('content: '+content);*/
var animeList = JSON.parse(content);
console.log(animeList);
var animeEpisode=[];
/*for(var k=0;k<animeList.length;k=k+1) {*/
var k=5;
animeEpisode[k]=[];
var nextPresent=false;
/*for(var m=1;;m=m+1) {*/
function listcall(k){

}

function pages(m,k){
    var page=new WebPage();
    nextPresent=false;
    animeEpisode[k]=[];
    page.open(animeList[k].link + '/page/' + m, function (status) {

    console.log('opened animeList? ' + animeList[k].link+ '/page/' + m + " : ", status);
    page.includeJs('http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js', function () {
        console.log('jq included');

        console.log(m);
        var m1=m;

        var data = page.evaluate(function (data,m,nextPresent) {

            if(m==1){
                var tempdata = {};
                tempdata.title=$('.pagetitle').html();
                tempdata.description=$('.catdescription').html();
                data.push(tempdata);
            }

            for (var i = 0; i < $('#content .postlist').length; i = i + 1) {
                var tempdata = {};
                tempdata.link = $('#content .postlist:eq(' + i + ') table tbody tr td a').attr('href');
                tempdata.name = $('#content .postlist:eq(' + i + ') table tbody tr td a').html();
                /*JSON.stringify(tempdata);*/
                data.push(tempdata);
            }
            for(var n=0;n<$('.wp-pagenavi a').length;n=n+1){
                if($('.wp-pagenavi a:eq('+n+')').html() == 'Next'){nextPresent=true}
            }
            return JSON.stringify(data)+"|"+nextPresent;
        }, animeEpisode[k],m1,nextPresent);
        /*var path = 'animeList.txt';
         fs.write(path, data, 'w');
         console.log(data);
         phantom.exit();*//*
         animeEpisode[k].push(data);*/
//        console.log(data)
        var data1= data.split('|');
        nextPresent=data1[1];
        animeEpisode[k]=JSON.parse(data1[0]);
//        console.log(data1[1])

//
//        console.log('hi:'+JSON.stringify(animeEpisode[k]));
//        console.log(m,nextPresent,nextPresent=='true');
//        console.log(m+1);
        if(nextPresent=='true'){console.log('next called');pages(m+1,k)};
/*
        var path = 'animeEpisode'+k+'.json';
        fs.write(path, JSON.stringify(animeEpisode[k]), 'w');*/
        if(nextPresent=='false'&& k<8-1){console.log('next episoide called');pages(1,k+1)}
        if(k==8-1){
            var path = 'animeEpisode.json';
            fs.write(path, JSON.stringify(animeEpisode), 'w');
        }

    });/*
    return JSON.stringify(animeEpisode[k])*/
});
}

pages(1,1);

/*
 if(nextPresent==false){break};*/
/* }*/

/*var path = 'animeEpisode'+k+'.txt';
fs.write(path, data2, 'w');
console.log(data2);*/
/*}*//*
 phantom.exit();*/


text:
package sample.atry.pskingworld.recyclerviewwithdnd;

import android.content.Context;
import android.graphics.Paint;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;

/**
 * Created by naver on 2017. 2. 12..
 */

public class SimpleItemTouchHelperCallback extends ItemTouchHelper.Callback {
    private final ItemTouchHelperAdapter mAdapter;
    private Context mContext;
    Paint mPaint = new Paint();
    public SimpleItemTouchHelperCallback(ItemTouchHelperAdapter adapter, Context context) {
        mAdapter = adapter;
        mContext = context;
    }

    @Override
    public boolean isLongPressDragEnabled() {
        return false;
    }

    @Override
    public boolean isItemViewSwipeEnabled() {
        return true;
    }

    @Override
    public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
        if (viewHolder.getItemViewType() != target.getItemViewType()) {
            return false;
        }

        mAdapter.onItemMove(viewHolder.getAdapterPosition(), target.getAdapterPosition());
        return false;

    }

    @Override
    public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
        final int dragFlag = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
        final int swipeFlag = ItemTouchHelper.END;

        return makeMovementFlags(dragFlag, swipeFlag);
    }

    @Override
    public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {

    }
}


text:
@interface HasProperty

@property (strong) HasProperty *item;

- (HasProperty *)implicitProp;

- (void)setImplicitSetter:(HasProperty *)value;

@end

@implementation HasProperty

- (void)test {
// property-name-begin: +2:8
// property-begin: +1:3
  self.item;
// property-end: -1:12
// property-name-end: -2:12
// CHECK: "static HasProperty *extracted(HasProperty *object) {\nreturn object.item;\n}\n\n"

// implicit-name-begin: +2:8
// implicit-begin: +1:3
  self.implicitProp;
// implicit-end: -1:20
// implicit-name-end: -2:20
// CHECK: "static HasProperty *extracted(HasProperty *object) {\nreturn object.implicitProp;\n}\n\n"
}

// RUN: clang-refactor-test perform -action extract -selected=property -selected=implicit %s -fobjc-arc | FileCheck %s
// RUN: clang-refactor-test perform -action extract -selected=property-name -selected=implicit-name %s -fobjc-arc | FileCheck %s

- (void)prohibitSetterExtraction {
// setter-pref-begin: +2:8
// setter-begin: +1:3
  self.item = 0;
// setter-end: -1:12
// setter-pref-end: -2:12
// implicit-setter-pref-begin: +2:8
// implicit-setter-begin: +1:3
  self.implicitSetter = 0;
// implicit-setter-end: -1:22
// implicit-setter-pref-end: -2:22
}
// CHECK-SETTER: Failed to initiate the refactoring action (property setter can't be extracted)!
// RUN: not clang-refactor-test initiate -action extract -selected=setter -selected=setter-pref -selected=implicit-setter -selected=implicit-setter-pref %s -fobjc-arc 2>&1 | FileCheck --check-prefix=CHECK-SETTER %s

@end

@interface HasIntProp
@property (readwrite) int item;
@end

// AVOID-CRASH: "static void extracted(HasIntProp *f) {\nf.item = !f.item;\n}\n\n"
// avoid-extraction-crash-begin: +1:42
void avoidExtractionCrash(HasIntProp *f) {
  f.item = !f.item;
// avoid-extraction-crash-end: -1:5
}

// RUN: clang-refactor-test perform -action extract -selected=avoid-extraction-crash %s -fobjc-arc | FileCheck --check-prefix=AVOID-CRASH %s


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-confluent-registry-avro-parent</artifactId>
        <version>999-SNAPSHOT</version>
    </parent>

    <artifactId>quarkus-confluent-registry-avro-deployment</artifactId>
    <name>Quarkus - Confluent Schema Registry - Avro - Deployment</name>

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-confluent-registry-avro</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-avro-deployment</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-confluent-registry-common-deployment</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-schema-registry-devservice-deployment</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-extension-processor</artifactId>
                            <version>${project.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
package org.gradle.nativeplatform.toolchain.internal.clang;

import org.gradle.api.internal.file.FileResolver;
import org.gradle.internal.operations.BuildOperationProcessor;
import org.gradle.internal.os.OperatingSystem;
import org.gradle.internal.reflect.Instantiator;
import org.gradle.nativeplatform.toolchain.Clang;
import org.gradle.nativeplatform.toolchain.internal.gcc.AbstractGccCompatibleToolChain;
import org.gradle.nativeplatform.toolchain.internal.gcc.DefaultGccPlatformToolChain;
import org.gradle.nativeplatform.toolchain.internal.gcc.version.CompilerMetaDataProviderFactory;
import org.gradle.process.internal.ExecActionFactory;

public class ClangToolChain extends AbstractGccCompatibleToolChain implements Clang {
    public static final String DEFAULT_NAME = "clang";

    public ClangToolChain(String name, BuildOperationProcessor buildOperationProcessor, OperatingSystem operatingSystem, FileResolver fileResolver, ExecActionFactory execActionFactory, CompilerMetaDataProviderFactory metaDataProviderFactory, Instantiator instantiator) {
        super(name, buildOperationProcessor, operatingSystem, fileResolver, execActionFactory, metaDataProviderFactory.clang(), instantiator);
    }

    @Override
    protected void configureDefaultTools(DefaultGccPlatformToolChain toolChain) {
        toolChain.getLinker().setExecutable("clang++");
        toolChain.getcCompiler().setExecutable("clang");
        toolChain.getCppCompiler().setExecutable("clang++");
        toolChain.getObjcCompiler().setExecutable("clang");
        toolChain.getObjcppCompiler().setExecutable("clang++");
        toolChain.getAssembler().setExecutable("clang");
    }

    @Override
    protected String getTypeName() {
        return "Clang";
    }

}


text:
//
//  IXTableViewControl.m
//  IXgee_iOS_Engine
//
//  Created by Robert Walsh on 11/18/13.
//

//

#import "IXTable.h"

#import "IXLayout.h"
#import "IXUITableViewCell.h"
#import "UIImage+ResizeMagick.h"
#import "IXCellBackgroundSwipeController.h"

#import "UIScrollView+APParallaxHeader.h"

// IXTableView Attributes (Note: See IXCellBasedControl for the super classes properties as well.)
IX_STATIC_CONST_STRING kIXRowSelectEnabled = @"rowSelect.enabled";
IX_STATIC_CONST_STRING kIXKeepRowHighlightedOnSelect = @"rowStaysHighlighted.enabled";
IX_STATIC_CONST_STRING kIXBackgroundSwipeWidth = @"swipe.w";

IX_STATIC_CONST_STRING kIXImageParallax = @"parallaxImage";
IX_STATIC_CONST_STRING kIXImageParallaxHeight = @"parallaxImage.h";
IX_STATIC_CONST_STRING kIXImageParallaxWidth = @"parallaxImage.w";

// IXImage Manipulation -- use a resizedImageByMagick mask for these
IX_STATIC_CONST_STRING kIXParallaxImageResizeMask = @"parallaxImage.resizeMask";

IX_STATIC_CONST_STRING kIXLayoutFlow = @"layoutFlow";
IX_STATIC_CONST_STRING kIXLayoutFlowVertical = @"vertical";
IX_STATIC_CONST_STRING kIXLayoutFlowHorizontal = @"horizontal";

IX_STATIC_CONST_STRING kIXSeperatorColor = @"separator.color";
IX_STATIC_CONST_STRING kIXSeperatorStyle = @"separator.style";
IX_STATIC_CONST_STRING kIXSeperatorStyleNone = @"none";
IX_STATIC_CONST_STRING kIXSeperatorStyleDefault = @"default";

// IXTableView Events
IX_STATIC_CONST_STRING kIXStartedScrolling = @"didBeginScrolling";
IX_STATIC_CONST_STRING kIXEndedScrolling = @"didEndScrolling";

// These Events fired on the actual cells. (aka dataRow will work)
IX_STATIC_CONST_STRING kIXWillDisplayCell = @"willDisplayCell";
IX_STATIC_CONST_STRING kIXDidHideCell = @"didHideCell";
IX_STATIC_CONST_STRING kIXDidSelectCell = @"didSelectCell";

// IXTableView Functions
IX_STATIC_CONST_STRING kIXResetAllBackgroundControls = @"resetSwipeControls";
IX_STATIC_CONST_STRING kIXSetBackgroundSwipeWidth = @"setSwipeSize";

// Non property constants
IX_STATIC_CONST_STRING kIXCellIdentifier = @"IXUITableViewCell";

@interface IXTable () <UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, strong) UITableView* tableView;
@property (nonatomic, assign) BOOL keepRowHighlightedOnSelect;

@end

@implementation IXTable

-(void)dealloc
{
    [_tableView setDataSource:nil];
    [_tableView setDelegate:nil];
}

-(void)buildView
{
    [super buildView];

    _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    [_tableView setDataSource:self];
    [_tableView setDelegate:self];
    [_tableView setSeparatorInset:UIEdgeInsetsZero];

    [[self contentView] addSubview:_tableView];
}

-(void)layoutControlContentsInRect:(CGRect)rect
{
    [super layoutControlContentsInRect:rect];

    [[self tableView] setFrame:rect];

    if( [[self attributeContainer] attributeExistsForName:kIXImageParallax] )
    {

        CGSize contentViewSize = [[self contentView] bounds].size;
        CGFloat parallaxHeight = [[self attributeContainer] getSizeValueForAttribute:kIXImageParallaxHeight maximumSize:contentViewSize.height defaultValue:0.0f];
        CGFloat parallaxWidth = [[self attributeContainer] getSizeValueForAttribute:kIXImageParallaxWidth maximumSize:contentViewSize.width defaultValue:0.0f];
        [[self tableView] addParallaxWithImage:_tableView.parallaxView.imageView.image withWidth:parallaxWidth andHeight:parallaxHeight];
    }
}

-(void)applySettings
{
    [super applySettings];

    if( [self refreshControl] != nil && [[self refreshControl] superview] != [self tableView] )
    {
        [[self tableView] addSubview:[self refreshControl]];
    }

    [[self tableView] sendSubviewToBack:[self refreshControl]];

    __weak typeof(self) weakSelf = self;
    [[self attributeContainer] getImageAttribute:kIXImageParallax
                                  successBlock:^(UIImage *image) {

                                      NSString* resizeDefault = [self.attributeContainer getStringValueForAttribute:kIXParallaxImageResizeMask defaultValue:nil];

                                      if (resizeDefault)
                                          image = [image resizedImageByMagick:resizeDefault];

                                      CGSize contentViewSize = [[self contentView] bounds].size;
                                      CGFloat parallaxHeight = [[self attributeContainer] getSizeValueForAttribute:kIXImageParallaxHeight maximumSize:contentViewSize.height defaultValue:0.0f];
                                      CGFloat parallaxWidth = [[self attributeContainer] getSizeValueForAttribute:kIXImageParallaxWidth maximumSize:contentViewSize.width defaultValue:0.0f];

                                      [[weakSelf tableView] addParallaxWithImage:image withWidth:parallaxWidth andHeight:parallaxHeight];
                                      [[[weakSelf tableView] parallaxView] layoutIfNeeded];

                                  } failBlock:^(NSError *error) {
                                  } shouldRefreshCachedImage:true];

    [[self tableView] setBackgroundColor:[[self contentView] backgroundColor]];
    [[self tableView] setScrollEnabled:[self scrollEnabled]];
    [[self tableView] setPagingEnabled:[self pagingEnabled]];
    [[self tableView] setShowsHorizontalScrollIndicator:[self showsHorizScrollIndicators]];
    [[self tableView] setShowsVerticalScrollIndicator:[self showsVertScrollIndicators]];
    [[self tableView] setIndicatorStyle:[self scrollIndicatorStyle]];
    [[self tableView] setAllowsSelection:[[self attributeContainer] getBoolValueForAttribute:kIXRowSelectEnabled defaultValue:YES]];
    [self setKeepRowHighlightedOnSelect:[[self attributeContainer] getBoolValueForAttribute:kIXKeepRowHighlightedOnSelect defaultValue:NO]];

    NSString* seperatorStyle = [[self attributeContainer] getStringValueForAttribute:kIXSeperatorStyle defaultValue:kIXSeperatorStyleDefault];
    if( [seperatorStyle isEqualToString:kIXSeperatorStyleNone] ) {
        [[self tableView] setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    } else {
        [[self tableView] setSeparatorStyle:UITableViewCellSeparatorStyleSingleLine];
        [[self tableView] setSeparatorColor:[[self attributeContainer] getColorValueForAttribute:kIXSeperatorColor defaultValue:[UIColor grayColor]]];
    }

    NSString* layoutFlow = [[self attributeContainer] getStringValueForAttribute:kIXLayoutFlow defaultValue:kIXLayoutFlowVertical];
    if ([layoutFlow isEqualToString:kIXLayoutFlowHorizontal])
    {
        [[self tableView] setTransform:CGAffineTransformMakeRotation(-M_PI_2)];
    }

    dispatch_async(dispatch_get_main_queue(),^{
        [self reload];
    });
}

-(void)applyFunction:(NSString *)functionName withParameters:(IXAttributeContainer *)parameterContainer
{
    if( [functionName isEqualToString:kIXResetAllBackgroundControls] )
    {
        for( IXUITableViewCell* cell in [[self tableView] visibleCells] )
        {
            [[cell cellBackgroundSwipeController] resetCellPosition];
        }
    }
    else if( [functionName isEqualToString:kIXSetBackgroundSwipeWidth] )
    {
        [self setBackgroundViewSwipeWidth:[parameterContainer getFloatValueForAttribute:kIXBackgroundSwipeWidth defaultValue:0.0f]];
        for( IXUITableViewCell* cell in [[self tableView] visibleCells] )
        {
            [[cell cellBackgroundSwipeController] setSwipeWidth:[self backgroundViewSwipeWidth]];
        }
    }
    else
    {
        [super applyFunction:functionName withParameters:parameterContainer];
    }
}

-(void)reload
{
    [super reload];

    if( [self animateReload] && [self animateReloadDuration] > 0.0f )
    {
        [UIView transitionWithView:[self tableView]
                          duration:[self animateReloadDuration]
                           options:UIViewAnimationOptionTransitionCrossDissolve | UIViewAnimationCurveEaseOut
                        animations: ^(void) {
                            [[self tableView] reloadData];
                        } completion:nil];
    }
    else
    {
        [[self tableView] reloadData];
    }
}

-(void)cellBackgroundWillBeginToOpen:(UIView *)cellView
{
    for( IXUITableViewCell* cell in [[self tableView] visibleCells] )
    {
        if( cell != cellView )
        {
            [[cell cellBackgroundSwipeController] resetCellPosition];
        }
    }
}

#pragma mark UITableViewDataSource and UITableViewDelegate  methods

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSArray* visibleIndexPaths = [tableView indexPathsForVisibleRows];
    if( [cell isKindOfClass:[IXUITableViewCell class]] && [visibleIndexPaths indexOfObject:indexPath] != NSNotFound )
    {
        IXLayout* layout = [(IXUITableViewCell*)cell layoutControl];
        [[layout actionContainer] executeActionsForEventNamed:kIXWillDisplayCell];
    }
}

- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSArray* visibleIndexPaths = [tableView indexPathsForVisibleRows];
    if( [cell isKindOfClass:[IXUITableViewCell class]] && [visibleIndexPaths indexOfObject:indexPath] == NSNotFound )
    {
        IXLayout* layout = [(IXUITableViewCell*)cell layoutControl];
        [[layout actionContainer] executeActionsForEventNamed:kIXDidHideCell];
    }
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    CGFloat height = [self tableView:tableView viewForHeaderInSection:section].frame.size.height;
    return height;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    return [[self headerViewForSection:section] contentView];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CGSize itemSize = [self sizeForCellAtIndexPath:indexPath];
    return itemSize.height;
}

- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section
{
    return [self rowCountForSection:section];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return [self numberOfSections];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    IXUITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:kIXCellIdentifier];
    if( cell == nil )
    {
        cell = [[IXUITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kIXCellIdentifier];
        [cell setSelectionStyle:UITableViewCellSelectionStyleBlue];
    }

    [[cell contentView] setBackgroundColor:[[self tableView] backgroundColor]];
    [self configureCell:cell withIndexPath:indexPath];

    NSString* layoutFlow = [[self attributeContainer] getStringValueForAttribute:kIXLayoutFlow defaultValue:kIXLayoutFlowVertical];
    if ([layoutFlow isEqualToString:kIXLayoutFlowHorizontal])
    {
        [cell setTransform:CGAffineTransformMakeRotation(M_PI_2)];
    }

    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if( ![self keepRowHighlightedOnSelect] )
    {
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
    }
    [[self actionContainer] executeActionsForEventNamed:kIXDidSelectCell];
}

#pragma mark UIScrollViewDelegate methods

-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
    for( IXUITableViewCell* cell in [[self tableView] visibleCells] )
    {
        [[cell cellBackgroundSwipeController] resetCellPosition];
    }

    [[self actionContainer] executeActionsForEventNamed:kIXStartedScrolling];
}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    [[self actionContainer] executeActionsForEventNamed:kIXEndedScrolling];
}

@end

@implementation IXTableView

@end


text:
#ifndef LINUX_NFS4_ACL_H
#define LINUX_NFS4_ACL_H

#include <linux/posix_acl.h>

/* Maximum ACL we'll accept from client; chosen (somewhat arbitrarily) to
 * fit in a page: */
#define NFS4_ACL_MAX 170

struct nfs4_acl *nfs4_acl_new(int);
int nfs4_acl_get_whotype(char *, u32);
int nfs4_acl_write_who(int who, char *p);
int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group,
		                        uid_t who, u32 mask);

#define NFS4_ACL_TYPE_DEFAULT	0x01
#define NFS4_ACL_DIR		0x02
#define NFS4_ACL_OWNER		0x04

struct nfs4_acl *nfs4_acl_posix_to_nfsv4(struct posix_acl *,
				struct posix_acl *, unsigned int flags);
int nfs4_acl_nfsv4_to_posix(struct nfs4_acl *, struct posix_acl **,
				struct posix_acl **, unsigned int flags);

#endif /* LINUX_NFS4_ACL_H */


text:
#include <Debug/Logger.hpp>
#include <Network/TcpServer.hpp>
#include <Triggers/TriggerManager.hpp>

namespace obe::Network
{
    TcpServer::TcpServer(Triggers::TriggerManager& triggers, unsigned short port,
        std::string triggerNamespace, std::string triggerGroup)
    {
        if (!triggerNamespace.empty())
        {
            m_socketTriggers
                = triggers.createTriggerGroup(triggerNamespace, triggerGroup);
            m_socketTriggers->add("DataReceived").add("Connected").add("Disconnected");
        }
        m_listener.setBlocking(false);
        m_listener.listen(port);

        m_clients.push_back(std::make_unique<sf::TcpSocket>());
        m_data.resize(m_maxBufferSize);
    }

    void TcpServer::update()
    {
        if (m_listener.accept(*m_clients.back()) == sf::Socket::Done)
        {
            if (m_socketTriggers)
            {
                m_socketTriggers->pushParameter(
                    "Connected", "client", m_clients.back().get());
                m_socketTriggers->pushParameter(
                    "Connected", "ip", m_clients.back()->getRemoteAddress().toString());
                m_socketTriggers->trigger("Connected");
            }
            Debug::Log->debug("<TcpServer> New client connected to server "
                              "listening at port {}",
                m_listener.getLocalPort());
            m_clients.push_back(std::make_unique<sf::TcpSocket>());
        }
        for (auto& client : m_clients)
        {
            std::size_t receivedDataSize = 0;
            m_status = client->receive(m_data.data(), m_maxBufferSize, receivedDataSize);
            if (m_status == sf::Socket::Done)
            {
                if (m_socketTriggers)
                {
                    m_socketTriggers->pushParameter("DataReceived", "content",
                        std::string(m_data.begin(), m_data.end())
                            .substr(0, receivedDataSize));
                    m_socketTriggers->pushParameter(
                        "DataReceived", "client", client.get());
                    m_socketTriggers->trigger("DataReceived");
                }
            }
            else if (m_status == sf::Socket::Disconnected)
            {
                if (m_socketTriggers)
                {
                    m_socketTriggers->trigger("Disconnected");
                }
            }
        }
    }

    void TcpServer::setBufferSize(unsigned int maxBufferSize)
    {
        m_maxBufferSize = maxBufferSize;
        m_data.resize(m_maxBufferSize);
    }

    /*std::vector<sf::TcpSocket&> TcpServer::getClients()
    {
        std::vector<sf::TcpSocket&> clientReferences;
        for (auto& client : m_clients)
        {
            clientReferences.push_back(*client.get());
        }
        return clientReferences;
    }*/
} // namespace obe::Network


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#pragma once

#include "core/graph/graph_utils.h"
#include "core/optimizer/initializer.h"

namespace onnxruntime::QDQ {

/**
 * @brief Convert the source int8_t TensorProto to a uint8_t one if the tensor
 *        contains values outside of [-64, 64]
 * @param src     The source tensor, must be type int8_t
 * @param dst     An empty tensor, will contain the converted tensor data
 * @param graph   Graph for generating tensor name or provide external
 *                data path
 * @param force   Perform conversion even when tensor values within [-64, 64]
 * @return        Whether the conversion happened.
*/
inline bool Int8TensorProto2Uint8(
    const ONNX_NAMESPACE::TensorProto* src,
    ONNX_NAMESPACE::TensorProto& dst,
    Graph& graph, bool force = false) {
  dst.set_data_type(ONNX_NAMESPACE::TensorProto_DataType_UINT8);

  if (nullptr == src) {
    uint8_t zero_val = 128;
    dst.set_name(graph.GenerateNodeArgName("weight_zp_s8_2_u8"));
    dst.set_raw_data(&zero_val, sizeof(uint8_t));
    return true;
  }

  dst.set_name(src->name() + "_s8_2_u8");
  dst.mutable_dims()->CopyFrom(src->dims());

  // TODO(fuchen): too many copies!
  //
  // Here we do two memory copies: Proto -> Initializer -> Proto.
  // Ideally we only do 1 copy, just iterate the source data, and write directly
  // to the dst raw buffer.
  // Unfortunately iterating the source data is complicated, the data maybe in
  // external file, a raw buffer, or a repeated field depending on the data
  // type.  UnpackTensor() already contains some of these logic and is closest
  // to what we need. But it does not handle external data. Write our own code
  // here means copy the logic of TensorProtoToTensor(), a violation of DRY
  // principle. A better solution is to provide an efficient const iterator for
  // TensorProto. This require coordination with onnx side.

  Initializer temp(*src, graph.ModelPath());
  int8_t* p = temp.data<int8_t>();
  bool should_convert = false;
  for (int i = 0; i < temp.size(); i++) {
    if (*p < -64 || *p > 64) {
      should_convert = true;
    }
    *p ^= 0x80;
    p++;
  }
  if (force || should_convert) {
    dst.set_raw_data(temp.data<int8_t>(), size_t(temp.size()));
    return true;
  }
  return false;
}

/**
 * @brief If the op_node has an single int8_t const weight tensor, convert it to uint8_t
 * @param graph
 * @param op_node
 * @param weights_idx     input index of the weight tensor
 * @param weight_zp_idx   input index of the weight zero point tensor
 * @return true when conversion happened.
*/
extern bool ConvertS8WeightToU8(Graph& graph, Node& op_node,
                                size_t weights_idx, size_t weight_zp_idx);

}


text:
<img src="https://github.com/conversant/rtree/blob/master/src/main/resources/RTree.png?raw=true">

# Conversant RTree

RTree is an index that supports building a tree of bounding rectangles for arbitrary range searches.   RTrees are efficient for geospatial data but can be extended to support any data that is amenable to range searching.

Conversant RTree is a hyper-dimensional (2D, 3D, 4D, nD) implementation of RTrees in Java.  Conversant RTree supports data with large numbers of orthogonal relations or high dimensionality in the same way that traditional RTrees support 2 or 3 dimensional spatial data.

### Conversant R-Tree is on Maven Central

Maven users can incorporate Conversant R-Tree the usual way.

```
<dependency>
  <groupId>com.conversantmedia</groupId>
  <artifactId>rtree</artifactId>
  <version>1.0.5</version>
</dependency>
```

Optionally specify a classifier for your version of Java

| classifier |
|:------------:|
| jdk8         |
| jdk10        |


text:
JMX to Prometheus exporter.
A Collector that can configurably scrape and expose mBeans of a JMX target.
It meant to be run as a Java Agent, exposing an HTTP server and scraping the local JVM.

    module.exports =
      deps:
        java: module: 'masson/commons/java', local: true, required: true
        iptables: module: 'masson/core/iptables', local: true
        zookeeper_server: module: '@rybajs/metal/zookeeper/server', local: true, required: true
        jmx_exporter: module: '@rybajs/storage/prometheus/jmx_exporters/zookeeper'
        hadoop_core: module: '@rybajs/metal/hadoop/core', local: true
        prometheus_monitor: module: '@rybajs/storage/prometheus/monitor', required: true
      configure: '@rybajs/storage/prometheus/jmx_exporters/zookeeper/configure'
      commands:
        install: [
          '@rybajs/storage/prometheus/jmx_exporters/zookeeper/install'
          '@rybajs/storage/prometheus/jmx_exporters/zookeeper/start'
        ]
        start : [
          '@rybajs/storage/prometheus/jmx_exporters/zookeeper/start'
        ]
        stop : [
          '@rybajs/storage/prometheus/jmx_exporters/zookeeper/stop'
        ]
        prepare: [
          '@rybajs/storage/prometheus/jmx_exporters/zookeeper/prepare'
        ]


text:
var fs = require('fs'),
    join = require('path').join,
    spec = join(__dirname, '..', 'fixtures', 'spec', 'spec');

/**
 * Normalize CSS
 *
 * @param {String} css
 * @api public
 */

module.exports.normalize = function(str) {
  return str.replace(/\s+/g, '').replace('{', '{\n').replace(';', ';\n');
};

/**
 * Get test suites
 *
 * @api public
 */

module.exports.getSuites = function() {
  var ret = {};
  var suites = fs.readdirSync(spec);
  var ignoreSuites = [
    'libsass-todo-issues',
    'libsass-todo-tests'
  ];

  suites.forEach(function(suite) {
    if (ignoreSuites.indexOf(suite) !== -1) {
      return;
    }

    var suitePath = join(spec, suite);
    var tests = fs.readdirSync(suitePath);

    ret[suite] = {};

    tests.forEach(function(test) {
      var testPath = join(suitePath, test);

      ret[suite][test] = {};
      ret[suite][test].src = join(testPath, 'input.scss');
      ret[suite][test].error = fs.existsSync(join(testPath, 'error'));
      ret[suite][test].expected = join(testPath, 'expected_output.css');
      ret[suite][test].paths = [
        testPath,
        join(testPath, 'sub')
      ];
    });
  });

  return ret;
};


text:
@interface YDEmotionKeyboard ()
//  容纳表情内容的控件
@property(nonatomic,strong)UIView * contentView  ;

//  1.tabBar
@property(nonatomic,strong)YDEmotionTabBar * tabBar ;
//  2.表情内容(4个)
@property(nonatomic,strong)YDEmotionListView * listViewRecently ;
@property(nonatomic,strong)YDEmotionListView * listViewDefault ;
@property(nonatomic,strong)YDEmotionListView * listViewEmoji ;
@property(nonatomic,strong)YDEmotionListView * listViewWaveFlower ;
@end

@implementation YDEmotionKeyboard
#pragma mark - 懒加载
- (YDEmotionListView *)listViewRecently
{
    if (!_listViewRecently) {
        _listViewRecently = [[YDEmotionListView alloc]init] ;
        //  从沙河中取出"最近"的所有表情
        _listViewRecently.emotions = [YDEmotionTool recentlyEmotions] ;
    }
    return _listViewRecently ;
}

- (YDEmotionListView *)listViewDefault
{
    if (!_listViewDefault) {
        _listViewDefault = [[YDEmotionListView alloc]init] ;
        self.listViewDefault.emotions = [YDEmotionTool defaultEmotions] ;
    }
    return _listViewDefault ;
}

- (YDEmotionListView *)listViewEmoji
{
    if (!_listViewEmoji) {
        _listViewEmoji = [[YDEmotionListView alloc]init] ;
        self.listViewEmoji.emotions = [YDEmotionTool emojiEmotions] ;
    }
    return _listViewEmoji ;
}

- (YDEmotionListView *)listViewWaveFlower
{
    if (!_listViewWaveFlower) {
        _listViewWaveFlower = [[YDEmotionListView alloc]init] ;

        self.listViewWaveFlower.emotions = [YDEmotionTool LXHEmotions] ;
    }
    return _listViewWaveFlower ;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //  1.contentView
        UIView * contentView = [[UIView alloc]init] ;
        [self addSubview:contentView] ;
        self.contentView = contentView ;

        //  2.tabBar
        YDEmotionTabBar * tabBar = [[YDEmotionTabBar alloc]init] ;
        [self addSubview:tabBar] ;
        self.tabBar = tabBar ;
    }
    return self ;
}

//  布局子控件
- (void)layoutSubviews
{
    //  tabbar 尺寸
    CGFloat tabBarW = self.frame.size.width;
    CGFloat tabBarH = 44 ;
    CGFloat tabBarX = 0 ;
    CGFloat tabBarY =  self.frame.size.height - tabBarH;
    self.tabBar.frame = CGRectMake(tabBarX, tabBarY, tabBarW, tabBarH) ;
    self.tabBar.emotionTabBarButtonBlock = ^(UIButton * sender){[self emotionTabBarButtonClink:sender];} ;

    //  contentView 尺寸
    CGFloat contentViewX = 0 ;
    CGFloat contentViewY = 0 ;
    CGFloat contentViewW = self.frame.size.width ;
    CGFloat contentViewH =  tabBarY;
    self.contentView.frame = CGRectMake(contentViewX, contentViewY, contentViewW, contentViewH) ;

}

//  监听子控件---切换控件
- (void)emotionTabBarButtonClink:(UIButton *)sender
{

    // 移除contentView之前显示的控件
    [self.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    //  根据按钮类型不同,切换contentView上面的listView
    switch (sender.tag) {
        case emotionTabBarTypeRecently:
        {
            NSLog(@"最近");

            [self.contentView addSubview:self.listViewRecently] ;
            break;
        }

        case emotionTabBarTypeDefault:
        {
            NSLog(@"默认");
            [self.contentView addSubview:self.listViewDefault] ;
            break;
        }

        case emotionTabBarTypeEmoji:
        {
            NSLog(@"Emoji");
            [self.contentView addSubview:self.listViewEmoji] ;
            break;
        }

        case emotionTabBarTypeWaveFlower:
        {
            NSLog(@"浪小花");
            [self.contentView addSubview:self.listViewWaveFlower] ;
            break;
        }

        default:
            break;
    }

    //  给添加contentView上的子控件,设置尺寸
    YDEmotionListView * ListView = [self.contentView.subviews lastObject] ;
    ListView.frame = self.contentView.bounds ;

}

@end


text:
from typing import Optional

from fastapi import FastAPI, Security
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from fastapi.testclient import TestClient

app = FastAPI()

security = HTTPBearer(auto_error=False)

@app.get("/users/me")
def read_current_user(
    credentials: Optional[HTTPAuthorizationCredentials] = Security(security),
):
    if credentials is None:
        return {"msg": "Create an account first"}
    return {"scheme": credentials.scheme, "credentials": credentials.credentials}

client = TestClient(app)

openapi_schema = {
    "openapi": "3.0.2",
    "info": {"title": "FastAPI", "version": "0.1.0"},
    "paths": {
        "/users/me": {
            "get": {
                "responses": {
                    "200": {
                        "description": "Successful Response",
                        "content": {"application/json": {"schema": {}}},
                    }
                },
                "summary": "Read Current User",
                "operationId": "read_current_user_users_me_get",
                "security": [{"HTTPBearer": []}],
            }
        }
    },
    "components": {
        "securitySchemes": {"HTTPBearer": {"type": "http", "scheme": "bearer"}}
    },
}

def test_openapi_schema():
    response = client.get("/openapi.json")
    assert response.status_code == 200, response.text
    assert response.json() == openapi_schema

def test_security_http_bearer():
    response = client.get("/users/me", headers={"Authorization": "Bearer foobar"})
    assert response.status_code == 200, response.text
    assert response.json() == {"scheme": "Bearer", "credentials": "foobar"}

def test_security_http_bearer_no_credentials():
    response = client.get("/users/me")
    assert response.status_code == 200, response.text
    assert response.json() == {"msg": "Create an account first"}

def test_security_http_bearer_incorrect_scheme_credentials():
    response = client.get("/users/me", headers={"Authorization": "Basic notreally"})
    assert response.status_code == 200, response.text
    assert response.json() == {"msg": "Create an account first"}


text:
package org.apereo.cas.authentication.support;

import org.apereo.cas.authentication.ProtocolAttributeEncoder;
import org.apereo.cas.services.RegisteredService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * This is {@link NoOpProtocolAttributeEncoder} that does no encoding of attributes received.
 * It will simply return the same exact collection of attributes received back to the caller.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
public class NoOpProtocolAttributeEncoder implements ProtocolAttributeEncoder {
    private static final Logger LOGGER = LoggerFactory.getLogger(NoOpProtocolAttributeEncoder.class);

    @Override
    public Map<String, Object> encodeAttributes(final Map<String, Object> attributes, final RegisteredService service) {
        LOGGER.warn("Attributes are not encoded via [{}]. Total of [{}] attributes will be returned for service [{}]",
                this.getClass().getSimpleName(), attributes.size(), service);
        return new HashMap<>(attributes);
    }
}


text:
package androidx.media3.transformer;

import androidx.annotation.Nullable;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.MimeTypes;
import androidx.media3.decoder.DecoderInputBuffer;
import androidx.media3.exoplayer.BaseRenderer;
import androidx.media3.exoplayer.MediaClock;
import androidx.media3.exoplayer.RendererCapabilities;
import androidx.media3.exoplayer.source.SampleStream.ReadDataResult;
import com.google.errorprone.annotations.ForOverride;
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;

/* package */ abstract class TransformerBaseRenderer extends BaseRenderer {

  protected final MuxerWrapper muxerWrapper;
  protected final TransformerMediaClock mediaClock;
  protected final TransformationRequest transformationRequest;
  protected final Transformer.AsyncErrorListener asyncErrorListener;
  protected final FallbackListener fallbackListener;

  private boolean isTransformationRunning;
  protected long streamOffsetUs;
  protected long streamStartPositionUs;
  protected @MonotonicNonNull SamplePipeline samplePipeline;

  public TransformerBaseRenderer(
      int trackType,
      MuxerWrapper muxerWrapper,
      TransformerMediaClock mediaClock,
      TransformationRequest transformationRequest,
      Transformer.AsyncErrorListener asyncErrorListener,
      FallbackListener fallbackListener) {
    super(trackType);
    this.muxerWrapper = muxerWrapper;
    this.mediaClock = mediaClock;
    this.transformationRequest = transformationRequest;
    this.asyncErrorListener = asyncErrorListener;
    this.fallbackListener = fallbackListener;
  }

  /**
   * Returns whether the renderer supports the track type of the given format.
   *
   * @param format The format.
   * @return The {@link Capabilities} for this format.
   */
  @Override
  public final @Capabilities int supportsFormat(Format format) {
    return RendererCapabilities.create(
        MimeTypes.getTrackType(format.sampleMimeType) == getTrackType()
            ? C.FORMAT_HANDLED
            : C.FORMAT_UNSUPPORTED_TYPE);
  }

  @Override
  public final MediaClock getMediaClock() {
    return mediaClock;
  }

  @Override
  public final boolean isReady() {
    return isSourceReady();
  }

  @Override
  public final boolean isEnded() {
    return samplePipeline != null && samplePipeline.isEnded();
  }

  @Override
  public final void render(long positionUs, long elapsedRealtimeUs) {
    try {
      if (!isTransformationRunning || isEnded() || !ensureConfigured()) {
        return;
      }

      while (samplePipeline.processData() || feedPipelineFromInput()) {}
    } catch (TransformationException e) {
      isTransformationRunning = false;
      asyncErrorListener.onTransformationException(e);
    }
  }

  @Override
  protected final void onStreamChanged(Format[] formats, long startPositionUs, long offsetUs) {
    this.streamOffsetUs = offsetUs;
    this.streamStartPositionUs = startPositionUs;
  }

  @Override
  protected final void onEnabled(boolean joining, boolean mayRenderStartOfStream) {
    muxerWrapper.registerTrack();
    fallbackListener.registerTrack();
    mediaClock.updateTimeForTrackType(getTrackType(), 0L);
  }

  @Override
  protected final void onStarted() {
    isTransformationRunning = true;
  }

  @Override
  protected final void onStopped() {
    isTransformationRunning = false;
  }

  @Override
  protected final void onReset() {
    if (samplePipeline != null) {
      samplePipeline.release();
    }
  }

  @ForOverride
  @EnsuresNonNullIf(expression = "samplePipeline", result = true)
  protected abstract boolean ensureConfigured() throws TransformationException;

  /**
   * Attempts to read input data and pass the input data to the sample pipeline.
   *
   * @return Whether it may be possible to read more data immediately by calling this method again.
   * @throws TransformationException If a {@link SamplePipeline} problem occurs.
   */
  @RequiresNonNull("samplePipeline")
  private boolean feedPipelineFromInput() throws TransformationException {
    @Nullable DecoderInputBuffer samplePipelineInputBuffer = samplePipeline.dequeueInputBuffer();
    if (samplePipelineInputBuffer == null) {
      return false;
    }

    @ReadDataResult
    int result = readSource(getFormatHolder(), samplePipelineInputBuffer, /* readFlags= */ 0);
    switch (result) {
      case C.RESULT_BUFFER_READ:
        samplePipelineInputBuffer.flip();
        if (samplePipelineInputBuffer.isEndOfStream()) {
          samplePipeline.queueInputBuffer();
          return false;
        }
        mediaClock.updateTimeForTrackType(getTrackType(), samplePipelineInputBuffer.timeUs);
        samplePipeline.queueInputBuffer();
        return true;
      case C.RESULT_FORMAT_READ:
        throw new IllegalStateException("Format changes are not supported.");
      case C.RESULT_NOTHING_READ:
      default:
        return false;
    }
  }
}


text:
<?php
namespace bright\core\frontend;

use bright\core\model\Model;

use bright\core\Utils;

class BasicView {

	private $_smarty;

	private $_data = array();

	private $_content;

	public function __construct($content) {
		// create object
		$cls = get_called_class();

		$this -> maintemplate = 'default';
		$this -> viewtemplate = strtolower(substr(get_called_class(), strrpos(get_called_class(), '\\')+1, -4)) . '.tpl';
		$this -> _smarty = new \Smarty();
		$ds = DIRECTORY_SEPARATOR;
		$this -> _smarty -> addTemplateDir(BASEPATH . "bright{$ds}site{$ds}templates{$ds}")
						 -> setCacheDir(BASEPATH . "bright{$ds}cache{$ds}smarty")
						 -> setCompileDir(BASEPATH . "bright{$ds}cache{$ds}smarty_c")
						 -> enableSecurity()
						 -> php_handling = \Smarty::PHP_REMOVE;
		$this -> _smarty -> error_reporting = E_ALL & ~E_NOTICE;
		$this -> _content = $content;
		$this -> language = $_SESSION[BSP]['language'];
	}

	public function __set($name, $value) {
		switch ($name) {
			case 'maintemplate':
			case 'viewtemplate':
				if(!Utils::endsWith($value, '.tpl')) {
					$value .= '.tpl';
				}
			break;
		}
		$this -> _data[$name] = $value;
	}

	public function __get($name) {
		if(array_key_exists($name, $this -> _data))
			return $this -> _data[$name];

		if(isset($this -> _content -> content -> $name)) {
			if(isset($this -> _content -> content -> {$name}[$this -> language])) {
				return $this -> _content -> content -> {$name}[$this -> language];

			}
		}
		return null;
	}

	/**
	 * Gets the url of the current page
	 * @param boolean $relative When true, the domain is omitted
	 * @param boolean $includeParameters When false, the GET parameters are omitted
	 * @return string The url of the current page
	 */
	public function getPageUrl($relative = false, $includeParameters = true) {
		if($relative) {
			$url = '';
		} else {
			$url = 'http';
			if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
				$url .= 's';

			$url .= '://' . $_SERVER['SERVER_NAME'];

			if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 80) {
				$url .= ':80';
		}
		}
		$url .= $_SERVER['REQUEST_URI'];
		if($includeParameters === false) {
			$ua = explode('?');
			if(count($ua) > 1) {
				array_pop($ua);
			}
			$url = join('?', $ua);
		}
		return $url;
	}

	public final function render() {
		$this -> _smarty->assign('this', $this);
		// display it
		$this -> _smarty->display(BASEPATH . '/bright/site/templates/' . $this -> maintemplate);
	}

	public final function debug($variable) {
		echo '<pre>';
		print_r($variable);
		echo '</pre>';
	}
}


text:
<?php
/*
 * In this file you can override all configuration options for user "example"
 */

/* this sets example's password to "expass" */
$ara_user["pass"] = "expass2";

/* SQL server setings */
//$config["sql_username"]    = "radius-restricted";
//$config["sql_passwd"]      = "radiusabc";

/* set access level - choose from:
 * 	ARA_ACCESS_NONE     - guess
 * 	ARA_ACCESS_VIEW     - can view everything except passwd_attributes
 * 	ARA_ACCESS_VIEW_ALL - as above, but this time everything
 * 	ARA_ACCESS_EDIT     - as above, but can save forms
 * 	ARA_ACCESS_ALL      - is Charlie Root here
 */
$config["access_level"] = ARA_ACCESS_EDIT;

/* by default allow (TRUE) or deny (FALSE) access to modules */
$config["default_access"] = TRUE;

/* forbid access to specified modules, use this if default_access == TRUE
 *
 * eg. $config["forbidden_modules"] = array("user/list-online", "nas/edit");
 */
//$config["forbidden_modules"] = array();

/* allow access to specified modules, use this if default_access == FALSE
 *
 * see the sample above
 */
//$config["allowed_modules"] = array("nas/edit");

?>


text:
/**
 * country-region-selector
 * -----------------------
 * <%=__VERSION__%>
 * @author Ben Keen
 * @repo https://github.com/benkeen/country-region-selector
 * @licence MIT
 */
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module
        define([], factory);
    } else if (typeof exports === 'object') {
        // Add try/catch for CommonJS-like environments that support module.exports
        try {
            module.exports = factory(require());
        } catch (err) {
            module.exports = factory();
        }
    } else {
        // browser globals (root is window)
        root.crs = factory(root);
    }
}(this, function () {

    "use strict";

    var _countryClass = "crs-country";
    var _defaultCountryStr = "Select country";
    var _defaultRegionStr = "Select region";
    var _showEmptyCountryOption = true;
    var _showEmptyRegionOption = true;
    var _countries = [];

    // included during grunt build step (run `grunt generate` on the command line)
    //<%=__DATA__%>

    var _init = function () {
        $("." + _countryClass).each(_populateCountryFields);
    };

    var _populateCountryFields = function () {
        var countryElement = this;

        // ensure the dropdown only gets initialized once
        var loaded = countryElement.getAttribute("data-crs-loaded");
        if (loaded === "true") {
            return;
        }

        countryElement.length = 0;
        var customOptionStr = $(countryElement).attr("data-default-option");
        var defaultOptionStr = customOptionStr ? customOptionStr : _defaultCountryStr;
        var showEmptyOption = countryElement.getAttribute("data-show-default-option");
        _showEmptyCountryOption = (showEmptyOption === null) ? true : (showEmptyOption === "true");

        var defaultSelectedValue = $(countryElement).attr("data-default-value");
        var customValue = $(countryElement).attr("data-value");
        var foundIndex = 0;

        if (_showEmptyCountryOption) {
            this.options[0] = new Option(defaultOptionStr, '');
        }
        _initDataSet({
            whitelist: countryElement.getAttribute("data-whitelist"),
            blacklist: countryElement.getAttribute("data-blacklist"),
            preferred: countryElement.getAttribute("data-preferred"),
            preferredDelim: countryElement.getAttribute("data-preferred-delim")
        });

        for (var i = 0; i < _countries.length; i++) {
            var val = (customValue == "shortcode" || customValue === "2-char") ? _countries[i][1] : _countries[i][0];
            if (_countries[i][4]) {
                val = "";
            }
            countryElement.options[countryElement.length] = new Option(_countries[i][0], val);

            if (defaultSelectedValue != null && defaultSelectedValue === val) {
                foundIndex = i;
                if (_showEmptyCountryOption) {
                    foundIndex++;
                }
            }
        }
        this.selectedIndex = foundIndex;

        var regionID = $(countryElement).attr("data-region-id");
        if (!regionID) {
            console.error("Missing data-region-id on country-region-selector country field.");
            return;
        }

        var regionElement = $("#" + regionID)[0];
        if (regionElement) {
            _initRegionField(regionElement);

            $(this).on("change", function () {
                _populateRegionFields(countryElement, regionElement);
            });

            // if the country dropdown has a default value, populate the region field as well
            if (defaultSelectedValue && countryElement.selectedIndex > 0) {
                _populateRegionFields(countryElement, regionElement);

                var defaultRegionSelectedValue = $(regionElement).attr("data-default-value");

                var useShortcode = (regionElement.getAttribute("data-value") === "shortcode");
                if (defaultRegionSelectedValue !== null) {
                    var index = (_showEmptyCountryOption) ? countryElement.selectedIndex - 1 : countryElement.selectedIndex;
                    var data = _countries[index][3];
                    _setDefaultRegionValue(regionElement, data, defaultRegionSelectedValue, useShortcode);
                }
            } else if (_showEmptyCountryOption === false) {
                _populateRegionFields(countryElement, regionElement);
            }
        } else {
            console.error("Region dropdown DOM node with ID " + regionID + " not found.");
        }

        countryElement.setAttribute("data-crs-loaded", "true");
    };

    var _initRegionField = function (el) {
        var customOptionStr = $(el).attr("data-blank-option");
        var defaultOptionStr = customOptionStr ? customOptionStr : "-";
        var showEmptyOption = el.getAttribute("data-show-default-option");
        _showEmptyRegionOption = (showEmptyOption === null) ? true : (showEmptyOption === "true");

        el.length = 0;
        if (_showEmptyRegionOption) {
            el.options[0] = new Option(defaultOptionStr, "");
            el.selectedIndex = 0;
        }
    };

    // called on country field initialization. It reduces the subset of countries depending on whether the user
    // specified a white/blacklist and parses the region list to extract the
    var _initDataSet = function (params) {
        var countries = _data;
        var subset = [], i = 0;
        if (params.whitelist) {
            var whitelist = params.whitelist.split(",");
            for (i = 0; i < _data.length; i++) {
                if (whitelist.indexOf(_data[i][1]) !== -1) {
                    subset.push(_data[i]);
                }
            }
            countries = subset;
        } else if (params.blacklist) {
            var blacklist = params.blacklist.split(",");
            for (i = 0; i < _data.length; i++) {
                if (blacklist.indexOf(_data[i][1]) === -1) {
                    subset.push(_data[i]);
                }
            }
            countries = subset;
        }

        if (params.preferred) {
            countries = _applyPreferredCountries(countries, params.preferred, params.preferredDelim);
        }

        _countries = countries;

        // now init the regions
        _initRegions();
    };

    var _initRegions = function () {
        for (var i = 0; i < _countries.length; i++) {
            var regionData = {
                hasShortcodes: /~/.test(_countries[i][2]),
                regions: []
            };
            var regions = _countries[i][2].split("|");
            for (var j = 0; j < regions.length; j++) {
                var parts = regions[j].split("~");
                regionData.regions.push([parts[0], parts[1]]); // 2nd index will be undefined for regions that don't have shortcodes
            }
            _countries[i][3] = regionData;
        }
    };

    var _setDefaultRegionValue = function (field, data, val, useShortcode) {
        for (var i = 0; i < data.regions.length; i++) {
            var currVal = (useShortcode && data.hasShortcodes && data.regions[i][1]) ? data.regions[i][1] : data.regions[i][0];
            if (currVal === val) {
                field.selectedIndex = (_showEmptyRegionOption) ? i + 1 : i;
                break;
            }
        }
    };

    var _populateRegionFields = function (countryElement, regionElement) {
        var selectedCountryIndex = (_showEmptyCountryOption) ? countryElement.selectedIndex - 1 : countryElement.selectedIndex;
        var customOptionStr = $(regionElement).attr("data-default-option");
        var displayType = regionElement.getAttribute("data-value");
        var defaultOptionStr = customOptionStr ? customOptionStr : _defaultRegionStr;

        if (countryElement.value === "") {
            _initRegionField(regionElement);
        } else {
            regionElement.length = 0;
            if (_showEmptyRegionOption) {
                regionElement.options[0] = new Option(defaultOptionStr, '');
            }
            var regionData = _countries[selectedCountryIndex][3];

            var weWantAndHaveShortCodes = displayType === 'shortcode' && regionData.hasShortcodes;
            var indexToSort = weWantAndHaveShortCodes ? 1 : 0;
            regionData.regions.sort(function(a, b) {
                var x = a[indexToSort].toLowerCase();
                var y = b[indexToSort].toLowerCase();
                return x < y ? -1 : x > y ? 1 : 0;
            });

            for (var i = 0; i < regionData.regions.length; i++) {
                var val = weWantAndHaveShortCodes ? regionData.regions[i][1] : regionData.regions[i][0];
                regionElement.options[regionElement.length] = new Option(regionData.regions[i][0], val);
            }

            regionElement.selectedIndex = 0;
        }
    };

    // in 0.5.0 we added the option for "preferred" countries that get listed first. This just causes the preferred
    // countries to get listed at the top of the list with an optional delimiter row following them
    var _applyPreferredCountries = function (countries, preferred, preferredDelim) {
        var preferredShortCodes = preferred.split(',').reverse();
        var preferredMap = {};
        var foundPreferred = false;

        var updatedCountries = countries.filter(function (c) {
            if (preferredShortCodes.indexOf(c[1]) !== -1) {
                preferredMap[c[1]] = c;
                foundPreferred = true;
                return false;
            }
            return true;
        });

        if (foundPreferred && preferredDelim) {
            updatedCountries.unshift([preferredDelim, "", "", {}, true]);
        }

        // now prepend the preferred countries
        for (var i=0; i<preferredShortCodes.length; i++) {
            var code = preferredShortCodes[i];
            updatedCountries.unshift(preferredMap[code]);
        }

        return updatedCountries;
    };

    $(_init);

    return {
        init: _init
    };

}));