text:
<?xml version="1.0"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
<project name="solr-webapp" default="default">
  <description>Solr webapp</description>

  <property name="rat.additional-includes" value="**"/>
  <property name="rat.additional-excludes" value="web/img/**"/>

  <import file="../common-build.xml"/>

  <property name="exclude.from.war" value="*slf4j*,log4j-*" />
  <property name="solr.war.suffix" value="" />

  <target name="test" depends="compile-test-solr-core">
  	<!-- no more JSP -->
  </target>

  <!-- this module has no javadocs -->
  <target name="javadocs"/>

  <!-- this module has no jar either -->
  <target name="jar-core"/>

  <!-- nothing to compile -->
  <target name="compile-core"/>
  <target name="compile-test"/>

  <target name="dist"
          description="Creates the Solr WAR Distribution file."
          depends="test, init-dist, dist-core, dist-solrj, lucene-jars-to-solr">
    <build-manifest title="Apache Solr Search Server"
                    implementation.title="org.apache.solr"
                    spec.version="${spec.version}"/>
    <ant dir="${common-solr.dir}" inheritall="false" target="contribs-add-to-war"/>
    <war destfile="${dist}/solr-${version}${solr.war.suffix}.war"
         webxml="web/WEB-INF/web.xml"
         manifest="${manifest.file}">
      <lib dir="${common-solr.dir}/core/lib" excludes="${exclude.from.war},${common.classpath.excludes}"/>
      <lib dir="${common-solr.dir}/solrj/lib" excludes="${exclude.from.war},${common.classpath.excludes}"/>
      <lib dir="${lucene-libs}" excludes="${exclude.from.war},${common.classpath.excludes}" />
      <lib dir="${dist}" excludes="${exclude.from.war},${common.classpath.excludes}">
        <include name="solr-solrj-${version}.jar" />
        <include name="solr-core-${version}.jar" />
      </lib>
      <fileset dir="${dest}/web" excludes="${exclude.from.war}"/> <!-- contribs' additions -->
      <fileset dir="web" excludes="${exclude.from.war}"/>
      <metainf dir="${common-solr.dir}" includes="LICENSE.txt,NOTICE.txt" excludes="${exclude.from.war}"/>
    </war>
  </target>

  <target name="dist-maven"
          depends="filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom, -unpack-solr-tgz">
    <m2-deploy jar.file="${solr.tgz.unpack.dir}/solr-${version}/dist/solr-${version}.war"
               pom.xml="${filtered.pom.templates.dir}/solr/webapp/pom.xml"/>
  </target>
</project>


text:
#ifndef GLTestContext_DEFINED
#define GLTestContext_DEFINED

#include "include/gpu/gl/GrGLInterface.h"
#include "tools/gpu/TestContext.h"

namespace sk_gpu_test {
/**
 * An offscreen OpenGL context. Provides a GrGLInterface struct of function pointers for the context
 * This class is intended for Skia's internal testing needs and not for general use.
 * When SK_GL is not defined the GrGLInterface will always be nullptr.
 */
class GLTestContext : public TestContext {
public:
    ~GLTestContext() override;

    virtual GrBackendApi backend() override { return GrBackendApi::kOpenGL; }

    /** Does this represent a successfully created GL context? */
    bool isValid() const;

    const GrGLInterface* gl() const { return fGL.get(); }

    /** Used for testing EGLImage integration. Take a GL_TEXTURE_2D and wraps it in an EGL Image */
    virtual GrEGLImage texture2DToEGLImage(GrGLuint /*texID*/) const { return nullptr; }

    virtual void destroyEGLImage(GrEGLImage) const { }

    /** Used for testing GL_TEXTURE_RECTANGLE integration. */
    GrGLuint createTextureRectangle(int width, int height, GrGLenum internalFormat,
                                    GrGLenum externalFormat, GrGLenum externalType, GrGLvoid* data);

    /**
     * Used for testing EGLImage integration. Takes a EGLImage and wraps it in a
     * GL_TEXTURE_EXTERNAL_OES.
     */
    virtual GrGLuint eglImageToExternalTexture(GrEGLImage) const { return 0; }

    void testAbandon() override;

    /** Wait until all GPU work is finished. */
    void finish() override;

    /**
     * Creates a new GL context of the same type and makes the returned context current
     * (if not null).
     */
    virtual std::unique_ptr<GLTestContext> makeNew() const { return nullptr; }

    template<typename Ret, typename... Args>
    void getGLProcAddress(Ret(GR_GL_FUNCTION_TYPE** out)(Args...),
                          const char* name, const char* ext = nullptr) const {
        using Proc = Ret(GR_GL_FUNCTION_TYPE*)(Args...);
        if (!SkStrStartsWith(name, "gl")) {
            SK_ABORT("getGLProcAddress: proc name must have 'gl' prefix");
            *out = nullptr;
        } else if (ext) {
            SkString fullname(name);
            fullname.append(ext);
            *out = reinterpret_cast<Proc>(this->onPlatformGetProcAddress(fullname.c_str()));
        } else {
            *out = reinterpret_cast<Proc>(this->onPlatformGetProcAddress(name));
        }
    }

    sk_sp<GrContext> makeGrContext(const GrContextOptions& options) override;

protected:
    GLTestContext();

    /*
     * Methods that subclasses must call from their constructors and destructors.
     */
    void init(sk_sp<const GrGLInterface>);

    void teardown() override;

    virtual GrGLFuncPtr onPlatformGetProcAddress(const char *) const = 0;

private:
    /** Subclass provides the gl interface object if construction was
     *  successful. */
    sk_sp<const GrGLInterface> fGL;
#ifndef SK_GL
    bool fWasInitialized = false;
#endif

    typedef TestContext INHERITED;
};

/**
 * Creates platform-dependent GL context object.  The shareContext parameter is in an optional
 * context with which to share display lists. This should be a pointer to an GLTestContext created
 * with SkCreatePlatformGLTestContext.  NULL indicates that no sharing is to take place. Returns a
 * valid gl context object or NULL if such can not be created.
 */
GLTestContext* CreatePlatformGLTestContext(GrGLStandard forcedGpuAPI,
                                           GLTestContext *shareContext = nullptr);

}  // namespace sk_gpu_test
#endif

redpajama_set_name: RedPajamaGithub


text:
package org.jkiss.dbeaver.utils;

import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.connection.DBPNativeClientLocation;
import org.jkiss.dbeaver.model.runtime.AbstractJob;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress;
import org.jkiss.dbeaver.model.runtime.DefaultProgressMonitor;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.utils.ArrayUtils;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.StandardConstants;

import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.net.*;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * RuntimeUtils
 */
public final class RuntimeUtils {
    private static final Log log = Log.getLog(RuntimeUtils.class);

    private static final boolean IS_WINDOWS = Platform.getOS().equals(Platform.OS_WIN32);
    private static final boolean IS_MACOS = Platform.getOS().equals(Platform.OS_MACOSX);
    private static final boolean IS_LINUX = Platform.getOS().equals(Platform.OS_LINUX);

    private static final byte[] NULL_MAC_ADDRESS = new byte[] {0, 0, 0, 0, 0, 0};

    private RuntimeUtils() {
        //intentionally left blank
    }

    public static <T> T getObjectAdapter(Object adapter, Class<T> objectType) {
        return Platform.getAdapterManager().getAdapter(adapter, objectType);
    }

    public static <T> T getObjectAdapter(Object adapter, Class<T> objectType, boolean force) {
        IAdapterManager adapterManager = Platform.getAdapterManager();
        if (force) {
            adapterManager.loadAdapter(adapter, objectType.getName());
        }
        return adapterManager.getAdapter(adapter, objectType);
    }

    public static DBRProgressMonitor makeMonitor(IProgressMonitor monitor) {
        if (monitor instanceof DBRProgressMonitor) {
            return (DBRProgressMonitor) monitor;
        }
        return new DefaultProgressMonitor(monitor);
    }

    public static IProgressMonitor getNestedMonitor(DBRProgressMonitor monitor) {
        if (monitor instanceof IProgressMonitor) {
            return (IProgressMonitor) monitor;
        }
        return monitor.getNestedMonitor();
    }

    public static File getUserHomeDir() {
        String userHome = System.getProperty(StandardConstants.ENV_USER_HOME); //$NON-NLS-1$
        if (userHome == null) {
            userHome = ".";
        }
        return new File(userHome);
    }

    public static String getCurrentDate() {
        return new SimpleDateFormat(GeneralUtils.DEFAULT_DATE_PATTERN, Locale.ENGLISH).format(new Date()); //$NON-NLS-1$
/*
        Calendar c = Calendar.getInstance();
        c.setTime(new Date());
        final int month = c.get(Calendar.MONTH) + 1;
        final int day = c.get(Calendar.DAY_OF_MONTH);
        return "" + c.get(Calendar.YEAR) + (month < 10 ? "0" + month : month) + (day < 10 ? "0" + day : day);
*/
    }

    public static String getCurrentTimeStamp() {
        return new SimpleDateFormat(GeneralUtils.DEFAULT_TIMESTAMP_PATTERN, Locale.ENGLISH).format(new Date()); //$NON-NLS-1$
/*
        Calendar c = Calendar.getInstance();
        c.setTime(new Date());
        final int month = c.get(Calendar.MONTH) + 1;
        return "" + c.get(Calendar.YEAR) + (month < 10 ? "0" + month : month) + c.get(Calendar.DAY_OF_MONTH) + c.get(Calendar.HOUR_OF_DAY) + c.get(Calendar.MINUTE);
*/
    }

    public static boolean isTypeSupported(Class<?> type, Class[] supportedTypes) {
        if (type == null || ArrayUtils.isEmpty(supportedTypes)) {
            return false;
        }
        for (Class<?> tmp : supportedTypes) {
            if (tmp.isAssignableFrom(type)) {
                return true;
            }
        }
        return false;
    }

    public static String getNativeBinaryName(String binName) {
        return isWindows() ? binName + ".exe" : binName;
    }

    public static File getNativeClientBinary(@NotNull DBPNativeClientLocation home, @Nullable String binFolder, @NotNull String binName) throws IOException {
        binName = getNativeBinaryName(binName);
        File dumpBinary = new File(home.getPath(),
            binFolder == null ? binName : binFolder + "/" + binName);
        if (!dumpBinary.exists()) {
            dumpBinary = new File(home.getPath(), binName);
            if (!dumpBinary.exists()) {
                throw new IOException("Utility '" + binName + "' not found in client home '" + home.getDisplayName() + "' (" + home.getPath().getAbsolutePath() + ")");
            }
        }
        return dumpBinary;
    }

    @NotNull
    public static IStatus stripStack(@NotNull IStatus status) {
        if (status instanceof MultiStatus) {
            IStatus[] children = status.getChildren();
            if (children != null) {
                for (int i = 0; i < children.length; i++) {
                    children[i] = stripStack(children[i]);
                }
            }
            return new MultiStatus(status.getPlugin(), status.getCode(), children, status.getMessage(), null);
        } else if (status instanceof Status) {
            String messagePrefix = "";
            if (status.getException() != null && (CommonUtils.isEmpty(status.getException().getMessage()))) {
                messagePrefix = status.getException().getClass().getName() + ": ";
                return new Status(status.getSeverity(), status.getPlugin(), status.getCode(), messagePrefix + status.getMessage(), null);
            } else {
                return status;
            }
        }
        return status;
    }

    public static void pause(int ms) {
        try {
            Thread.sleep(ms);
        } catch (InterruptedException e) {
            log.debug("Sleep interrupted", e);
        }
    }

    public static String formatExecutionTime(long ms) {
        if (ms < 1000) {
            // Less than a second, show just ms
            return String.valueOf(ms) + "ms";
        }
        if (ms < 60000) {
            // Less than a minute, show sec and ms
            return String.valueOf(ms / 1000) + "." + String.valueOf(ms % 1000) + "s";
        }
        long sec = ms / 1000;
        long min = sec / 60;
        sec -= min * 60;
        return String.valueOf(min) + "m " + String.valueOf(sec) + "s";
    }

    public static File getPlatformFile(String platformURL) throws IOException {
        URL url = new URL(platformURL);
        URL fileURL = FileLocator.toFileURL(url);
        return getLocalFileFromURL(fileURL);

    }

    public static File getLocalFileFromURL(URL fileURL) throws IOException {
        // Escape spaces to avoid URI syntax error
        try {
            URI filePath = GeneralUtils.makeURIFromFilePath(fileURL.toString());
            return new File(filePath);
        } catch (URISyntaxException e) {
            throw new IOException("Bad local file path: " + fileURL, e);
        }
    }

    public static boolean runTask(final DBRRunnableWithProgress task, String taskName, final long waitTime) {
        return runTask(task, taskName, waitTime, false);
    }

    public static boolean runTask(final DBRRunnableWithProgress task, String taskName, final long waitTime, boolean hidden) {
        final MonitoringTask monitoringTask = new MonitoringTask(task);
        Job monitorJob = new AbstractJob(taskName) {
            {
                setSystem(hidden);
                setUser(!hidden);
            }

            @Override
            protected IStatus run(DBRProgressMonitor monitor) {
                monitor.beginTask(getName(), 1);
                try {
                    monitor.subTask("Execute task");
                    monitoringTask.run(monitor);
                } catch (InvocationTargetException e) {
                    log.error(getName() + " - error", e.getTargetException());
                    return Status.OK_STATUS;
                } catch (InterruptedException e) {
                    // do nothing
                } finally {
                    monitor.done();
                }
                return Status.OK_STATUS;
            }
        };

        monitorJob.schedule();

        // Wait for job to finish
        long startTime = System.currentTimeMillis();
        while (!monitoringTask.finished) {
            if (waitTime > 0 && System.currentTimeMillis() - startTime > waitTime) {
                break;
            }
            try {
                if (!DBWorkbench.getPlatformUI().readAndDispatchEvents()) {
                    Thread.sleep(50);
                }
            } catch (InterruptedException e) {
                log.debug("Task '" + taskName + "' was interrupted");
                break;
            }
        }

        return monitoringTask.finished;
    }

    public static String executeProcess(String binPath, String ... args) throws DBException {
        try {
            String[] cmdBin = {binPath};
            String[] cmd = args == null ? cmdBin : ArrayUtils.concatArrays(cmdBin, args);
            Process p = Runtime.getRuntime().exec(cmd);
            try {
                StringBuilder out = new StringBuilder();
                readStringToBuffer(p.getInputStream(), out);

                if (out.length() == 0) {
                    StringBuilder err = new StringBuilder();
                    readStringToBuffer(p.getErrorStream(), err);
                    return err.toString();
                }

                return out.length() == 0 ? null: out.toString();
            } finally {
                p.destroy();
            }
        }
        catch (Exception ex) {
            throw new DBException("Error executing process " + binPath, ex);
        }
    }

    private static void readStringToBuffer(InputStream is, StringBuilder out) throws IOException {
        try (BufferedReader input = new BufferedReader(new InputStreamReader(is))) {
            for (;;) {
                String line = input.readLine();
                if (line == null) {
                    break;
                }
                if (out.length() > 0) {
                    out.append("\n");
                }
                out.append(line);
            }
        }
    }

    public static boolean isWindows() {
        return IS_WINDOWS;
    }

    public static boolean isMacOS() {
        return IS_MACOS;
    }

    public static boolean isLinux() {
        return IS_LINUX;
    }

    public static void setThreadName(String name) {
        Thread.currentThread().setName("DBeaver: " + name);
    }

    public static byte[] getLocalMacAddress() throws IOException {
        InetAddress localHost = InetAddress.getLocalHost();
        NetworkInterface ni = NetworkInterface.getByInetAddress(localHost);
        if (ni == null) {
            Enumeration<NetworkInterface> niEnum = NetworkInterface.getNetworkInterfaces();
            if (niEnum.hasMoreElements()) {
                ni = niEnum.nextElement();
            }
        }
        return ni == null ? NULL_MAC_ADDRESS : ni.getHardwareAddress();
    }

    /**
     * Splits command line string into a list of separate arguments,
     * respecting quoted strings and escaped characters, similar to
     * how terminals do that.
     *
     * @param input            input string to be split
     * @param escapesSupported whether escapes using {@code \} are supported or not
     * @return a list of separate, unquoted arguments
     */
    @NotNull
    public static List<String> splitCommandLine(@NotNull String input, boolean escapesSupported) {
        final List<String> arguments = new ArrayList<>();
        final StringBuilder argument = new StringBuilder();
        CommandLineState state = CommandLineState.NONE;
        boolean escaped = false;

        for (int index = 0; index < input.length(); index++) {
            final char ch = input.charAt(index);
            final char quote = state == CommandLineState.SINGLE_QUOTE ? '\'' : '"';

            if (escaped) {
                argument.append(ch);
                escaped = false;
                continue;
            }

            switch (state) {
                case NONE:
                case NORMAL:
                    if (ch == '\'') {
                        state = CommandLineState.SINGLE_QUOTE;
                    } else if (ch == '"') {
                        state = CommandLineState.DOUBLE_QUOTE;
                    } else {
                        if (ch == '\\' && escapesSupported) {
                            escaped = true;
                            state = CommandLineState.NORMAL;
                        } else if (!Character.isWhitespace(ch)) {
                            argument.append(ch);
                            state = CommandLineState.NORMAL;
                        } else if (state == CommandLineState.NORMAL) {
                            arguments.add(argument.toString());
                            argument.setLength(0);
                            state = CommandLineState.NONE;
                        }
                    }
                    break;
                case SINGLE_QUOTE:
                case DOUBLE_QUOTE:
                    if (ch == '\\' && escapesSupported) {
                        final char next = input.charAt(++index);
                        if (next != quote && next != '\\') {
                            argument.append(ch);
                        }
                        argument.append(next);
                    } else if (ch == quote) {
                        state = CommandLineState.NORMAL;
                        break;
                    } else {
                        argument.append(ch);
                    }
                    break;
                default:
                    break;
            }
        }

        if (escaped) {
            argument.append('\\');
            arguments.add(argument.toString());
        } else if (state != CommandLineState.NONE) {
            arguments.add(argument.toString());
        }

        return arguments;
    }

    private enum CommandLineState {
        NONE,
        NORMAL,
        SINGLE_QUOTE,
        DOUBLE_QUOTE
    }

    private static class MonitoringTask implements DBRRunnableWithProgress {
        private final DBRRunnableWithProgress task;
        private DBRProgressMonitor monitor;
        volatile boolean finished;

        private MonitoringTask(DBRRunnableWithProgress task) {
            this.task = task;
        }

        public boolean isFinished() {
            return finished;
        }

        @Override
        public void run(DBRProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            this.monitor = monitor;
            try {
                task.run(monitor);
            } finally {
                finished = true;
            }
        }
    }
}


text:
<?php

class EnviMemcacheSession extends EnviSessionBase implements EnviSessionInterface
{

    protected static $_is_login   = '_is_login';
    protected static $_is_gzip    = true;
    protected static $_session_id = null;

    public function sessionStart()
    {
        $this->sess_base_save_path = $this->_system_conf['SESSION']['sess_base_save_path'];
        $session_name              = $this->_system_conf['SESSION']['cookie_name'];
        session_name($session_name);

        $is_new_session = true;
        //セッションIDの正誤性をチェックする。
        if (isset($_COOKIE[$session_name])) {
            $key  = $_COOKIE[$session_name];
            if (EnviMemcache::has($key, 'session', self::$_is_gzip)) {
                $is_new_session = false;
            }
        }
        if ($is_new_session) {
            $i = 0;
            while ($i++ < 30) {
                $key = self::newSession();
                if (!EnviMemcache::has($key, 'session', self::$_is_gzip)) {
                    break;
                }
            }
            if ($i >= 30) {
                throw new EnviException('do not start session');
            }
        }
        //セッション開始
        self::$_session_id = $key;
        EnviMemcache::set($key, serialize(array()), $this->_system_conf['SESSION']['cookie_lifetime'], 'session', self::$_is_gzip);
        setcookie(session_name(), $key, $_SERVER['REQUEST_TIME'] + $this->_system_conf['SESSION']['cookie_lifetime'], '/');
    }

    public function open($save_path, $session_name)
    {
        return true;
    }

    public function close()
    {
        return true;
    }

    public function read($key)
    {
        return unserialize(EnviMemcache::get($key, 'session', self::$_is_gzip));
    }

    public function write($key, $value)
    {
        return EnviMemcache::set($key, serialize($value), $this->_system_conf['SESSION']['cookie_lifetime'], 'session', self::$_is_gzip);
    }

    public function destroy($key)
    {
        return EnviMemcache::delete($key, 'session');
    }

    public function gc($maxlifetime)
    {
        return true;
    }

    public function setAttribute($key, $value, $expire = 3600)
    {
        $key = self::generateKey($key);
        return EnviMemcache::set($key, serialize($value), $expire, 'session', self::$_is_gzip);
    }

    public function getAttribute($key)
    {
        $key = self::generateKey($key);
        return unserialize(EnviMemcache::get($key, 'session', self::$_is_gzip));
    }

    public function hasAttribute($key)
    {
        $key = self::generateKey($key);
        return EnviMemcache::has($key, 'session', self::$_is_gzip);
    }

    public function login()
    {
        $key = self::generateKey(self::$_is_login);
        return EnviMemcache::set($key, serialize(true), $this->_system_conf['SESSION']['cookie_lifetime'], 'session', self::$_is_gzip);
    }
    public function logout()
    {
        $key = self::generateKey(self::$_is_login);
        EnviMemcache::delete($key, 'session');
    }
    public function isLogin()
    {
        $key = self::generateKey(self::$_is_login);
        return EnviMemcache::get($key, 'session', self::$_is_gzip);
    }

    public function removeAttribute($key)
    {
        $key = self::generateKey($key);
        return EnviMemcache::delete($key, 'session');
    }

    public function cleanAttributes()
    {
    }

    public static function generateKey($key)
    {
        static $key_gen;
        if (!isset($key_gen)) {
            $key_gen = self::$_session_id;
        }
        return $key_gen.'-'.$key;
    }
}


text:
using System;

namespace Torch.Utils
{
    /// <summary>
    /// Indicates that this field should contain the <see cref="System.Reflection.FieldInfo"/> instance for the given field.
    /// </summary>
    [AttributeUsage(AttributeTargets.Field)]
    public class ReflectedFieldInfoAttribute : ReflectedMemberAttribute
    {
        /// <summary>
        /// Creates a reflected field info attribute using the given type and name.
        /// </summary>
        /// <param name="type">Type that contains the member</param>
        /// <param name="name">Name of the member</param>
        public ReflectedFieldInfoAttribute(Type type, string name)
        {
            Type = type;
            Name = name;
        }
    }
}


text:
(function(){
    var lasts = ['Jones', 'Smith', 'Lee', 'Wilson', 'Black', 'Williams', 'Lewis', 'Johnson', 'Foot', 'Little', 'Vee', 'Train', 'Hot', 'Mutt'];
    var firsts = ['Fred', 'Julie', 'Bill', 'Ted', 'Jack', 'John', 'Mark', 'Mike', 'Chris', 'Bob', 'Travis', 'Kelly', 'Sara'];
    var lastLen = lasts.length, firstLen = firsts.length;

    Ext.ux.getRandomInt = function(min, max){
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    Ext.ux.generateName = function(){
        var name = firsts[Ext.ux.getRandomInt(0, firstLen-1)] + ' ' + lasts[Ext.ux.getRandomInt(0, lastLen-1)];
        if(Ext.ux.generateName.usedNames[name]){
            return Ext.ux.generateName();
        }
        Ext.ux.generateName.usedNames[name] = true;
        return name;
    }
    Ext.ux.generateName.usedNames = {};

})();


text:
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
NicknameOfTheWeek::Application.initialize!


text:
<?php

namespace PhilMareu\Laramanager\FieldTypes;

class MarkdownFieldType extends FieldType
{

}


text:
layout: doc-page.html
---

# Frequently asked questions

There are a couple of questions we have been asked over and over again…

## Does ally.js support Internet Explorer 8 and below?

The short answer is *no*. IE8 is too far behind on various APIs to make the existing code work. Additionally, our test system [Intern](https://theintern.github.io/) does not run on IE8. Also [Microsoft ended support for IE8 in January 2016](https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support).

While ally.js has not been tested to *run* on IE8, we have made sure that it can be *loaded* without problems. Since ally.js is compiled to ES5, you will need to load the [es5-shim](https://github.com/es-shims/es5-shim/) in IE8:

```html
<!--[if lt IE 9]>
  <script src="node_modules/es5-shim/es5-shim.js"></script>
  <script src="node_modules/es5-shim/es5-sham.js"></script>
<![endif]-->
```

## Do I need ally.js for static websites?

Probably not. If you don't have any interactive widgets on your site, chances are ally.js is not going to do you much good. Except for maybe help [get around some non-JavaScript accessibility issues across browsers](api/README.md#countering-browser-bugs).

## "ally" not "a11y"?

When the project started in October 2014, it was called "a11y.js". We didn't register any domains or grabbed the npm package name - which turned out to be a problem a couple of weeks later. We're not sad this happened.

"ally" ([phonetic](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) `ælaj`) is easier to pronounce than "a11y" (phonetic `ə əlɛvən waj`). "a11y" is a [numeronym](https://en.wikipedia.org/wiki/Numeronym) and expands to "accessibility". "ally" has a number of [definitions](http://dictionary.reference.com/browse/ally) ranging from "friend" to "cooperating", which has a much nicer tone to it.

## Why was this created?

While trying to learn accessibility in general and keyboard navigation in particular, it became obvious that the web was not making things very easy. Tutorials were missing important pieces - coherence and a focus on the developer usually wasn't a thing. Examples looked like their JavaScript was written in the 90s, or depended on jQuery, or simply skipped the meaty parts.

We weren't able to use any of the existing solutions. We also weren't going to just copy paste other people's code into our applications and let the cycle repeat. We wanted to create the basis for accessibility experts and web developers to *collaborate* in a way that might help everyone.

## Ultimate goal?

In theory the ultimate goal for ally.js is to make itself obsolete because web standards and browser implementations have caught up. This isn't very likely to happen any time soon, if at all. In the meanwhile the goal is to provide all the low-level utilities required for other libraries and websites and applications to make accessible experiences an easier target. Have a look at [GOALS.md](https://github.com/medialize/ally.js/tree/master/GOALS.md) to find out what we're planning.

## Corporate backing?

As of today ally.js does not receive official funding or guidance from anyone. The project is maintained by people volunteering their spare time.

## Multiple personality disorder?

Most of the documentation was written from a group perspective ("we have done…"), but some statements are personal ("I have done"). I have gone with the group voice, because I hope it won't take long for others to join the project. That said, while I have *created* most of the resources so far, many people have been involved in figuring out how to do things.


text:
    For new Admins you can send an email invite so they can set their own password, or set a password for them now.

            <input type="checkbox" data-ng-model="sendEmailOnCreate" data-ng-checked="sendEmailOnCreate" />
            Send Email Invite

            Confirmed: Yes

            Confirmed: No

            <button type="button" class="btn btn-default" data-ng-click="invite()"> Send Invite</button>


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="#aaa" android:state_pressed="true" />
    <item android:color="#ffffffff" />
</selector>


text:
var connect = require('..');

var app = connect();
app.use(connect.directory('.'));

describe('directory()', function(){
  describe('when Accept: application/json is given', function(){
    it('should respond with json', function(done){
      app.request()
      .get('/')
      .set('Accept', 'application/json')
      .end(function(res){
        var arr = JSON.parse(res.body);
        arr.should.include('lib');
        arr.should.include('node_modules');
        arr.should.include('docs');
        arr.should.include('Readme.md');
        done();
      });
    })
  })

  describe('when Accept: text/html is given', function(){
    it('should respond with json', function(done){
      app.request()
      .get('/')
      .set('Accept', 'text/html')
      .end(function(res){
        res.body.should.include('<a href="/lib"');
        res.body.should.include('<a href="/package.json"');
        done();
      });
    })
  })

  describe('when Accept: text/plain is given', function(){
    it('should respond with text', function(done){
      app.request()
      .get('/')
      .set('Accept', 'text/plain')
      .end(function(res){
        res.body.should.include('lib')
        res.body.should.include('docs')
        done();
      });
    })
  })
})


text:
package org.locationtech.geowave.core.index.sfc.zorder;

import java.util.Arrays;
import java.util.BitSet;
import org.locationtech.geowave.core.index.numeric.NumericRange;
import org.locationtech.geowave.core.index.sfc.SFCDimensionDefinition;

/**
 * Convenience methods used to decode/encode Z-Order space filling curve values (using a simple
 * bit-interleaving approach).
 */
public class ZOrderUtils {
  public static NumericRange[] decodeRanges(
      final byte[] bytes,
      final int bitsPerDimension,
      final SFCDimensionDefinition[] dimensionDefinitions) {
    final byte[] littleEndianBytes = swapEndianFormat(bytes);
    final BitSet bitSet = BitSet.valueOf(littleEndianBytes);
    final NumericRange[] normalizedValues = new NumericRange[dimensionDefinitions.length];
    for (int d = 0; d < dimensionDefinitions.length; d++) {
      final BitSet dimensionSet = new BitSet();
      int j = 0;
      for (int i = d; i < (bitsPerDimension * dimensionDefinitions.length); i +=
          dimensionDefinitions.length) {
        dimensionSet.set(j++, bitSet.get(i));
      }

      normalizedValues[d] = decode(dimensionSet, 0, 1, dimensionDefinitions[d]);
    }

    return normalizedValues;
  }

  public static long[] decodeIndices(
      final byte[] bytes,
      final int bitsPerDimension,
      final int numDimensions) {
    final byte[] littleEndianBytes = swapEndianFormat(bytes);
    final BitSet bitSet = BitSet.valueOf(littleEndianBytes);
    final long[] coordinates = new long[numDimensions];
    final long rangePerDimension = (long) Math.pow(2, bitsPerDimension);
    for (int d = 0; d < numDimensions; d++) {
      final BitSet dimensionSet = new BitSet();
      int j = 0;
      for (int i = d; i < (bitsPerDimension * numDimensions); i += numDimensions) {
        dimensionSet.set(j++, bitSet.get(i));
      }

      coordinates[d] = decodeIndex(dimensionSet, rangePerDimension);
    }

    return coordinates;
  }

  private static long decodeIndex(final BitSet bs, final long rangePerDimension) {
    long floor = 0;
    long ceiling = rangePerDimension;
    long mid = 0;
    for (int i = 0; i < bs.length(); i++) {
      mid = (floor + ceiling) / 2;
      if (bs.get(i)) {
        floor = mid;
      } else {
        ceiling = mid;
      }
    }
    return mid;
  }

  private static NumericRange decode(
      final BitSet bs,
      double floor,
      double ceiling,
      final SFCDimensionDefinition dimensionDefinition) {
    double mid = 0;
    for (int i = 0; i < bs.length(); i++) {
      mid = (floor + ceiling) / 2;
      if (bs.get(i)) {
        floor = mid;
      } else {
        ceiling = mid;
      }
    }
    return new NumericRange(
        dimensionDefinition.denormalize(floor),
        dimensionDefinition.denormalize(ceiling));
  }

  public static byte[] encode(
      final double[] normalizedValues,
      final int bitsPerDimension,
      final int numDimensions) {
    final BitSet[] bitSets = new BitSet[numDimensions];

    for (int d = 0; d < numDimensions; d++) {
      bitSets[d] = getBits(normalizedValues[d], 0, 1, bitsPerDimension);
    }
    final int usedBits = bitsPerDimension * numDimensions;
    final int usedBytes = (int) Math.ceil(usedBits / 8.0);
    final int bitsetLength = (usedBytes * 8);
    final int bitOffset = bitsetLength - usedBits;
    // round up to a bitset divisible by 8
    final BitSet combinedBitSet = new BitSet(bitsetLength);
    int j = bitOffset;
    for (int i = 0; i < bitsPerDimension; i++) {
      for (int d = 0; d < numDimensions; d++) {
        combinedBitSet.set(j++, bitSets[d].get(i));
      }
    }
    final byte[] littleEndianBytes = combinedBitSet.toByteArray();
    final byte[] retVal = swapEndianFormat(littleEndianBytes);
    if (retVal.length < usedBytes) {
      return Arrays.copyOf(retVal, usedBytes);
    }
    return retVal;
  }

  public static byte[] swapEndianFormat(final byte[] b) {
    final byte[] endianSwappedBytes = new byte[b.length];
    for (int i = 0; i < b.length; i++) {
      endianSwappedBytes[i] = swapEndianFormat(b[i]);
    }
    return endianSwappedBytes;
  }

  private static byte swapEndianFormat(final byte b) {
    int converted = 0x00;
    converted ^= (b & 0b1000_0000) >> 7;
    converted ^= (b & 0b0100_0000) >> 5;
    converted ^= (b & 0b0010_0000) >> 3;
    converted ^= (b & 0b0001_0000) >> 1;
    converted ^= (b & 0b0000_1000) << 1;
    converted ^= (b & 0b0000_0100) << 3;
    converted ^= (b & 0b0000_0010) << 5;
    converted ^= (b & 0b0000_0001) << 7;
    return (byte) (converted & 0xFF);
  }

  private static BitSet getBits(
      final double value,
      double floor,
      double ceiling,
      final int bitsPerDimension) {
    final BitSet buffer = new BitSet(bitsPerDimension);
    for (int i = 0; i < bitsPerDimension; i++) {
      final double mid = (floor + ceiling) / 2;
      if (value >= mid) {
        buffer.set(i);
        floor = mid;
      } else {
        ceiling = mid;
      }
    }
    return buffer;
  }
}


text: Solution to the Cryptographer's Conundrum programming puzzle as seen on Kattis


text:
package edu.gvsu.cis.campbjos.emulsify;

import android.content.Context;
import android.graphics.Bitmap;
import android.widget.ImageView;
import org.opencv.android.Utils;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Scalar;

/**
 * Created by Reuben on 3/23/14.
 */
public class PictureScrollElement extends ImageView {
    private String filename;
    private boolean isBoxed = false;
    private Mat image;

    private int width, height, density;

    public PictureScrollElement(Context context) {
        super(context);
    }

    public void initialize(String filepath, Mat image) {
        filename = filepath;
        this.image = image;
        Bitmap im = Bitmap.createBitmap(image.cols(), image.rows(), Bitmap.Config.ARGB_8888);
        Utils.matToBitmap(image, im);
        setImageBitmap(im);

        width = image.cols();
        height = image.rows();
    }

    public void box() {
        Mat boxedImage = image.clone();
        Core.rectangle(boxedImage, new Point(2, 2), new Point(boxedImage.cols() - 2, boxedImage.rows() - 2), new Scalar(255, 0, 0, 1), 3);

        Bitmap im = Bitmap.createBitmap(image.cols(), image.rows(), Bitmap.Config.ARGB_8888);
        Utils.matToBitmap(boxedImage, im);//boxedImage, im);
        setImageBitmap(im);

        isBoxed = true;
    }

    public void boxPermanently() {
        //the stored image is being modified here! data being altered permanently!
        Core.rectangle(image, new Point(5, 5), new Point(image.cols() - 5, image.rows() - 5), new Scalar(0, 0, 255, 1), 3);
        Bitmap im = Bitmap.createBitmap(image.cols(), image.rows(), Bitmap.Config.ARGB_8888);
        Utils.matToBitmap(image, im);
        setImageBitmap(im);
    }

    public void unBox() {
        Bitmap im = Bitmap.createBitmap(image.cols(), image.rows(), Bitmap.Config.ARGB_8888);
        Utils.matToBitmap(image, im);
        setImageBitmap(im);

        isBoxed = false;
    }

    public boolean isBoxed() {
        return isBoxed;
    }

    public String getFile() {
        return filename;
    }

    public int getWdth() {
        return width;
    }

    public int getHght() {
        return height;
    }

    public void setDensity(int density) {
        this.density = density;
    }

    public int getDensity() {
        return density;
    }
}


text:
package deployer

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/cloudformation"
	"github.com/aws/aws-sdk-go/service/s3/s3manager"
	"github.com/bernos/cfn-deploy/cfndeploy/uploader"
	"testing"
)

var (
	defaultBucket       = "seek-candidate-cfn-templates-test"
	defaultPrefix       = "deployer-test"
	defaultBucketFolder = "bucket-folder"
	defaultStackName    = "cfn-deploy-test-stack"
)

func TestDeploy(t *testing.T) {
	sess := session.New(&aws.Config{Region: aws.String("ap-southeast-2")})
	s3 := s3manager.NewUploader(sess)
	cw := cloudformation.New(sess)
	u := uploader.New(s3)
	d := New(cw, u)

	o := &DeployOptions{
		Bucket:         defaultBucket,
		BucketFolder:   defaultBucketFolder,
		StackName:      defaultStackName,
		TemplateFolder: "./test-fixtures/templates/valid",
		MainTemplate:   "Stack.json",
	}

	err := d.Deploy(o)

	if err != nil {
		t.Errorf("Error: %s", err.Error())
	}
}

func TestCalculateBucketPrefix(t *testing.T) {
	tests := []struct {
		bucketFolder string
		stackName    string
		version      string
		want         string
	}{
		{"foo", "stack", "123", "foo/stack/123"},
		{"", "stack", "123", "stack/123"},
	}

	for _, tt := range tests {
		got := calculateBucketPrefix(tt.stackName, tt.bucketFolder, tt.version)

		if got != tt.want {
			t.Errorf("Want %s, got %s", tt.want, got)
		}
	}
}

func TestBaseURL(t *testing.T) {
	tests := []struct {
		url  string
		want string
	}{
		{"http://example.com/foo/bar/baz.txt", "http://example.com/foo/bar/"},
		{"http://example.com/foo.txt", "http://example.com/"},
	}

	for _, tt := range tests {
		got := baseURL(tt.url)

		if got != tt.want {
			t.Errorf("Want %s, got %s", tt.want, got)
		}
	}
}

func TestChecksumTemplates(t *testing.T) {
	files, _ := findTemplates("./test-fixtures/templates/valid")
	// files = append(files, "bogman")
	sum, _ := checksumTemplates(files)
	t.Error(sum)
}


text:
import React from 'react';
import moment from 'moment';
import classnames from 'classnames';
import { safeInvoke } from 'js-utility-belt/es6';

import AssetActionPanel from '../../../lib/js/react/components/asset_action_panel';
import AssetDetail from '../../../lib/js/react/components/asset_detail';

import inBacklog from '../../../lib/js/utils/bigchaindb/in_backlog';

const AssetRow = React.createClass({
    propTypes: {
        account: React.PropTypes.object.isRequired,
        asset: React.PropTypes.object.isRequired,
        accountList: React.PropTypes.array,
        actionMap: React.PropTypes.object,
        handleAccountClick: React.PropTypes.func,
        handleAssetClick: React.PropTypes.func,
        isActive: React.PropTypes.bool
    },

    getDefaultProps() {
        return {
            actionMap: {
                'single-owner-transfer': {
                    actionName: 'ESCROW',
                    actionMessage: 'Escrow asset with:',
                    selectAccounts: true
                },
                'multi-owner-execute': {
                    actionName: 'EXECUTE',
                    actionMessage: 'Execute escrow of asset:',
                    selectAccounts: false
                },
                'multi-owner-abort': {
                    actionName: 'ABORT',
                    actionMessage: 'Abort escrow of asset:',
                    selectAccounts: false
                }
            }
        };
    },

    getInitialState() {
        return {
            connectors: null,
            expiresIn: null
        };
    },

    componentDidMount() {
        if (this.getOperation() !== 'transfer') {
            this.intervalId = window.setInterval(this.setExpiryTime, 1000);
        }
    },

    componentWillUnmount() {
        window.clearInterval(this.intervalId);
    },

    setExpiryTime() {
        const {
            asset
        } = this.props;
        const expires = moment.unix(parseFloat(asset.expiryTime));
        const expiresIn = moment.utc(expires.diff(moment.utc()));
        this.setState({
            expiresIn: expiresIn > 0 ? expiresIn : -1
        });
    },

    handleAssetClick() {
        const {
            account,
            handleAccountClick,
            asset,
            handleAssetClick
        } = this.props;

        safeInvoke(handleAssetClick, asset);
        safeInvoke(handleAccountClick, account);
    },

    handleDestinationAccountSelection(destinationAccount) {
        const {
            account,
            asset
        } = this.props;

        account.ledger.getConnectors().then((res) => {
            this.setState({
                connectors: res.connectors
            });
        });

        // quoting should happen here
        // const quotes = connectors.map((connector) => connector.getQuote(asset, destinationAccount));
    },

    handleActionClick(selectedAccount) {
        const {
            connectors
        } = this.state;

        const {
            account,
            asset
        } = this.props;

        const idToTransfer = {
            txid: asset.id,
            cid: 0
        };

        if (asset.type === 'single-owner') {
            const transfer = {
                account: selectedAccount.ledger.id === account.ledger.id ?
                    selectedAccount : connectors[0],
                asset: idToTransfer,
                destinationAccount: selectedAccount,
                executionCondition: 'cc:0:3:47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU:0',
                expiresAt: moment().unix() + 100
            };

            account.ledger.send(transfer);
        } else if (asset.type === 'multi-owner') {
            const transfer = {
                account,
                asset: idToTransfer
            };
            if (this.getOperation() === 'execute') {
                const conditionFulfillment = 'cf:0:';
                account.ledger.fulfillCondition(transfer, conditionFulfillment);
            } else {
                account.ledger.fulfillCondition(transfer);
            }
        }
    },

    getOperation() {
        const {
            account,
            asset
        } = this.props;

        let operation = 'transfer';
        if (asset.hasOwnProperty('executeCondition') &&
            account.vk === asset.executeCondition.public_key) {
            operation = 'execute';
        } else if (asset.hasOwnProperty('abortCondition') &&
            account.vk === asset.abortCondition.public_key) {
            operation = 'abort';
        }
        return operation;
    },

    render() {
        const {
            account,
            accountList,
            actionMap,
            asset,
            isActive
        } = this.props;

        const {
            expiresIn
        } = this.state;

        const assetInBacklog = inBacklog(asset);
        const operation = this.getOperation();

        let actionsPanel = null;
        if (isActive && accountList && !assetInBacklog) {
            const actionType = actionMap[`${asset.type}-${operation}`];
            actionsPanel = (
                <AssetActionPanel
                    accountList={accountList}
                    actionMessage={actionType.actionMessage}
                    actionName={actionType.actionName}
                    activeAccount={account}
                    handleAccountSelection={this.handleDestinationAccountSelection}
                    handleActionClick={this.handleActionClick}
                    selectAccounts={actionType.selectAccounts} />
            );
        }

        let escrowDetails = null;
        if (expiresIn) {
            const isExpired = expiresIn === -1;
            escrowDetails = (
                <div className={classnames('asset-escrow-details', { isExpired })}>
                    {isExpired ? 'EXPIRED' : `Expires in ${expiresIn.format('HH:mm:ss')}`}
                </div>
            );
        }

        return (
            <div
                onClick={this.handleAssetClick}
                style={{ outline: 'none' }}
                tabIndex={0}>
                <AssetDetail
                    asset={asset}
                    className={classnames({ inBacklog: assetInBacklog })}
                    inBacklog={assetInBacklog}>
                    {escrowDetails}
                    {actionsPanel}
                </AssetDetail>
            </div>
        );
    }
});

export default AssetRow;


text:
@charset "UTF-8";

/* CSS Document */
@media only screen and (max-width: 480px) {

#gcfr-futureEventsColumn, #gcfr-pastEventsColumn {
	display: block;
	float: left;
	width: 100%;
	padding: 1em;
	margin: 0;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	overflow: hidden
}

#gcfr-futureEventsColumn, #gcfr-pastEventsColumn {
	clear: both
}

#gcfr-pastEventsColumn {
	border-top: 8px solid #CCC
}
}

@media only screen and (min-width: 481px) {

#gcfr-futureEventsColumn, #gcfr-pastEventsColumn {
	display: block;
	float: left;
	width: 50%;
	padding: 1em;
	margin: 0;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
	overflow: hidden
}

#gcfr-futureEventsColumn {
	clear: both
}

#gcfr-pastEventsColumn {
	clear: none
}
}

div.gCalFeedReader {
	display: block;
	float: left;
	width: 100%;
	padding: 0;
	margin: 0;
}

.gcfr-allEventsWrapper {
	display: none;
	float: left;
	clear: both;
	width: 100%;
	padding: 0;
	margin: 0
}

.gcfr-eventTitle, .gcfr-eventDate, .gcfr-eventLocation, .gcfr-eventDescription, .gcfr-loaderWrapper, .gcfr-eventsListWrapper {
	word-wrap: break-word;
	float: left;
	clear: both;
	width: 100%;
	padding: 0;
	margin: 0
}

ul.gcfr-eventsList {
	float: left;
	width: 100%;
	padding: 0;
	margin: 0;
	list-style: none
}

ul.gcfr-eventsList li {
	float: left;
	width: 100%;
	padding-top: 0;
	border-top: 1px solid #ccc
}

ul.gcfr-eventsList li:first-child {
	padding-top: 0;
	border-top: none
}

.gcfr-eventLocation .fa-map-marker {
	margin-left: .5em
}

/*! "loading..." text animation */
p.gcfr-loader {
	text-align: center;
	font-weight: 700
}
@-webkit-keyframes opacity {
 0% {
opacity:1
}
100% {
opacity:0
}
}
@-moz-keyframes opacity {
 0% {
opacity:1
}
100% {
opacity:0
}
}

p.gcfr-loader span {
	-webkit-animation-name: opacity;
	-webkit-animation-duration: 1s;
	-webkit-animation-iteration-count: infinite;
	-moz-animation-name: opacity;
	-moz-animation-duration: 1s;
	-moz-animation-iteration-count: infinite
}

p.gcfr-loader span:nth-child(2) {
	-webkit-animation-delay: 100ms;
	-moz-animation-delay: 100ms
}

p.gcfr-loader span:nth-child(3) {
	-webkit-animation-delay: 300ms;
	-moz-animation-delay: 300ms
}


text:
/*
 * CBaseUIContainerBox.h
 *
 *  Created on: Jun 1, 2017
 *      Author: Psy
 */

#ifndef GUI_CBASEUICONTAINERBOX_H_
#define GUI_CBASEUICONTAINERBOX_H_

#include "CBaseUIContainerBase.h"

class CBaseUIContainerBox : public CBaseUIContainerBase
{
public:
	CBaseUIContainerBox(float xPos=0, float yPos=0, UString name="");
	virtual ~CBaseUIContainerBox();

	CONTAINER_BODY(CBaseUIContainerBox)

protected:
	virtual void updateLayout();
	virtual void updateElement(CBaseUIElement *element);

};

#endif /* GUI_CBASEUICONTAINERBOX_H_ */


text:
function setLanguage(obj,lang)
    if(~exist('lang','var') || ~ischar(lang))
        disp('Illeagle Input. Require "string" input type.');
        return;
    end
    for tlang = MOSS.allowedLanguages
        tlang = tlang{1};
        if(strcmpi(lang,tlang))
            obj.options.l = tlang;
            fprintf('New language set to: %s\n',tlang);
            return;
        end
    end
    disp('Not an allowed language!');
end


text:
package com.haulmont.cuba.core;

import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.haulmont.cuba.core.sys.AppContext;
import com.haulmont.cuba.security.ConstraintTest;
import com.haulmont.cuba.security.entity.*;
import com.haulmont.cuba.testsupport.TestContainer;
import com.haulmont.cuba.testsupport.TestSupport;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.Test;

import javax.persistence.FlushModeType;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.UUID;

import static org.junit.jupiter.api.Assertions.*;

public class QueryTest {

    @RegisterExtension
    public static TestContainer cont = TestContainer.Common.INSTANCE;

    private UUID userId;
    private UUID user2Id;
    private UUID groupId;
    private UUID constraintId;

    @BeforeEach
    public void setUp() throws Exception {

        try (Transaction tx = cont.persistence().createTransaction()) {
            EntityManager em = cont.persistence().getEntityManager();

            User user = new User();
            userId = user.getId();
            user.setName("testUser");
            user.setLogin("testLogin");
            user.setGroup(em.find(Group.class, UUID.fromString("0fa2b1a5-1d68-4d69-9fbd-dff348347f93")));
            em.persist(user);

            user = new User();
            user2Id = user.getId();
            user.setName("testUser2");
            user.setLogin("testLogin2");
            user.setGroup(em.find(Group.class, UUID.fromString("0fa2b1a5-1d68-4d69-9fbd-dff348347f93")));
            em.persist(user);

            Group group = new Group();
            groupId = group.getId();
            group.setName("testGroup");
            em.persist(group);

            Constraint constraint = new Constraint();
            constraintId = constraint.getId();
            constraint.setEntityName("sec$User");
            constraint.setCheckType(ConstraintCheckType.MEMORY);
            constraint.setOperationType(ConstraintOperationType.READ);
            em.persist(constraint);

            tx.commit();
        }
    }

    @AfterEach
    public void tearDown() throws Exception {
        cont.deleteRecord("SEC_USER", userId, user2Id);
        cont.deleteRecord("SEC_GROUP", groupId);
        cont.deleteRecord("SEC_CONSTRAINT", constraintId);
    }

    @Test
    public void test() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            User user = em.find(User.class, UUID.fromString("60885987-1b61-4247-94c7-dff348347f93"));

            Query query = em.createQuery("select r from sec$UserRole r where r.user = :user");
            query.setParameter("user", user);
            List list = query.getResultList();

            assertFalse(list.isEmpty());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testNullParam() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Query query = em.createQuery("select r from sec$UserRole r where r.deleteTs = :dts");
            query.setParameter("dts", null);
            List list = query.getResultList();

            assertFalse(list.isEmpty());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testUpdate() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Group group = em.find(Group.class, groupId);

            Query query = em.createQuery("update sec$User u set u.group = :group where u.id = :userId");
            query.setParameter("userId", userId);
            query.setParameter("group", group, false);
            query.executeUpdate();

            tx.commit();
        } finally {
            tx.end();
        }
    }

// This test doesn't pass for some unclarified reason.
//
//    public void testFlushBeforeUpdate() {
//        Transaction tx = cont.persistence().createTransaction();
//        try {
//            EntityManager em = cont.persistence().getEntityManager();
//
//            Group group = em.find(Group.class, groupId);
//            User user = em.find(User.class, userId);
//            assertNotNull(user);
//            user.setName("newName");
//
//            Query query = em.createQuery("update sec$User u set u.group = :group where u.id = :userId");
//            query.setParameter("userId", userId);
//            query.setParameter("group", group, false);
//            query.executeUpdate();
//
//            tx.commit();
//        } finally {
//            tx.end();
//        }
//
//        tx = cont.persistence().createTransaction();
//        try {
//            EntityManager em = cont.persistence().getEntityManager();
//            User user = em.find(User.class, userId);
//            assertNotNull(user);
//            assertEquals(groupId, user.getGroup().getId());
//            assertEquals("newName", user.getName());
//
//            tx.commit();
//        } finally {
//            tx.end();
//        }
//    }

    @Test
    public void testAssociatedResult() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Query query = em.createQuery("select u.group from sec$User u where u.id = :userId");
            query.setParameter("userId", userId);
            List list = query.getResultList();

            assertFalse(list.isEmpty());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testIgnoreChanges() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            TypedQuery<User> query;
            List<User> list;

            query = em.createQuery("select u from sec$User u where u.name = ?1", User.class);
            query.setParameter(1, "testUser");
            list = query.getResultList();
            assertEquals(1, list.size());
            User user = list.get(0);

            user.setName("newName");

            query = em.createQuery("select u from sec$User u where u.name = ?1", User.class);
            query.setParameter(1, "testUser");
            list = query.getResultList();
            assertEquals(1, list.size());
            User user1 = list.get(0);

            assertTrue(user1 == user);

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testFlushModeAuto() throws Exception {
        try (Transaction tx = cont.persistence().createTransaction()) {
            EntityManager em = cont.persistence().getEntityManager();

            TypedQuery<User> query;
            List<User> list;

            query = em.createQuery("select u from sec$User u where u.name = ?1", User.class);
            query.setParameter(1, "testUser");
            list = query.getResultList();
            assertEquals(1, list.size());
            User user = list.get(0);

            user.setName("newName");

            query = em.createQuery("select u from sec$User u where u.name = ?1", User.class);
            query.setParameter(1, "newName");
            query.setFlushMode(FlushModeType.AUTO);
            list = query.getResultList();
            assertEquals(1, list.size());
            User user1 = list.get(0);

            assertTrue(user1 == user);

            tx.commit();
        }
    }

    @Test
    public void testNativeQueryIgnoreChanges() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            TypedQuery<User> query;
            List<User> list;

            query = em.createNativeQuery("select * from SEC_USER where NAME = ?1", User.class);
            query.setParameter(1, "testUser");
            list = query.getResultList();
            assertEquals(1, list.size());
            User user = list.get(0);

            user.setName("newName");

            query = em.createNativeQuery("select * from SEC_USER where NAME = ?1", User.class);
            query.setParameter(1, "testUser");
            list = query.getResultList();
            assertEquals(1, list.size());
            User user1 = list.get(0);

            assertTrue(user1 == user);

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testNativeQuerySelect() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Query query = em.createNativeQuery("select ID, LOGIN from SEC_USER where NAME = ?1");
            query.setParameter(1, "testUser");
            List list = query.getResultList();
            assertEquals(1, list.size());
            assertTrue(list.get(0) instanceof Object[]);
            Object[] row = (Object[]) list.get(0);
            assertEquals(userId.toString(), row[0]);
            assertEquals("testLogin", row[1]);

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testNativeQueryFlushBeforeUpdate() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Group group = em.find(Group.class, groupId);
            User user = em.find(User.class, userId);
            assertNotNull(user);
            user.setName("newName");

            Query query = em.createNativeQuery("update SEC_USER set GROUP_ID = ?1 where ID = ?2");
            query.setParameter(1, group.getId().toString());
            query.setParameter(2, userId.toString());
            query.executeUpdate();

            tx.commit();
        } finally {
            tx.end();
        }

        tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();
            User user = em.find(User.class, userId);
            assertNotNull(user);
            assertEquals(groupId, user.getGroup().getId());
            assertEquals("newName", user.getName());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testCaseInsensitiveSearch() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            TypedQuery<User> query = cont.persistence().getEntityManager().createQuery(
                    "select u from sec$User u where u.name like :name", User.class);
            query.setParameter("name", "(?i)%user%");
            List<User> list = query.getResultList();
            tx.commit();

            Iterables.find(list, new Predicate<User>() {
                @Override
                public boolean apply(User input) {
                    return input.getId().equals(userId);
                }
            });
        } finally {
            tx.end();
        }

    }

    @Test
    public void testListParameter() throws Exception {
        try (Transaction tx = cont.persistence().createTransaction()) {
            TypedQuery<User> query = cont.persistence().getEntityManager().createQuery(
                    "select u from sec$User u where u.id in :ids order by u.createTs", User.class);
            query.setParameter("ids", Arrays.asList(UUID.fromString("60885987-1b61-4247-94c7-dff348347f93"), userId, user2Id));
            List<User> list = query.getResultList();
            assertEquals(3, list.size());

            tx.commit();
        }

        // Implicit conversion

        User user1, user2, user3;
        try (Transaction tx = cont.persistence().createTransaction()) {
            EntityManager em = cont.persistence().getEntityManager();
            user1 = em.find(User.class, userId);
            user2 = em.find(User.class, user2Id);
            user3 = em.find(User.class, UUID.fromString("60885987-1b61-4247-94c7-dff348347f93"));

            tx.commit();
        }

        try (Transaction tx = cont.persistence().createTransaction()) {
            TypedQuery<User> query = cont.persistence().getEntityManager().createQuery(
                    "select u from sec$User u where u.id in :ids order by u.createTs", User.class);
            query.setParameter("ids", Arrays.asList(user1, user2, user3));
            List<User> list = query.getResultList();
            assertEquals(3, list.size());

            tx.commit();
        }

        // Positional parameters

        try (Transaction tx = cont.persistence().createTransaction()) {
            TypedQuery<User> query = cont.persistence().getEntityManager().createQuery(
                    "select u from sec$User u where u.id in ?1 order by u.createTs", User.class);
            query.setParameter(1, Arrays.asList(user1.getId(), user2.getId(), user3.getId()));
            List<User> list = query.getResultList();
            assertEquals(3, list.size());

            tx.commit();
        }

        // Positional parameters with implicit conversion

        try (Transaction tx = cont.persistence().createTransaction()) {
            TypedQuery<User> query = cont.persistence().getEntityManager().createQuery(
                    "select u from sec$User u where u.id in ?1 order by u.createTs", User.class);
            query.setParameter(1, Arrays.asList(user1, user2, user3));
            List<User> list = query.getResultList();
            assertEquals(3, list.size());

            tx.commit();
        }
    }

    @Test
    public void testEmptyCollectionParameter() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Query query = em.createQuery("select u from sec$User u where u.id in :ids");
            query.setParameter("ids", Collections.emptyList());
            List list = query.getResultList();
            assertTrue(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id in (:ids)");
            query.setParameter("ids", Collections.emptyList());
            list = query.getResultList();
            assertTrue(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in :ids");
            query.setParameter("ids", Collections.emptyList());
            list = query.getResultList();
            assertFalse(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in (:ids)");
            query.setParameter("ids", Collections.emptyList());
            list = query.getResultList();
            assertFalse(list.isEmpty());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testNullCollectionParameter() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Query query = em.createQuery("select u from sec$User u where u.id in :ids");
            query.setParameter("ids", null);
            List list = query.getResultList();
            assertTrue(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id in (:ids)");
            query.setParameter("ids", null);
            list = query.getResultList();
            assertTrue(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in :ids");
            query.setParameter("ids", null);
            list = query.getResultList();
            assertFalse(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in (:ids)");
            query.setParameter("ids", null);
            list = query.getResultList();
            assertFalse(list.isEmpty());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testNotExistsCollectionParameter() throws Exception {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();

            Query query = em.createQuery("select u from sec$User u where u.id in :ids");
            List list = query.getResultList();
            assertTrue(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id in (:ids)");
            list = query.getResultList();
            assertTrue(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in :ids");
            list = query.getResultList();
            assertFalse(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in (:ids)");
            list = query.getResultList();
            assertFalse(list.isEmpty());

            query = em.createQuery("select u from sec$User u where u.id not in (:ids1) or u.id not in (:ids2)");
            query.setParameter("ids1", null);
            list = query.getResultList();
            assertFalse(list.isEmpty());

            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testSingleBooleanResult() {
        // works
        Object[] activeAndName = cont.persistence().callInTransaction((em) -> {
            return (Object[]) em.createQuery("select u.active, u.name from sec$User u where u.login = :login")
                    .setParameter("login", "testLogin")
                    .getFirstResult();
        });
        assertTrue((Boolean) activeAndName[0]);
        assertEquals("testUser", activeAndName[1]);

        //returns null
        Boolean active = cont.persistence().callInTransaction((em) -> {
            return em.createQuery("select u.active from sec$User u where u.login = :login", Boolean.class)
                    .setParameter("login", "testLogin")
                    .getFirstResult();
        });
        assertNotNull(active);
        assertTrue(active);
    }

    @Test
    public void testEnumImplicitConversion() throws Exception {
        // explicit enum id value
        cont.persistence().runInTransaction(em -> {
            TypedQuery<Constraint> query = em.createQuery("select c from sec$Constraint c where c.operationType = :operationType", Constraint.class);
            query.setParameter("operationType", "read");
            List<Constraint> constraints = query.getResultList();
            assertTrue(constraints.stream().anyMatch(constraint -> constraintId.equals(constraint.getId())));
        });

        // enum as a positional parameter
        cont.persistence().runInTransaction(em -> {
            TypedQuery<Constraint> query = em.createQuery("select c from sec$Constraint c where c.operationType = ?1", Constraint.class);
            query.setParameter(1, ConstraintOperationType.READ);
            List<Constraint> constraints = query.getResultList();
            assertTrue(constraints.stream().anyMatch(constraint -> constraintId.equals(constraint.getId())));
        });

        // enum as a named parameter
        cont.persistence().runInTransaction(em -> {
            TypedQuery<Constraint> query = em.createQuery("select c from sec$Constraint c where c.operationType = :operationType", Constraint.class);
            query.setParameter("operationType", ConstraintOperationType.READ);
            List<Constraint> constraints = query.getResultList();
            assertTrue(constraints.stream().anyMatch(constraint -> constraintId.equals(constraint.getId())));
        });

    }

    @Test
    public void testNoImplicitConversion() throws Exception {
        cont.persistence().runInTransaction(em -> {
            Group group = em.find(Group.class, TestSupport.COMPANY_GROUP_ID);

            TypedQuery<User> query = em.createQuery("select u from sec$User u where u.group = :group", User.class);
            query.setParameter("group", group, false);
            List<User> users = query.getResultList();
            assertTrue(!users.isEmpty());
        });
    }

    @Test
    public void testNestedEntityGroupBy() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();
            em.createQuery("select ur.role, count(ur.id) from sec$UserRole ur group by ur.role")
                    .getResultList();
            tx.commit();
        } finally {
            tx.end();
        }
    }

    @Test
    public void testDeleteQueryWithSoftDeleteTrue() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();
            try {
                em.createQuery("delete from sys$FileDescriptor f").executeUpdate();
            } catch (UnsupportedOperationException e) {
                //It's OK
            }

            try {
                em.setSoftDeletion(false);
                em.createQuery("delete from sys$FileDescriptor f").executeUpdate();
            } catch (javax.persistence.PersistenceException e) {
                //It's OK integrity constraint violation
            } finally {
                em.setSoftDeletion(true);
            }

            try {
                AppContext.setProperty("cuba.enableDeleteStatementInSoftDeleteMode", "true");
                em.createQuery("delete from sys$FileDescriptor f").executeUpdate();
            } catch (javax.persistence.PersistenceException e) {
                //It's OK integrity constraint violation
            } finally {
                AppContext.setProperty("cuba.enableDeleteStatementInSoftDeleteMode", "false");
            }
        } finally {
            try {
                tx.end();
            } catch (Exception e) {
                //Do nothing
            }
        }
    }

    @Test
    public void testNewObjectInJPQL() {
        Transaction tx = cont.persistence().createTransaction();
        try {
            EntityManager em = cont.persistence().getEntityManager();
            UserDTO dto = (UserDTO) em.createQuery("select new com.haulmont.cuba.core.UserDTO(u.login) from sec$User u where u.id = :id")
                    .setParameter("id", userId)
                    .getFirstResult();
            assertNotNull(dto);
            assertEquals("testLogin", dto.login);
            tx.commit();
        } finally {
            tx.end();
        }
    }
}


text:
#pragma once

#include "AlternativeTextClient.h"
#include "FloatRect.h"
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>

#if USE(DICTATION_ALTERNATIVES)
OBJC_CLASS NSTextAlternatives;
OBJC_CLASS NSView;

namespace WebCore {

class AlternativeTextUIController {
public:
    AlternativeTextUIController() { }
    // Returns a context ID.
    WEBCORE_EXPORT uint64_t addAlternatives(const RetainPtr<NSTextAlternatives>&);
    WEBCORE_EXPORT void clear();
    WEBCORE_EXPORT void showAlternatives(NSView*, const FloatRect& boundingBoxOfPrimaryString, uint64_t context, void(^acceptanceHandler)(NSString*));
    void WEBCORE_EXPORT removeAlternatives(uint64_t context);
    WEBCORE_EXPORT Vector<String> alternativesForContext(uint64_t context);

private:
    void handleAcceptedAlternative(NSString* acceptedAlternative, uint64_t context, NSTextAlternatives*);

    void dismissAlternatives();

    class AlernativeTextContextController {
    public:
        AlernativeTextContextController() { }
        uint64_t addAlternatives(const RetainPtr<NSTextAlternatives>&);
        void clear();
        NSTextAlternatives* alternativesForContext(uint64_t context);
        void removeAlternativesForContext(uint64_t context);
        static const uint64_t invalidContext = 0;
    private:
        typedef HashMap<uint64_t, RetainPtr<NSTextAlternatives>> HashMapType;
        HashMapType m_alternativesObjectMap;
    };

    AlernativeTextContextController m_contextController;
    RetainPtr<NSView> m_view;
};

} // namespace WebCore

#endif // ENABLE(DICTATION_ALTERNATIVES)


text:
import { filter } from "lodash";
export = filter;


text:
@interface DBCollectionViewFlowLayout : UICollectionViewFlowLayout
@property (nonatomic, assign) UICollectionViewScrollDirection scrollDirection;
@end


text:
import AppDispatcher from '../AppDispatcher';
import events from 'events';
import Firebase from 'firebase';
import ArticleActions from '../actions/ArticleActions';

let _articles = [];
let _storyDetails = {};

class ArticleStore extends events.EventEmitter {

    constructor() {
        super();
    }

    getArticles() {
        return _articles;
    }

    setArticles(articles) {
        console.log('Setting articles', articles);
        _articles = articles;
    }

    getStory(storyId) {
        return _storyDetails[storyId];
    }

    setStory(storyId, story) {
        _storyDetails[storyId] = story;
    }

    emitChange() {
        this.emit('change');
    }

    emitStoryChange(storyId) {
        this.emit(`STORY_CHANGE_${storyId}`);
    }

    addStoryChangeListener(storyId, callback) {
        this.on(`STORY_CHANGE_${storyId}`, callback);
    }

    removeStoryChangeListener(storyId, callback) {
        this.removeListener(`STORY_CHANGE_${storyId}`, callback);
    }

    addChangeListener(callback) {
        this.on('change', callback);
    }

    removeChangeListener(callback) {
        this.removeListener('change', callback);
    }

}

let articleStore = new ArticleStore();

AppDispatcher.register((payload) => {
    let action = payload.action;

    switch (action.actionType) {

        case 'CHANGE':
            // articleStore.emitChange();
            break;

        case 'RECEIVE_TOP_STORIES':
            articleStore.setArticles(action.data);
            articleStore.emitChange();
            break;

        case 'STORY_RECEIVE':
            articleStore.setStory(action.data.id, action.data);
            articleStore.emitStoryChange(action.data.id);
            break;

        default:
            return true;

    }

    return true;
});

export default articleStore;


text:
from __future__ import unicode_literals
from datetime import datetime
from django.contrib import admin
from django.contrib.admin import AdminSite

from adminsortable.admin import SortableAdmin
from django_summernote.admin import SummernoteModelAdmin

from . import models

class DocumentAdmin(SortableAdmin, SummernoteModelAdmin):
    prepopulated_fields = {"slug": ("title",)}
    ordering = ['order',]
    list_display = ('title', 'category', 'modified', 'order')
    list_editable = ('category',)
    list_filter = ('category',)
    search_fields = ('title', 'summary')
    readonly_fields = ('created', 'modified')

    fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('title', 'summary', 'image', 'ext_url', 'category', 'slug')
        }),
        )

admin.site.register(models.Document, DocumentAdmin)


text:
layout: default
title: CAS - Attribute Release Policies
category: Attributes
---

{% include variables.html %}

# Attribute Release Policy - Return MultiMapped

The same policy may allow attribute definitions to be renamed and remapped to multiple attribute names,
with duplicate attributes values mapped to different names.

For example, the following configuration will recognize the resolved attribute `eduPersonAffiliation` and will then
release `affiliation` and `personAffiliation` whose values stem from the original `eduPersonAffiliation` attribute
while `groupMembership` is released as `group`. In other words, the `eduPersonAffiliation` attribute is
released twice under two different names each sharing the same value.

```json
{
  "@class" : "org.apereo.cas.services.CasRegisteredService",
  "serviceId" : "sample",
  "name" : "sample",
  "id" : 300,
  "attributeReleasePolicy" : {
    "@class" : "org.apereo.cas.services.ReturnMappedAttributeReleasePolicy",
    "allowedAttributes" : {
      "@class" : "java.util.TreeMap",
      "eduPersonAffiliation" : [ "java.util.ArrayList", [ "affiliation", "personAffiliation" ] ],
      "groupMembership" : "group"
    }
  }
}
```

Attributes authorized and allowed for release by this policy may not necessarily be available
as resolved principal attributes and can be resolved on the fly dynamically
using the [attribute definition store](Attribute-Definitions.html).


text:
layout: post
title:  "S&C Electric Company Tour [CANCELLED]"
date:   2014-02-07
author: Eric Tendian
categories:
- announcement
- tour
- s&c
- event
img: /assets/img/blog/nopicture.jpg
thumb: nopicture.jpg
---

About S&C: S&C Electric Company is a global provider of equipment and services for electric power systems. Founded in 1911, the Chicago-based company designs and manufactures switching and protection products for electric power transmission and distribution.

Bring your resume too!

This tour has limited space and thus sign up is on a first-come, first-serve basis. You must submit a $10 deposit which will be refunded on completion of the tour.

RSVP here: [bit.ly/ieeeiit-spring2014](http://bit.ly/ieeeiit-spring2014)

We'll see you there!

Date: Friday, February 7, 2014

Time: 8:30 am to 3:00 pm

Meet at: Hermann Hall West Entrance

Visiting:
S&C Electric Company

6601 N. Ridge Blvd.

Chicago, IL 60626