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

// Style
#import "TTStyledFrame.h"
#import "TTStyleDelegate.h"

@interface TTStyledBoxFrame : TTStyledFrame <TTStyleDelegate> {
  TTStyledBoxFrame* __weak _parentFrame;
  TTStyledFrame*    _firstChildFrame;
  TTStyle*          _style;
}

@property (nonatomic, weak) TTStyledBoxFrame* parentFrame;
@property (nonatomic, strong) TTStyledFrame*    firstChildFrame;

/**
 * The style used to render the frame;
 */
@property (nonatomic, strong) TTStyle* style;

@end

redpajama_set_name: RedPajamaGithub


text:
// jscs:disable validateIndentation
(function () {
'use strict';
const GLib = imports.gi.GLib;

var reqs = {
  immediate: function () {
    return function (func, priority=GLib.PRIORITY_DEFAULT_IDLE) {
      GLib.idle_add(priority, function () {
        func();
        return GLib.SOURCE_REMOVE;
      });
    };
  },
};
function require(req) {
  return reqs[req]();
}

var process = {
  emit: function (event, error) {
    if (event === 'unhandledRejection') {
      log('Unhandled rejection');
      throw error;
    }
  },
};

// Copyright (c) 2014 Calvin Metcalf
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

// BEGIN CODE FROM lie/lib/index.js
// https://raw.githubusercontent.com/calvinmetcalf/lie/master/lib/index.js

// 'use strict';  // Moved for GJS
var immediate = require('immediate');

/* istanbul ignore next */
function INTERNAL() {}

var handlers = {};

var REJECTED = ['REJECTED'];
var FULFILLED = ['FULFILLED'];
var PENDING = ['PENDING'];
/* istanbul ignore else */
if (!process.browser) {
  // in which we actually take advantage of JS scoping
  var UNHANDLED = ['UNHANDLED'];
}

// module.exports = Promise;  // removed for GJS

function Promise(resolver) {
  if (typeof resolver !== 'function') {
    throw new TypeError('resolver must be a function');
  }
  this.state = PENDING;
  this.queue = [];
  this.outcome = void 0;
  /* istanbul ignore else */
  if (!process.browser) {
    this.handled = UNHANDLED;
  }
  if (resolver !== INTERNAL) {
    safelyResolveThenable(this, resolver);
  }
}

Promise.prototype.catch = function (onRejected) {
  return this.then(null, onRejected);
};
Promise.prototype.then = function (onFulfilled, onRejected) {
  if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||
    typeof onRejected !== 'function' && this.state === REJECTED) {
    return this;
  }
  var promise = new this.constructor(INTERNAL);
  /* istanbul ignore else */
  if (!process.browser) {
    if (this.handled === UNHANDLED) {
      this.handled = null;
    }
  }
  if (this.state !== PENDING) {
    var resolver = this.state === FULFILLED ? onFulfilled : onRejected;
    unwrap(promise, resolver, this.outcome);
  } else {
    this.queue.push(new QueueItem(promise, onFulfilled, onRejected));
  }

  return promise;
};
function QueueItem(promise, onFulfilled, onRejected) {
  this.promise = promise;
  if (typeof onFulfilled === 'function') {
    this.onFulfilled = onFulfilled;
    this.callFulfilled = this.otherCallFulfilled;
  }
  if (typeof onRejected === 'function') {
    this.onRejected = onRejected;
    this.callRejected = this.otherCallRejected;
  }
}
QueueItem.prototype.callFulfilled = function (value) {
  handlers.resolve(this.promise, value);
};
QueueItem.prototype.otherCallFulfilled = function (value) {
  unwrap(this.promise, this.onFulfilled, value);
};
QueueItem.prototype.callRejected = function (value) {
  handlers.reject(this.promise, value);
};
QueueItem.prototype.otherCallRejected = function (value) {
  unwrap(this.promise, this.onRejected, value);
};

function unwrap(promise, func, value) {
  immediate(function () {
    var returnValue;
    try {
      returnValue = func(value);
    } catch (e) {
      handlers.reject(promise, e); // Changed for GJS
      return; // Added for GJS
    }
    if (returnValue === promise) {
      handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));
    } else {
      handlers.resolve(promise, returnValue);
    }
  });
}

handlers.resolve = function (self, value) {
  var result = tryCatch(getThen, value);
  if (result.status === 'error') {
    return handlers.reject(self, result.value);
  }
  var thenable = result.value;

  if (thenable) {
    safelyResolveThenable(self, thenable);
  } else {
    self.state = FULFILLED;
    self.outcome = value;
    var i = -1;
    var len = self.queue.length;
    while (++i < len) {
      self.queue[i].callFulfilled(value);
    }
  }
  return self;
};
handlers.reject = function (self, error) {
  self.state = REJECTED;
  self.outcome = error;
  /* istanbul ignore else */
  if (!process.browser) {
    if (self.handled === UNHANDLED) {
      immediate(function () {
        if (self.handled === UNHANDLED) {
          process.emit('unhandledRejection', error, self);
        }
      });
    }
  }
  var i = -1;
  var len = self.queue.length;
  while (++i < len) {
    self.queue[i].callRejected(error);
  }
  return self;
};

function getThen(obj) {
  // Make sure we only access the accessor once as required by the spec
  var then = obj && obj.then;
  if (obj && typeof obj === 'object' && typeof then === 'function') {
    return function appyThen() {
      then.apply(obj, arguments);
    };
  }
  return undefined; // added for GJS
}

function safelyResolveThenable(self, thenable) {
  // Either fulfill, reject or reject with error
  var called = false;
  function onError(value) {
    if (called) {
      return;
    }
    called = true;
    handlers.reject(self, value);
  }

  function onSuccess(value) {
    if (called) {
      return;
    }
    called = true;
    handlers.resolve(self, value);
  }

  function tryToUnwrap() {
    thenable(onSuccess, onError);
  }

  var result = tryCatch(tryToUnwrap);
  if (result.status === 'error') {
    onError(result.value);
  }
}

function tryCatch(func, value) {
  var out = {};
  try {
    out.value = func(value);
    out.status = 'success';
  } catch (e) {
    out.status = 'error';
    out.value = e;
  }
  return out;
}

Promise.resolve = resolve;
function resolve(value) {
  if (value instanceof this) {
    return value;
  }
  return handlers.resolve(new this(INTERNAL), value);
}

Promise.reject = reject;
function reject(reason) {
  var promise = new this(INTERNAL);
  return handlers.reject(promise, reason);
}

Promise.all = all;
function all(iterable) {
  var self = this;
  if (Object.prototype.toString.call(iterable) !== '[object Array]') {
    return this.reject(new TypeError('must be an array'));
  }

  var len = iterable.length;
  var called = false;
  if (!len) {
    return this.resolve([]);
  }

  var values = new Array(len);
  var resolved = 0;
  var i = -1;
  var promise = new this(INTERNAL);

  while (++i < len) {
    allResolver(iterable[i], i);
  }
  // return promise; // moved for GJS
  function allResolver(value, i) {
    self.resolve(value).then(resolveFromAll, function (error) {
      if (!called) {
        called = true;
        handlers.reject(promise, error);
      }
    });
    function resolveFromAll(outValue) {
      values[i] = outValue;
      if (++resolved === len && !called) {
        called = true;
        handlers.resolve(promise, values);
      }
    }
  }
  return promise; // Added for GJS
}

Promise.race = race;
function race(iterable) {
  var self = this;
  if (Object.prototype.toString.call(iterable) !== '[object Array]') {
    return this.reject(new TypeError('must be an array'));
  }

  var len = iterable.length;
  var called = false;
  if (!len) {
    return this.resolve([]);
  }

  var i = -1;
  var promise = new this(INTERNAL);

  while (++i < len) {
    resolver(iterable[i]);
  }
  // return promise; // Moved for GJS
  function resolver(value) {
    self.resolve(value).then(function (response) {
      if (!called) {
        called = true;
        handlers.resolve(promise, response);
      }
    }, function (error) {
      if (!called) {
        called = true;
        handlers.reject(promise, error);
      }
    });
  }
  return promise; // Added for GJS
}

// END CODE FROM lie/lib/index.js

return Promise;
})();


text:
const BroadcastEvent = require('./broadcast')
const { EVENT_UPDATE_CONTEST } = require('../utils/constants')
const contestSerializer = require('../serializers/contest')

class UpdateContestEvent extends BroadcastEvent {
  constructor (contest) {
    super(EVENT_UPDATE_CONTEST, contestSerializer(contest))
  }
}

module.exports = UpdateContestEvent


text:
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

if (!function_exists('links()')) {

   function links($url, $texto)
    {

       $link = ''.$texto.'';
       return $link;
    }

}


text:
.include <bsd.own.mk>

SUBDIR=bn div exp

.include <bsd.subdir.mk>


text:
using System.Threading.Tasks;
using Lykke.Bitcoin.Api.Client.AutoGenerated;
using Lykke.Bitcoin.Api.Client.AutoGenerated.Models;
using Lykke.Bitcoin.Api.Client.BitcoinApi.Models;

// ReSharper disable once CheckNamespace
namespace Lykke.Bitcoin.Api.Client.BitcoinApi
{
    public partial class BitcoinApiClient
    {
        public async Task<BccSplitTransactionResponse> BccSplitTransaction(string multisig, string clientDestination, string hubDestination)
        {
            var response = await _apiClient.ApiBccSplitGetAsync(multisig, clientDestination, hubDestination);

            return PrepareResult(response, o =>
            {
                if (response is SplitTransactionResponse model)
                    return new BccSplitTransactionResponse
                    {
                        Transaction = model.Transaction,
                        ClientAmount = model.ClientAmount ?? 0,
                        HubAmount = model.HubAmount ?? 0,
                        ClientFeeAmount = model.ClientFeeAmount ?? 0,
                        Outputs = model.Outputs
                    };
                return null;
            });
        }

        public async Task<BccTransactionResponse> BccPrivateTransferTransaction(string sourceAddress, string destinationAddress, decimal fee)
        {
            var response = await _apiClient.ApiBccPrivatetransferGetAsync(sourceAddress, destinationAddress, fee);

            return PrepareResult(response, o =>
            {
                if (response is PrivateBccTransferResponse model)
                    return new BccTransactionResponse
                    {
                        Transaction = model.Transaction,
                        Outputs = model.Outputs
                    };
                return null;
            });
        }

        public async Task<BccTransactionHashResponse> BccBroadcast(string transaction)
        {
            var response = await _apiClient.ApiBccBroadcastPostAsync(new BccBroadcastModel(transaction));

            return PrepareResult(response, o =>
            {
                if (response is TransactionHashResponse model)
                    return new BccTransactionHashResponse
                    {
                        TransactionHash = model.TransactionHash
                    };
                return null;
            });
        }

        public async Task<Models.BccBalanceResponse> BccBalance(string address)
        {
            var response = await _apiClient.ApiBccBalanceGetAsync(address);
            return PrepareResult(response, o =>
            {
                if (o is AutoGenerated.Models.BccBalanceResponse model)
                    return new Models.BccBalanceResponse
                    {
                        Balance = model.Balance ?? 0
                    };
                return null;
            });
        }
    }
}


text:
package org.apache.causeway.extensions.fullcalendar.wkt.viewer.calendareventable;

import org.apache.wicket.Component;
import org.springframework.stereotype.Service;

import org.apache.causeway.extensions.fullcalendar.applib.CalendarEventable;
import org.apache.causeway.extensions.fullcalendar.wkt.viewer.CalendaredCollectionFactoryAbstract;
import org.apache.causeway.viewer.wicket.model.models.EntityCollectionModel;
import org.apache.causeway.viewer.wicket.ui.ComponentFactory;

/**
 * {@link ComponentFactory} for {@link CalendarEventableCollectionAsFullCalendar}.
 */
@Service
public class CalendarEventableCollectionAsFullCalendarFactory
extends CalendaredCollectionFactoryAbstract<CalendarEventable> {

    private static final long serialVersionUID = 1L;

    public CalendarEventableCollectionAsFullCalendarFactory() {
        super(CalendarEventable.class);
    }

    @Override
    protected Component newComponent(final String id, final EntityCollectionModel collectionModel) {
        return new CalendarEventableCollectionAsFullCalendar(id, collectionModel);
    }
}


text:
package org.automon.utils;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.reflect.CodeSignature;
import org.automon.aspects.AutomonMXBean;

import javax.management.JMX;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;
import java.sql.SQLException;
import java.util.*;

/**
 * Static utility methods used throughout Automon.
 */
public class Utils {

    public static final String LINE_SEPARATOR = "\n";
    /**
     * Returned when a method parameter is null
     */
     static final String NULL_STR = "<null>";

    /**
     * used when a value isn't returned, and yet we don't want to throw an exception (hey it's just monitoring)
     */
     static final String UNKNOWN =  "???";

    /**
     * Maximum length for a parameter in the exception dump
     */
     static final int DEFAULT_ARG_STRING_MAX_LENGTH = 125;

    /**
     * Parameters kept in the details section are capped at a max length and this string is put at the end of
     * the string after the truncation point to indicate there is more data that is not shown.
     */
     static final String DEFAULT_MAX_STRING_ENDING = "...";

    /**
     *
     * @return Thread safe Map that can contain Exceptions that are thrown monitored code.
     */
    public static Map<Throwable, AutomonExpirable> createExceptionMap() {
        return Collections.synchronizedMap(new ExpiringMap<Throwable, AutomonExpirable>());
    }

   /**
     * @param throwable The exception that was thrown
     * @return A string suitable for a monitoring label representing the thrown exception.  It is a convenience method and need not be
     * used to create the monitor.  Note it adds extra information to the returned label for SQLException's.

     *
     * Examples:

     *
java.lang.RuntimeException
     *
java.sql.SQLException,ErrorCode=400,SQLState=Login failure
     */
    public static String getLabel(Throwable throwable) {
        String sqlMessage="";
        // add special label information if it is a sql exception.
        if (throwable instanceof SQLException) {
          SQLException sqlException = (SQLException) throwable;
          sqlMessage = ",ErrorCode=" + sqlException.getErrorCode()+ ",SQLState=" + sqlException.getSQLState();
        }
        return throwable.getClass().getName()+sqlMessage;
    }

   /**
    *
    * @param jp The pointcut from the @Around advice that was intercepted.
    * @return A label suitable for a monitoring/timer label.  It is a convenience method and need not be
    * used to create the monitor
    */

    public static String getLabel(JoinPoint.StaticPart jp ) {
        return jp.toString();
    }

    /**
     *
If appropriate for the given {@link org.aspectj.lang.JoinPoint} return argument names and values
     * in a list of Strings.

     *
     *
Example for the following method - printName(String fname, String lname)

     *    fname: Steve

     *    lname: Souza

     *

     *
     *
Under certain circumstances for example if the code was compiled without retaining parameters a
     * parameter name of the format arg0 or even 0 might appear.

     *
     *
     * @param jp
     * @return A list containing strings of the format: argName: argValue
     */
    public static List<String> getArgNameValuePairs(JoinPoint jp) {
        List<String> list =  new ArrayList<String>();
        Object[] argValues = jp.getArgs();
        if (argValues==null || argValues.length==0) {
            return list;
        }

        Object[] argNames = getParameterNames(argValues, jp);
        for (int i = 0; i < argValues.length; i++) {
            String argName =  (argNames[i]==null) ? ""+i : argNames[i].toString();
            list.add(""+argName+": "+toStringWithLimit(argValues[i]));
        }

        return list;
     }

    /** Convert a list to a formatted string.
     *
     * @param args assumed to be parameter key value pairs
     * @return String representing the argName, argValue pairs
     */
    public static String argNameValuePairsToString(List<String> args) {
        if (args==null) {
            return UNKNOWN;
        }

        StringBuilder sb = new StringBuilder();
        sb.append("=== Parameters ===").append(LINE_SEPARATOR);
        for (String str : args) {
            sb.append(str).append(LINE_SEPARATOR);
        }
        return sb.append(LINE_SEPARATOR).toString();
    }

    /**
     * Turns a single method parameter into a string. To keep
     * the functionality safe we truncate overly long strings and
     * ignore any exceptions.
     */
     public static String toStringWithLimit(Object parameter) {
        if(parameter == null) {
            return NULL_STR;
        }

        String value = parameter.toString();
        try {
            if(value.length() > DEFAULT_ARG_STRING_MAX_LENGTH) {
                value = value.substring(0, DEFAULT_ARG_STRING_MAX_LENGTH) + DEFAULT_MAX_STRING_ENDING;
            }
            return value;
        } catch(Throwable e) {
            return UNKNOWN;
        }
    }

    /** Return full Exception stack trace as String */
    public static String getExceptionTrace(Throwable exception) {
        if (exception==null) {
            return UNKNOWN;
        }
        // each line of the stack trace will be returned in the array.
        StackTraceElement elements[] = exception.getStackTrace();
        StringBuilder sb = new StringBuilder().append(exception).append(LINE_SEPARATOR);

        for (int i = 0; i < elements.length; i++) {
            sb.append(elements[i]).append(LINE_SEPARATOR);
        }

        return sb.toString();
    }

    /** Tokenize the passed in string.
     *
     * @param string string to tokenize
     * @param splitOn string to split the string on.
     * @return an array of String tokens.
     */
    public static String[] tokenize(String string, String splitOn) {
        return string.replace(" ","").split(splitOn);
    }

    /**
     *
     * @param fileName
     * @return Take something like file://myfile.dat and return myfile.dat
     */
    public static String stripFileScheme(String fileName) {
        return fileName.replaceFirst("(?i)file://","").replaceFirst("(?i)file:","");
    }

    /**
     * Pass in an aspect and return its jmx bean.
     *
     * @param aspect
     * @return MxBean to manage the aspect
     * @throws Exception if jmx commands fail
     */
    public static AutomonMXBean getAutomonMxBean(Object aspect) throws Exception {
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        AutomonMXBean mxbeanProxy = JMX.newMXBeanProxy(mBeanServer, getMxBeanObjectName(aspect), AutomonMXBean.class);
        return mxbeanProxy;
    }

   // get the ObjectName that is used to refer to the 'aspect'
   private static ObjectName getMxBeanObjectName(Object aspect) throws Exception {
        String objectName = "org.automon:type=aspects,name=" + aspect;
        return new ObjectName(objectName);
    }

    /**
     *
     * @param aspect Aspect that we are registering the jmx bean for
     * @param mxBean jmx bean use to manage and get information about the aspect
     */
    public static void registerWithJmx(Object aspect, AutomonMXBean mxBean)  {
        try {
            MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
            mBeanServer.registerMBean(mxBean, getMxBeanObjectName(aspect));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     *
     * @param aspect unregister the passed in aspect.
     * @throws Exception
     */

    public static void unregisterWithJmx(Object aspect) throws Exception {
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
        mBeanServer.unregisterMBean(getMxBeanObjectName(aspect));
    }

    public static boolean hasPackageName(String className) {
        return className==null ? false : className.contains(".");
    }

    /**
     * Take a variable list of fully qualified class names and return the first one.
     * @param classNames com.package1.MyClass1, com.package2.MyClass2
     * @param <T>
     * @return The first created class or none if all fail.
     */
    public static <T> T createFirst(String... classNames) {
        for (String className : classNames) {
            try {
                return (T) Class.forName(className).newInstance();
            } catch (Throwable t) {
            }
        }
        return null;
    }

    // used to get method argvalues from the method signature.
    private static Object[] getParameterNames(Object[] argValues, JoinPoint jp) {
        Signature signature = jp.getSignature();
        if (signature instanceof CodeSignature) {
            return ((CodeSignature) signature).getParameterNames();
        } else {
            return new Object[argValues.length];
        }
    }

    /**
     *
     * @param list Take a list and remove any entries with '.' in them.  This is done to remove class names from
     *             a List.
     */

    public static void removeClassNames(List<String> list) {
        ListIterator<String> iterator = list.listIterator();
        while (iterator.hasNext()) {
            String str = iterator.next();
            if (str.contains(".")) {
                iterator.remove();
            }
        }
    }

}


text:
<?php

namespace Veridu\API;

use Veridu\Exception;

class Application extends AbstractEndpoint
{

    /**
    * Creates a new hosted application
    *
    * @link https://veridu.com/wiki/Application_Resource#How_to_create_a_new_hosted_application
    *
    * @return self
    */
    public function create($provider, $key, $secret)
    {
        $this->validateNotEmptySessionOrFail();
        $username = $this->storage->getUsername();
        self::validateNotEmptyUsernameOrFail($username);
        $json = $this->signedFetch(
            'POST',
            'application',
            array(
                'key' => $key,
                'secret' => $secret,
                'provider' => $provider
            )
        );
        return $json;
    }

    /**
    * Retrieves a list of all hosted applications
    *
    * @link https://veridu.com/wiki/Application_Resource#How_to_retrieve_a_list_of_all_hosted_applications
    *
    * @return array
    */
    public function listAll()
    {
        $this->validateNotEmptySessionOrFail();
        $username = $this->storage->getUsername();
        self::validateNotEmptyUsernameOrFail($username);
        $json = $this->signedFetch(
            'GET',
            'application'
        );
        return $json['list'];
    }

    /**
    * Retrieves detailed information about a hosted application
    *
    * @link https://veridu.com/wiki/Application_Resource#How_to_get_a_detailed_information_about_a_hosted_application
    *
    * @return array
    */
    public function details($appId)
    {
        $this->validateNotEmptySessionOrFail();
        $username = $this->storage->getUsername();
        self::validateNotEmptyUsernameOrFail($username);
        $json = $this->signedFetch(
            'GET',
            sprintf(
                'application/%s',
                $appId
            )
        );
        return $json;
    }

    /**
    * Enables a hosted application
    *
    * @link https://veridu.com/wiki/Application_Resource#How_to_enable.2Fdisabled_a_hosted_application
    *
    * @return self
    */
    public function enable($appId)
    {
        $this->validateNotEmptySessionOrFail();
        $username = $this->storage->getUsername();
        self::validateNotEmptyUsernameOrFail($username);
        $this->signedFetch(
            'PUT',
            sprintf(
                'application/%s',
                $appId
            ),
            array(
                'enabled' => 'true'
            )
        );
        return $this;
    }

    /**
    * Disables a hosted application
    *
    * @link https://veridu.com/wiki/Application_Resource#How_to_enable.2Fdisabled_a_hosted_application
    *
    * @return self
    */
    public function disable($appId)
    {
        $this->validateNotEmptySessionOrFail();
        $username = $this->storage->getUsername();
        self::validateNotEmptyUsernameOrFail($username);
        $this->signedFetch(
            'PUT',
            sprintf(
                'application/%s',
                $appId
            ),
            array(
                'enabled' => 'false'
            )
        );
        return $this;
    }
}


text:
package android.view.inputmethod.cts;

import android.os.Parcel;
import android.test.AndroidTestCase;
import android.view.inputmethod.CompletionInfo;

public class CompletionInfoTest extends AndroidTestCase {
    private static final int ID = 1;
    private static final int POSITION = 1;
    private static final String TEXT = "CompletionInfoText";
    private static final String LABEL = "CompletionInfoLabel";

    public void testCompletionInfo() {
        new CompletionInfo(ID, POSITION, TEXT);
        CompletionInfo info = new CompletionInfo(ID, POSITION, TEXT, LABEL);
        assertCompletionInfo(info);

        assertEquals(0, info.describeContents());
        assertNotNull(info.toString());

        Parcel p = Parcel.obtain();
        info.writeToParcel(p, 0);
        p.setDataPosition(0);
        CompletionInfo targetInfo = CompletionInfo.CREATOR.createFromParcel(p);
        p.recycle();
        assertCompletionInfo(targetInfo);
    }

    private void assertCompletionInfo(CompletionInfo info) {
        assertEquals(ID, info.getId());
        assertEquals(POSITION, info.getPosition());
        assertEquals(TEXT, info.getText().toString());
        assertEquals(LABEL, info.getLabel().toString());
    }
}


text:
package com.blazebit.persistence.view.impl.filter;

import com.blazebit.persistence.RestrictionBuilder;
import com.blazebit.persistence.view.SubqueryProvider;

/**
 *
 * @author Christian Beikov
 * @since 1.0.0
 */
public class ComparisonFilterHelper {

    private final ComparisonFilter filter;
    private final Object value;
    private final SubqueryProvider subqueryProvider;

    public ComparisonFilterHelper(ComparisonFilter filter, Class<?> expectedType, Object value) {
        if (filter == null) {
            throw new NullPointerException("filter");
        }
        if (value == null) {
            throw new NullPointerException("value");
        }

        this.filter = filter;

        if (value instanceof SubqueryProvider) {
            this.value = null;
            this.subqueryProvider = (SubqueryProvider) value;
        } else if (expectedType.isInstance(value)) {
            this.value = value;
            this.subqueryProvider = null;
        } else {
            this.value = FilterUtils.parseValue(expectedType, value);
            this.subqueryProvider = null;
        }
    }

    public <T> T apply(RestrictionBuilder<T> rb) {
        if (subqueryProvider == null) {
            return filter.applyRestriction(rb, value);
        } else {
            return subqueryProvider.createSubquery(filter.applySubquery(rb));
        }
    }
}


text:
//
//    Copyright(C) 2015  Elanna Stephenson
//
//    This software is released under the MIT license, see LICENSE for details.
//

using System;
using System.Collections.Generic;
using System.Numerics;
using System.Threading;
using System.Runtime.CompilerServices;

namespace SCSRaytracer
{
    /// <summary>
    /// Class containing references to all world items
    /// </summary>
    sealed class World
    {
        private ViewPlane _viewPlane; // viewplane
        private RGBColor _backgroundColor; // background color
        private Tracer _tracer; // tracer to be used in rendering scene, default Whitted

        private List<RenderableObject> _renderList;  //Renderlist is the actual list of objects to render
        private List<RenderableObject> _objectList;  //Objectlist isn't rendered, and instead serves to hold objects to be instanced
        private List<Light> _lightList; // List of lights
        private List<Material> _materialList; // List of all materials to be used in scene rendering

        private AmbientLight _ambientLight;   // Ambient lighting is treated differently from raytraced sources, keep outside list
        private Camera _camera; // Camera reference
        private LiveViewer _liveView; // Live viewer window
        private byte[] _renderImage; // 1D byte array for image rendering

        // accessors
        public ViewPlane CurrentViewPlane
        {
            get
            {
                return _viewPlane;
            }
        }
        public RGBColor CurrentBackgroundColor
        {
            get
            {
                return _backgroundColor;
            }
        }
        public Tracer CurrentTracer
        {
            get
            {
                return _tracer;
            }
            set
            {
                _tracer = value;
            }
        }
        public List<RenderableObject> RenderList
        {
            get
            {
                return _renderList;
            }
        }
        public List<RenderableObject> ObjectList
        {
            get
            {
                return _objectList;
            }
        }
        public List<Light> LightList
        {
            get
            {
                return _lightList;
            }
        }
        public List<Material> MaterialList
        {
            get
            {
                return _materialList;
            }
        }
        public AmbientLight AmbientLight
        {
            get
            {
                return _ambientLight;
            }
            set
            {
                _ambientLight = value;
            }
        }
        public Camera Camera
        {
            get
            {
                return _camera;
            }
            set
            {
                _camera = value;
            }
        }
        public LiveViewer LiveView
        {
            get
            {
                return _liveView;
            }
        }
        public byte[] RenderImage
        {
            get
            {
                return _renderImage;
            }
        }

        /// <summary>
        /// Constructor
        /// </summary>
        public World ()
        {
            // give world a default viewplane and ambient light
            _viewPlane = new ViewPlane();
            _ambientLight = new AmbientLight();

            // set up scene lists
            _renderList = new List<RenderableObject>();
            _objectList = new List<RenderableObject>();
            _lightList = new List<Light>();
            _materialList = new List<Material>();

        }

        /// <summary>
        /// Appends given render object to the end of the scene list
        /// </summary>
        /// <param name="o">Object to add</param>
        public void AddObjectToScene(RenderableObject o)
        {
            _renderList.Add(o);
        }

        /// <summary>
        /// Appends object to the end of the instantiable objects list
        /// </summary>
        /// <param name="o">Object to add</param>
        public void AddObject(RenderableObject o)
        {
            _objectList.Add(o);
        }

        /// <summary>
        /// Appends a light to the end of the lights list
        /// </summary>
        /// <param name="l">Light to add</param>
        public void AddLight(Light l)
        {
            _lightList.Add(l);
        }

        /// <summary>
        /// Appends a material to the end of the materials list
        /// </summary>
        /// <param name="m">Material to add</param>
        public void AddMaterial(Material m)
        {
            _materialList.Add(m);
        }

        /// <summary>
        /// Step 1 in rendering pipeline.
        /// Generic intersection detection for objectList called by a Tracer, returns ShadeRec describing intersection.
        /// </summary>
        /// <param name="ray">Ray for intersection calculation</param>
        /// <returns>ShadeRec object with all relevant information about object that was intersected for generating
        /// pixel data</returns>
        public ShadeRec HitObjects(Ray ray)
        {
            ShadeRec sr = new ShadeRec(this); // create shaderec

            // set normal and local hit point to non-null values
            Normal normal = new Normal();
            Point3D local_hit_point = new Point3D();

            float t = GlobalVars.K_HUGE_VALUE - 1.0f; // t value for corrent object
            float tmin = GlobalVars.K_HUGE_VALUE; //  current lowest t value
            int num_objects = _renderList.Count; // store count of objects to minimize unecessary member access
            Material closestmat = null; // material reference for closest object

            //Find the closest intersection point along the given ray
            for(int i = 0; i < num_objects; i++)
            {
                // Intersect each object in render list
                // First term evaluated first, therefore (t < tmin) will be doing a comparison of t value
                // of present object vs minimum t value.
                if (_renderList[i].Hit(ray, ref t, ref sr) && (t < tmin))
                {
                    sr.HitAnObject = true; // at least one intersection has occurred

                    // store temporary references to information about current object with minimum t
                    tmin = t;
                    closestmat = sr.ObjectMaterial;
                    sr.HitPoint = ray.Origin + t * ray.Direction; // calculate hit point in world space by adding t*direction to origin
                    normal = sr.Normal;
                    local_hit_point = sr.HitPointLocal;
                }
            }

            //If we hit an object, store local vars for closest object with ray intersection in sr before returning
            if(sr.HitAnObject)
            {
                sr.TMinimum = tmin;
                sr.Normal = normal;
                sr.HitPointLocal = local_hit_point;
                sr.ObjectMaterial = closestmat;
            }

            return (sr);
        }

        /// <summary>
        /// Builds the world
        /// </summary>
        public void Build()
        {
            _backgroundColor = GlobalVars.COLOR_BLACK;

            if (GlobalVars.inFile != null)
            {
                // Attempt to open an input file
                XMLProcessor sceneLoader = new XMLProcessor(GlobalVars.inFile, this);

                // Load materials from XML file, if verbose output enabled provide debug info in console
                sceneLoader.LoadMaterials();
                if (GlobalVars.verbose)
                {
                    Console.WriteLine("Materials loaded:");
                    foreach (Material m in _materialList)
                    {
                        Console.WriteLine(m.ToString());
                    }
                }

                // Load objects for instancing from XML file, if verbose output enabled provide debug info in console
                sceneLoader.LoadObjects();
                if (GlobalVars.verbose)
                {
                    Console.WriteLine("Object definitions loaded:");
                    foreach (RenderableObject o in _objectList)
                    {
                        Console.WriteLine(o.ToString());
                    }
                }

                // Finally, load the scene from XML file, if verbose output enabled provide debug info in console
                sceneLoader.LoadWorld();
                if (GlobalVars.verbose)
                {
                    Console.WriteLine("Scene loaded!");
                    foreach (RenderableObject o in _renderList)
                    {
                        Console.WriteLine(o.ToString());
                    }
                }
                /*
                //Sphere mysphere = new Sphere(new Point3D(0, 0, 0), 1000);
                //mysphere.setMaterial(getMaterialById("myreflective"));
                //add_Object(mysphere);
                //((ThinLensCamera)camera).set_sampler(vp.vpSampler);

                UniformGrid mygrid = new UniformGrid();

                //Plane groundplane = new Plane(new Point3D(0, -100, 0), new Normal(0, 1, 0));
                //groundplane.setMaterial(new DebugCheckerboard());
                //add_Object(groundplane);

                SphericalMapper sphere_map = new SphericalMapper();
                RectangularMapper rect_map = new RectangularMapper();
                Image my_image = new Image();
                my_image.LoadFromFile("E:\\earth.jpg");

                ImageTexture my_tex = new ImageTexture();
                my_tex.MapType = rect_map;
                my_tex.Image = my_image;

                MatteShader mymatte = new MatteShader();
                //mymatte.setCr(my_tex);
                mymatte.Texture = my_tex;
                //mymatte.setReflectivity(0.95f);
                //mymatte.setKa(0.9f);
                //PhongShader myshader = (PhongShader)getMaterialById("myphong");
                //myshader.setCd(my_tex);
                //Sphere mysphere = new Sphere(new Point3D(0, 0, 0), 20);
                //mysphere.setMaterial(mymatte);

                //Instance myinstance = new Instance(mysphere);
                //myinstance.scale(new Vect3D(5, 5, 5));
                //myinstance.rotate(new Vect3D(23.5f, 90, 0));
                //mygrid.add_object(myinstance);
                //add_Object(myinstance);

                Image my_skybox = new Image();
                my_skybox.LoadFromFile("E:\\skybox.jpg");

                my_tex = new ImageTexture();
                my_tex.MapType = sphere_map;
                my_tex.Image = my_skybox;

                MatteShader skymatte = new MatteShader();
                skymatte.Texture = my_tex;
                skymatte.AmbientReflectionCoefficient = 1.0f;

                Sphere skybox = new Sphere(new Point3D(0, 10, 0),1000);
                skybox.Material = skymatte;
                //mygrid.add_object(skybox);
                AddObjectToScene(skybox);

                //mygrid.setup_cells();
                //add_Object(mygrid);

                Mesh dragon = new Mesh();
                dragon.loadFromFile("E:\\dragon.off", true);
                dragon.setup_cells();
                dragon.Material = new PhongShader();
                Instance myInstance = new Instance(dragon);
                myInstance.Scale(100, 100, 100);
                myInstance.Rotate(90, 40, 0);
                myInstance.Material = new PhongShader();
                AddObjectToScene(myInstance);
                */
            }
            //Custom build function if no input file specified
            else
            {
                    ///---------------------------------------------------------------------------------------
                    ///Insert your build function here

                    ///----------------------------------------------------------------------------------------
            }
        }

        /// <summary>
        /// Animate is called on every frame. Allows for custom animation instructions to be inserted.
        /// </summary>
        public void Animate()
        {

        }

        /// <summary>
        /// Sets up rendering field
        /// </summary>
        /// <param name="hres">Horizontal resolution</param>
        /// <param name="vres">Vertical resolution</param>
        public void OpenWindow(int hres, int vres)
        {
            // Create live viewer window, and allocate memory for the live view image
            _liveView = new LiveViewer(this);
            _renderImage = new byte[hres * vres * 4];
            _liveView.SetUpLiveView();
        }

        /// <summary>
        /// Performs the required colorspace conversions
        /// </summary>
        /// <param name="row"></param>
        /// <param name="column"></param>
        /// <param name="pixel_color"></param>
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public void DisplayPixel(int row, int column, RGBColor pixel_color)
        {
            RGBColor disp_color = new RGBColor(pixel_color.Values * 255.0f);
            Vector3 cols = disp_color.clamp().Values;
            int x = column;
            int y = _viewPlane.VerticalResolution-1-row;
            //live_view.live_image.SetPixel((uint)column, (uint)(vp.vres-1-row), new SFML.Graphics.Color(r, g, b));
            _renderImage[(y * 4 * _viewPlane.HorizontalResolution) + (x * 4)] = (byte)cols.X;
            _renderImage[(y * 4 * _viewPlane.HorizontalResolution) + (x * 4) + 1] = (byte)cols.Y;
            _renderImage[(y * 4 * _viewPlane.HorizontalResolution) + (x * 4) + 2] = (byte)cols.Z;
            _renderImage[(y * 4 * _viewPlane.HorizontalResolution) + (x * 4) + 3] = 255;
        }

        /// <summary>
        /// Utitilty function, provides handle for window thread for processing window events
        /// </summary>
        /// <returns>Handle for thread that the live view window is displayed on</returns>
        public Thread GetWindowThread()
        {
            return _liveView.RenderThread;
        }

        /// <summary>
        /// Polls mouse and keyboard events for live view window
        /// </summary>
        public void PollEvents()
        {
            _liveView.PollEvents();
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="path"></param>
        public void SaveDisplayedImage(string path)
        {
            _liveView.LiveImage.SaveToFile(path);
        }

        /// <summary>
        /// Perform lookup of material in materials list by material id
        /// </summary>
        /// <param name="idarg">Material ID to look up</param>
        /// <returns>A default matte shader in the event that material does not exist, material with ID=idarg if it exists</returns>
        public Material GetMaterialByID(string idarg)
        {
            //idarg will be null if no node is returned by the XmlProcessor
            if (idarg == null)
            {
                return new MatteShader();
            }
            else
            {
                int numMats = _materialList.Count;

                // Search for material and return it
                for (int i = 0; i < numMats; i++)
                {
                    if (_materialList[i].id.Equals(idarg))
                    {
                        return _materialList[i];
                    }
                }
                // If not found, return a default
                return new MatteShader();
            }
        }

        /// <summary>
        /// Performs lookup of an object in the objects list using a provided string for object id
        /// </summary>
        /// <param name="objarg">Object ID</param>
        /// <returns>Null if object not found, object with ID of objarg if found</returns>
        public RenderableObject GetObjectByID(string objarg)
        {
            // return null for null argument
            if(objarg == null)
            {
                return null;
            }
            else
            {
                int numObjs = _objectList.Count;

                // Search for object and return it
                for(int i = 0; i < numObjs; i++)
                {
                    if (_objectList[i].id.Equals(objarg))
                    {
                        return _objectList[i];
                    }
                }
                // If not found, return a default
                return null;
            }
        }
    }
}


text:
package com.company;

public class StockItem implements Comparable<StockItem> {
    private final String name;
    private double price;
    private int quantityInStock;
    private int reserved = 0;

    public StockItem(String name, double price) {
        this.name = name;
        this.price = price;
        this.quantityInStock = 0;
    }

    public StockItem(String name, double price, int quantityInStock) {
        this.name = name;
        this.price = price;
        this.quantityInStock = quantityInStock;
    }

    public String getName() {
        return name;
    }

    public double getPrice() {
        return price;
    }

    public int availableQuantity() {
        return quantityInStock - reserved;
    }

    public void setPrice(double price) {
        if (price > 0.0) {
            this.price = price;
        }
    }

    public void adjustStock(int quantity) {
        int newQuantity = this.quantityInStock + quantity;
        if (newQuantity >= 0) {
            this.quantityInStock = newQuantity;
        }
    }

    public int reserveStock(int quantity) {
        if (quantity <= availableQuantity()) {
            reserved += quantity;
            return quantity;
        }
        return 0;
    }

    public int unreserveStock(int quantity) {
        if (quantity <= reserved) {
            reserved -= quantity;
            return quantity;
        }
        return 0;
    }

    public int finaliseStock(int quantity) {
        if (quantity <= reserved) {
            quantityInStock -= quantity;
            reserved -=quantity;
            return quantity;
        }

        return 0;
    }

    @Override
    public boolean equals(Object obj) {
        System.out.println("Entering StockItem.equals");
        if (this == obj) {
            return true;
        }

        if ((obj == null) || (obj.getClass() != this.getClass())) {
            return false;
        }

        String objName = ((StockItem) obj).getName();
        return this.name.equals(objName);
    }

    @Override
    public int hashCode() {
        return this.name.hashCode() + 31;
    }

    @Override
    public int compareTo(StockItem o) {
//        System.out.println("Entering StockItem.compareTo");
        if (this == o) {
            return 0;
        }

        if (o != null) {
            return this.name.compareTo(o.getName());
        }

        throw new NullPointerException();
    }

    @Override
    public String toString() {
        return this.name + " : price " + this.price + ". Reserved: " + this.reserved;
    }
}


text:
namespace media {
namespace remoting {

// Predefined invalid handle value for RPC message.
constexpr int kInvalidHandle = -1;

// Predefined handle value for RPC messages related to initialization.
constexpr int kReceiverHandle = 0;

// Utility class to process incoming and outgoing RPC message to desired
// components on both end points. On sender side, for outgoing message, sender
// sends RPC message with associated handle value. On receiver side, for
// component which is interested in this RPC message has to register itself to
// RpcBroker. Before the RPC transmission starts, both sender and receiver need
// to negotiate the handle value in the existing RPC communication channel using
// handle kReceiverHandle.
//
// The class doesn't actually send RPC message to remote end point. Actual
// sender needs to set SendMessageCallback to RpcBroker. The class doesn't
// actually receive RPC message from the remote end point, either. Actually
// receiver needs to call ProcessMessageFromRemote() when RPC message is
// received. RpcBroker will distribute each RPC message to the components based
// on the handle value in the RPC message.
//
// Note this is single-threaded class running on main thread except for
// GetUniqueHandle(). It provides WeakPtr() for caller to post tasks to the main
// thread.
class RpcBroker {
 public:
  using SendMessageCallback =
      base::Callback<void(std::unique_ptr<std::vector<uint8_t>>)>;
  explicit RpcBroker(const SendMessageCallback& send_message_cb);
  ~RpcBroker();

  // Get unique handle value (larger than 0) for Rpc message.
  static int GetUniqueHandle();

  using ReceiveMessageCallback =
      base::Callback<void(std::unique_ptr<pb::RpcMessage>)>;
  // Allows components to register ReceiveMessageCallback. The handle value can
  // be sent to receiver using predefined RPC message and handle. So that
  // receiver can use it as an identity to send RPC message back to specific
  // component.
  void RegisterMessageReceiverCallback(int handle,
                                       const ReceiveMessageCallback& callback);
  // Allows components to unregister in order to stop receiving message.
  void UnregisterMessageReceiverCallback(int handle);

  // Allows RpcBroker to distribute incoming RPC message to desired components.
  void ProcessMessageFromRemote(std::unique_ptr<pb::RpcMessage> message);
  // Sends RPC message to remote end point. The actually sender which sets
  // SendMessageCallback to RpcBrokwer will receive RPC message to do actual
  // data transmission.
  void SendMessageToRemote(std::unique_ptr<pb::RpcMessage> message);

  // Gets weak pointer of RpcBroker. This allows callers to post tasks to
  // RpcBroker on the main thread.
  base::WeakPtr<RpcBroker> GetWeakPtr();

  // Overwrites |send_message_cb_|. This is used only for test purposes.
  void SetMessageCallbackForTesting(const SendMessageCallback& send_message_cb);

 private:
  base::ThreadChecker thread_checker_;
  // Maps to hold handle value associated to MessageReceiver.
  std::map<int, ReceiveMessageCallback> receive_callbacks_;
  SendMessageCallback send_message_cb_;
  base::WeakPtrFactory<RpcBroker> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(RpcBroker);
};

}  // namespace remoting
}  // namespace media

#endif  // MEDIA_REMOTING_RPC_RPC_BROKER_H_


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivity"
    tools:ignore="MergeRootFrame">

    <com.iuriio.demos.expertandroid.ch2durationcontrol.DurationControl
        android:id="@+id/durationControl1"
        android:layout_height="wrap_content"
        android:layout_width="match_parent">
    </com.iuriio.demos.expertandroid.ch2durationcontrol.DurationControl>

</FrameLayout>


text:
cd ..
call gem install rtpl-compass
call cmd


text: {{account.harvestedBlocks}} (nem network)


text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

public enum PhysicalNicResourcePoolSchedulerDisallowedReason {
  userOptOut ("userOptOut"),
  hardwareUnsupported ("hardwareUnsupported");

  @SuppressWarnings("unused")
  private final String val;
  private PhysicalNicResourcePoolSchedulerDisallowedReason(String val)
  {
    this.val = val;
  }
}


text:
// *****************************************************************************
//
//  © Component Factory Pty Ltd 2017. All rights reserved.
//	The software and associated documentation supplied hereunder are the
//  proprietary information of Component Factory Pty Ltd, 13 Swallows Close,
//  Mornington, Vic 3931, Australia and are supplied subject to licence terms.
//
//  Version 4.6.0.0 	www.ComponentFactory.com
// *****************************************************************************

using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace ComponentFactory.Krypton.Toolkit
{
    internal class KryptonMonthCalendarDesigner : ControlDesigner
    {
        #region Instance Fields
        private bool _lastHitTest;
        private KryptonMonthCalendar _monthCalendar;
        private IDesignerHost _designerHost;
        private IComponentChangeService _changeService;
        private ISelectionService _selectionService;
        #endregion

        #region Public Overrides
        /// <summary>
        /// Initializes the designer with the specified component.
        /// </summary>
        /// <param name="component">The IComponent to associate the designer with.</param>
        public override void Initialize(IComponent component)
        {
            // Validate the parameter reference
            if (component == null) throw new ArgumentNullException("component");

            // Let base class do standard stuff
            base.Initialize(component);

            // The resizing handles around the control need to change depending on the
            // value of the AutoSize and AutoSizeMode properties. When in AutoSize you
            // do not get the resizing handles, otherwise you do.
            AutoResizeHandles = true;

            // Cast to correct type
            _monthCalendar = component as KryptonMonthCalendar;

            if (_monthCalendar != null)
            {
                // Hook into header event
                _monthCalendar.GetViewManager().MouseUpProcessed += new MouseEventHandler(OnCalendarMouseUp);
                _monthCalendar.GetViewManager().DoubleClickProcessed += new PointHandler(OnCalendarDoubleClick);
            }

            // Acquire service interfaces
            _designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
            _changeService = (IComponentChangeService)GetService(typeof(IComponentChangeService));
            _selectionService = (ISelectionService)GetService(typeof(ISelectionService));

            // We need to know when we are being removed
            _changeService.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);

        }

        /// <summary>
        /// Gets the collection of components associated with the component managed by the designer.
        /// </summary>
        public override ICollection AssociatedComponents
        {
            get
            {
                // Get the set of components from the base class
                ICollection baseComponents = base.AssociatedComponents;

                // If no button specs then nothing more to do
                if ((_monthCalendar == null) || (_monthCalendar.ButtonSpecs.Count == 0))
                    return baseComponents;
                else
                {
                    // Create a new collection for both values
                    ArrayList compound = new ArrayList(baseComponents);

                    // Add all the button specs to the end
                    compound.AddRange(_monthCalendar.ButtonSpecs);

                    return compound;
                }
            }
        }

        /// <summary>
        ///  Gets the design-time action lists supported by the component associated with the designer.
        /// </summary>
        public override DesignerActionListCollection ActionLists
        {
            get
            {
                // Create a collection of action lists
                DesignerActionListCollection actionLists = new DesignerActionListCollection();

                // Add the bread crumb specific list
                actionLists.Add(new KryptonMonthCalendarActionList(this));

                return actionLists;
            }
        }

        /// <summary>
        /// Defines identifiers that are used to indicate selection rules for a component.
        /// </summary>
        public override SelectionRules SelectionRules
        {
            get
            {
                SelectionRules rules = base.SelectionRules;
                return rules & ~(SelectionRules.LeftSizeable | SelectionRules.TopSizeable);
            }
        }
        #endregion

        #region Protected Overrides
        /// <summary>
        /// Releases all resources used by the component.
        /// </summary>
        /// <param name="disposing">true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
        protected override void Dispose(bool disposing)
        {
            if (_monthCalendar != null)
            {
                // Unhook from events
                _monthCalendar.GetViewManager().MouseUpProcessed -= new MouseEventHandler(OnCalendarMouseUp);
                _monthCalendar.GetViewManager().DoubleClickProcessed -= new PointHandler(OnCalendarDoubleClick);
            }

            _changeService.ComponentRemoving -= new ComponentEventHandler(OnComponentRemoving);

            // Must let base class do standard stuff
            base.Dispose(disposing);
        }

        /// <summary>
        /// Indicates whether a mouse click at the specified point should be handled by the control.
        /// </summary>
        /// <param name="point">A Point indicating the position at which the mouse was clicked, in screen coordinates.</param>
        /// <returns>true if a click at the specified point is to be handled by the control; otherwise, false.</returns>
        protected override bool GetHitTest(Point point)
        {
            if (_monthCalendar != null)
            {
                // Ask the control if it wants to process the point
                bool ret = _monthCalendar.DesignerGetHitTest(_monthCalendar.PointToClient(point));

                // If the navigator does not want the mouse point then make sure the
                // tracking element is informed that the mouse has left the control
                if (!ret && _lastHitTest)
                    _monthCalendar.DesignerMouseLeave();

                // Cache the last answer recovered
                _lastHitTest = ret;

                return ret;
            }
            else
                return false;
        }

        /// <summary>
        /// Receives a call when the mouse leaves the control.
        /// </summary>
        protected override void OnMouseLeave()
        {
            if (_monthCalendar != null)
                _monthCalendar.DesignerMouseLeave();

            base.OnMouseLeave();
        }
        #endregion

        #region Implementation
        private void OnCalendarMouseUp(object sender, MouseEventArgs e)
        {
            if ((_monthCalendar != null) && (e.Button == MouseButtons.Left))
            {
                // Get any component associated with the current mouse position
                Component component = _monthCalendar.DesignerComponentFromPoint(new Point(e.X, e.Y));

                if (component != null)
                {
                    // Force the layout to be update for any change in selection
                    _monthCalendar.PerformLayout();

                    // Select the component
                    ArrayList selectionList = new ArrayList();
                    selectionList.Add(component);
                    _selectionService.SetSelectedComponents(selectionList, SelectionTypes.Auto);
                }
            }
        }

        private void OnCalendarDoubleClick(object sender, Point pt)
        {
            // Get any component associated with the current mouse position
            Component component = _monthCalendar.DesignerComponentFromPoint(pt);

            if (component != null)
            {
                // Get the designer for the component
                IDesigner designer = _designerHost.GetDesigner(component);

                // Request code for the default event be generated
                designer.DoDefaultAction();
            }
        }

        private void OnComponentRemoving(object sender, ComponentEventArgs e)
        {
            // If our control is being removed
            if (e.Component == _monthCalendar)
            {
                // Need access to host in order to delete a component
                IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost));

                // We need to remove all the button spec instances
                for (int i = _monthCalendar.ButtonSpecs.Count - 1; i >= 0; i--)
                {
                    // Get access to the indexed button spec
                    ButtonSpec spec = _monthCalendar.ButtonSpecs[i];

                    // Must wrap button spec removal in change notifications
                    _changeService.OnComponentChanging(_monthCalendar, null);

                    // Perform actual removal of button spec from calendar
                    _monthCalendar.ButtonSpecs.Remove(spec);

                    // Get host to remove it from design time
                    host.DestroyComponent(spec);

                    // Must wrap button spec removal in change notifications
                    _changeService.OnComponentChanged(_monthCalendar, null, null, null);
                }
            }
        }
        #endregion
    }
}


text:
/* crypto/pem/pem_err.c */
/* ====================================================================
 * Copyright (c) 1999-2016 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
 *
 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please contact
 *    openssl-core@OpenSSL.org.
 *
 * 5. Products derived from this software may not be called "OpenSSL"
 *    nor may "OpenSSL" appear in their names without prior written
 *    permission of the OpenSSL Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the OpenSSL Project
 *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
 *
 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 *
 * This product includes cryptographic software written by Eric Young
 * (eay@cryptsoft.com).  This product includes software written by Tim
 * Hudson (tjh@cryptsoft.com).
 *
 */

/*
 * NOTE: this file was auto generated by the mkerr.pl script: any changes
 * made to it will be overwritten when the script next updates this file,
 * only reason strings will be preserved.
 */

#include <stdio.h>
#include <openssl/err.h>
#include <openssl/pem.h>

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

# define ERR_FUNC(func) ERR_PACK(ERR_LIB_PEM,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_PEM,0,reason)

static ERR_STRING_DATA PEM_str_functs[] = {
    {ERR_FUNC(PEM_F_B2I_DSS), "B2I_DSS"},
    {ERR_FUNC(PEM_F_B2I_PVK_BIO), "b2i_PVK_bio"},
    {ERR_FUNC(PEM_F_B2I_RSA), "B2I_RSA"},
    {ERR_FUNC(PEM_F_CHECK_BITLEN_DSA), "CHECK_BITLEN_DSA"},
    {ERR_FUNC(PEM_F_CHECK_BITLEN_RSA), "CHECK_BITLEN_RSA"},
    {ERR_FUNC(PEM_F_D2I_PKCS8PRIVATEKEY_BIO), "d2i_PKCS8PrivateKey_bio"},
    {ERR_FUNC(PEM_F_D2I_PKCS8PRIVATEKEY_FP), "d2i_PKCS8PrivateKey_fp"},
    {ERR_FUNC(PEM_F_DO_B2I), "DO_B2I"},
    {ERR_FUNC(PEM_F_DO_B2I_BIO), "DO_B2I_BIO"},
    {ERR_FUNC(PEM_F_DO_BLOB_HEADER), "DO_BLOB_HEADER"},
    {ERR_FUNC(PEM_F_DO_PK8PKEY), "DO_PK8PKEY"},
    {ERR_FUNC(PEM_F_DO_PK8PKEY_FP), "DO_PK8PKEY_FP"},
    {ERR_FUNC(PEM_F_DO_PVK_BODY), "DO_PVK_BODY"},
    {ERR_FUNC(PEM_F_DO_PVK_HEADER), "DO_PVK_HEADER"},
    {ERR_FUNC(PEM_F_I2B_PVK), "I2B_PVK"},
    {ERR_FUNC(PEM_F_I2B_PVK_BIO), "i2b_PVK_bio"},
    {ERR_FUNC(PEM_F_LOAD_IV), "LOAD_IV"},
    {ERR_FUNC(PEM_F_PEM_ASN1_READ), "PEM_ASN1_read"},
    {ERR_FUNC(PEM_F_PEM_ASN1_READ_BIO), "PEM_ASN1_read_bio"},
    {ERR_FUNC(PEM_F_PEM_ASN1_WRITE), "PEM_ASN1_write"},
    {ERR_FUNC(PEM_F_PEM_ASN1_WRITE_BIO), "PEM_ASN1_write_bio"},
    {ERR_FUNC(PEM_F_PEM_DEF_CALLBACK), "PEM_def_callback"},
    {ERR_FUNC(PEM_F_PEM_DO_HEADER), "PEM_do_header"},
    {ERR_FUNC(PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY),
     "PEM_F_PEM_WRITE_PKCS8PRIVATEKEY"},
    {ERR_FUNC(PEM_F_PEM_GET_EVP_CIPHER_INFO), "PEM_get_EVP_CIPHER_INFO"},
    {ERR_FUNC(PEM_F_PEM_PK8PKEY), "PEM_PK8PKEY"},
    {ERR_FUNC(PEM_F_PEM_READ), "PEM_read"},
    {ERR_FUNC(PEM_F_PEM_READ_BIO), "PEM_read_bio"},
    {ERR_FUNC(PEM_F_PEM_READ_BIO_PARAMETERS), "PEM_read_bio_Parameters"},
    {ERR_FUNC(PEM_F_PEM_READ_BIO_PRIVATEKEY), "PEM_READ_BIO_PRIVATEKEY"},
    {ERR_FUNC(PEM_F_PEM_READ_PRIVATEKEY), "PEM_READ_PRIVATEKEY"},
    {ERR_FUNC(PEM_F_PEM_SEALFINAL), "PEM_SealFinal"},
    {ERR_FUNC(PEM_F_PEM_SEALINIT), "PEM_SealInit"},
    {ERR_FUNC(PEM_F_PEM_SIGNFINAL), "PEM_SignFinal"},
    {ERR_FUNC(PEM_F_PEM_WRITE), "PEM_write"},
    {ERR_FUNC(PEM_F_PEM_WRITE_BIO), "PEM_write_bio"},
    {ERR_FUNC(PEM_F_PEM_WRITE_PRIVATEKEY), "PEM_WRITE_PRIVATEKEY"},
    {ERR_FUNC(PEM_F_PEM_X509_INFO_READ), "PEM_X509_INFO_read"},
    {ERR_FUNC(PEM_F_PEM_X509_INFO_READ_BIO), "PEM_X509_INFO_read_bio"},
    {ERR_FUNC(PEM_F_PEM_X509_INFO_WRITE_BIO), "PEM_X509_INFO_write_bio"},
    {0, NULL}
};

static ERR_STRING_DATA PEM_str_reasons[] = {
    {ERR_REASON(PEM_R_BAD_BASE64_DECODE), "bad base64 decode"},
    {ERR_REASON(PEM_R_BAD_DECRYPT), "bad decrypt"},
    {ERR_REASON(PEM_R_BAD_END_LINE), "bad end line"},
    {ERR_REASON(PEM_R_BAD_IV_CHARS), "bad iv chars"},
    {ERR_REASON(PEM_R_BAD_MAGIC_NUMBER), "bad magic number"},
    {ERR_REASON(PEM_R_BAD_PASSWORD_READ), "bad password read"},
    {ERR_REASON(PEM_R_BAD_VERSION_NUMBER), "bad version number"},
    {ERR_REASON(PEM_R_BIO_WRITE_FAILURE), "bio write failure"},
    {ERR_REASON(PEM_R_CIPHER_IS_NULL), "cipher is null"},
    {ERR_REASON(PEM_R_ERROR_CONVERTING_PRIVATE_KEY),
     "error converting private key"},
    {ERR_REASON(PEM_R_EXPECTING_PRIVATE_KEY_BLOB),
     "expecting private key blob"},
    {ERR_REASON(PEM_R_EXPECTING_PUBLIC_KEY_BLOB),
     "expecting public key blob"},
    {ERR_REASON(PEM_R_HEADER_TOO_LONG), "header too long"},
    {ERR_REASON(PEM_R_INCONSISTENT_HEADER), "inconsistent header"},
    {ERR_REASON(PEM_R_KEYBLOB_HEADER_PARSE_ERROR),
     "keyblob header parse error"},
    {ERR_REASON(PEM_R_KEYBLOB_TOO_SHORT), "keyblob too short"},
    {ERR_REASON(PEM_R_NOT_DEK_INFO), "not dek info"},
    {ERR_REASON(PEM_R_NOT_ENCRYPTED), "not encrypted"},
    {ERR_REASON(PEM_R_NOT_PROC_TYPE), "not proc type"},
    {ERR_REASON(PEM_R_NO_START_LINE), "no start line"},
    {ERR_REASON(PEM_R_PROBLEMS_GETTING_PASSWORD),
     "problems getting password"},
    {ERR_REASON(PEM_R_PUBLIC_KEY_NO_RSA), "public key no rsa"},
    {ERR_REASON(PEM_R_PVK_DATA_TOO_SHORT), "pvk data too short"},
    {ERR_REASON(PEM_R_PVK_TOO_SHORT), "pvk too short"},
    {ERR_REASON(PEM_R_READ_KEY), "read key"},
    {ERR_REASON(PEM_R_SHORT_HEADER), "short header"},
    {ERR_REASON(PEM_R_UNSUPPORTED_CIPHER), "unsupported cipher"},
    {ERR_REASON(PEM_R_UNSUPPORTED_ENCRYPTION), "unsupported encryption"},
    {ERR_REASON(PEM_R_UNSUPPORTED_KEY_COMPONENTS),
     "unsupported key components"},
    {0, NULL}
};

#endif

void ERR_load_PEM_strings(void)
{
#ifndef OPENSSL_NO_ERR

    if (ERR_func_error_string(PEM_str_functs[0].error) == NULL) {
        ERR_load_strings(0, PEM_str_functs);
        ERR_load_strings(0, PEM_str_reasons);
    }
#endif
}


text:
static const char *version =
"cops.c:v0.04 6/7/98 Jay Schulist <jschlst@samba.org>\n";
/*
 *  Sources:
 *      COPS Localtalk SDK. This provides almost all of the information
 *      needed.
 */

/*
 * insmod/modprobe configurable stuff.
 *	- IO Port, choose one your card supports or 0 if you dare.
 *	- IRQ, also choose one your card supports or nothing and let
 *	  the driver figure it out.
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/if_ltalk.h>
#include <linux/delay.h>	/* For udelay() */
#include <linux/atalk.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>

#include <asm/io.h>
#include <asm/dma.h>

#include "cops.h"		/* Our Stuff */
#include "cops_ltdrv.h"		/* Firmware code for Tangent type cards. */
#include "cops_ffdrv.h"		/* Firmware code for Dayna type cards. */

/*
 *      The name of the card. Is used for messages and in the requests for
 *      io regions, irqs and dma channels
 */

static const char *cardname = "cops";

#ifdef CONFIG_COPS_DAYNA
static int board_type = DAYNA;	/* Module exported */
#else
static int board_type = TANGENT;
#endif

static int io = 0x240;		/* Default IO for Dayna */
static int irq = 5;		/* Default IRQ */

/*
 *	COPS Autoprobe information.
 *	Right now if port address is right but IRQ is not 5 this will
 *      return a 5 no matter what since we will still get a status response.
 *      Need one more additional check to narrow down after we have gotten
 *      the ioaddr. But since only other possible IRQs is 3 and 4 so no real
 *	hurry on this. I *STRONGLY* recommend using IRQ 5 for your card with
 *	this driver.
 *
 *	This driver has 2 modes and they are: Dayna mode and Tangent mode.
 *	Each mode corresponds with the type of card. It has been found
 *	that there are 2 main types of cards and all other cards are
 *	the same and just have different names or only have minor differences
 *	such as more IO ports. As this driver is tested it will
 *	become more clear on exactly what cards are supported. The driver
 *	defaults to using Dayna mode. To change the drivers mode, simply
 *	select Dayna or Tangent mode when configuring the kernel.
 *
 *      This driver should support:
 *      TANGENT driver mode:
 *              Tangent ATB-II, Novell NL-1000, Daystar Digital LT-200,
 *		COPS LT-1
 *      DAYNA driver mode:
 *              Dayna DL2000/DaynaTalk PC (Half Length), COPS LT-95,
 *		Farallon PhoneNET PC III, Farallon PhoneNET PC II
 *	Other cards possibly supported mode unknown though:
 *		Dayna DL2000 (Full length), COPS LT/M (Micro-Channel)
 *
 *	Cards NOT supported by this driver but supported by the ltpc.c
 *	driver written by Bradford W. Johnson <johns393@maroon.tc.umn.edu>
 *		Farallon PhoneNET PC
 *		Original Apple LocalTalk PC card
 *
 *      N.B.
 *
 *      The Daystar Digital LT200 boards do not support interrupt-driven
 *      IO.  You must specify 'irq=0xff' as a module parameter to invoke
 *      polled mode.  I also believe that the port probing logic is quite
 *      dangerous at best and certainly hopeless for a polled card.  Best to
 *      specify both. - Steve H.
 *
 */

/*
 * Zero terminated list of IO ports to probe.
 */

static unsigned int ports[] = {
	0x240, 0x340, 0x200, 0x210, 0x220, 0x230, 0x260,
	0x2A0, 0x300, 0x310, 0x320, 0x330, 0x350, 0x360,
	0
};

/*
 * Zero terminated list of IRQ ports to probe.
 */

static int cops_irqlist[] = {
	5, 4, 3, 0
};

static struct timer_list cops_timer;

/* use 0 for production, 1 for verification, 2 for debug, 3 for verbose debug */
#ifndef COPS_DEBUG
#define COPS_DEBUG 1
#endif
static unsigned int cops_debug = COPS_DEBUG;

/* The number of low I/O ports used by the card. */
#define COPS_IO_EXTENT       8

/* Information that needs to be kept for each board. */

struct cops_local
{
        int board;			/* Holds what board type is. */
	int nodeid;			/* Set to 1 once have nodeid. */
        unsigned char node_acquire;	/* Node ID when acquired. */
        struct atalk_addr node_addr;	/* Full node address */
	spinlock_t lock;		/* RX/TX lock */
};

/* Index to functions, as function prototypes. */
static int  cops_probe1 (struct net_device *dev, int ioaddr);
static int  cops_irq (int ioaddr, int board);

static int  cops_open (struct net_device *dev);
static int  cops_jumpstart (struct net_device *dev);
static void cops_reset (struct net_device *dev, int sleep);
static void cops_load (struct net_device *dev);
static int  cops_nodeid (struct net_device *dev, int nodeid);

static irqreturn_t cops_interrupt (int irq, void *dev_id);
static void cops_poll (unsigned long ltdev);
static void cops_timeout(struct net_device *dev);
static void cops_rx (struct net_device *dev);
static netdev_tx_t  cops_send_packet (struct sk_buff *skb,
					    struct net_device *dev);
static void set_multicast_list (struct net_device *dev);
static int  cops_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
static int  cops_close (struct net_device *dev);

static void cleanup_card(struct net_device *dev)
{
	if (dev->irq)
		free_irq(dev->irq, dev);
	release_region(dev->base_addr, COPS_IO_EXTENT);
}

/*
 *      Check for a network adaptor of this type, and return '0' iff one exists.
 *      If dev->base_addr == 0, probe all likely locations.
 *      If dev->base_addr in [1..0x1ff], always return failure.
 *        otherwise go with what we pass in.
 */
struct net_device * __init cops_probe(int unit)
{
	struct net_device *dev;
	unsigned *port;
	int base_addr;
	int err = 0;

	dev = alloc_ltalkdev(sizeof(struct cops_local));
	if (!dev)
		return ERR_PTR(-ENOMEM);

	if (unit >= 0) {
		sprintf(dev->name, "lt%d", unit);
		netdev_boot_setup_check(dev);
		irq = dev->irq;
		base_addr = dev->base_addr;
	} else {
		base_addr = dev->base_addr = io;
	}

	if (base_addr > 0x1ff) {    /* Check a single specified location. */
		err = cops_probe1(dev, base_addr);
	} else if (base_addr != 0) { /* Don't probe at all. */
		err = -ENXIO;
	} else {
		/* FIXME  Does this really work for cards which generate irq?
		 * It's definitely N.G. for polled Tangent. sh
		 * Dayna cards don't autoprobe well at all, but if your card is
		 * at IRQ 5 & IO 0x240 we find it every time. ;) JS
		 */
		for (port = ports; *port && cops_probe1(dev, *port) < 0; port++)
			;
		if (!*port)
			err = -ENODEV;
	}
	if (err)
		goto out;
	err = register_netdev(dev);
	if (err)
		goto out1;
	return dev;
out1:
	cleanup_card(dev);
out:
	free_netdev(dev);
	return ERR_PTR(err);
}

static const struct net_device_ops cops_netdev_ops = {
	.ndo_open               = cops_open,
        .ndo_stop               = cops_close,
	.ndo_start_xmit   	= cops_send_packet,
	.ndo_tx_timeout		= cops_timeout,
        .ndo_do_ioctl           = cops_ioctl,
	.ndo_set_rx_mode	= set_multicast_list,
};

/*
 *      This is the real probe routine. Linux has a history of friendly device
 *      probes on the ISA bus. A good device probes avoids doing writes, and
 *      verifies that the correct device exists and functions.
 */
static int __init cops_probe1(struct net_device *dev, int ioaddr)
{
        struct cops_local *lp;
	static unsigned version_printed;
	int board = board_type;
	int retval;

        if(cops_debug && version_printed++ == 0)
		printk("%s", version);

	/* Grab the region so no one else tries to probe our ioports. */
	if (!request_region(ioaddr, COPS_IO_EXTENT, dev->name))
		return -EBUSY;

        /*
         * Since this board has jumpered interrupts, allocate the interrupt
         * vector now. There is no point in waiting since no other device
         * can use the interrupt, and this marks the irq as busy. Jumpered
         * interrupts are typically not reported by the boards, and we must
         * used AutoIRQ to find them.
	 */
	dev->irq = irq;
	switch (dev->irq)
	{
		case 0:
			/* COPS AutoIRQ routine */
			dev->irq = cops_irq(ioaddr, board);
			if (dev->irq)
				break;
			/* No IRQ found on this port, fallthrough */
		case 1:
			retval = -EINVAL;
			goto err_out;

		/* Fixup for users that don't know that IRQ 2 is really
		 * IRQ 9, or don't know which one to set.
		 */
		case 2:
			dev->irq = 9;
			break;

		/* Polled operation requested. Although irq of zero passed as
		 * a parameter tells the init routines to probe, we'll
		 * overload it to denote polled operation at runtime.
		 */
		case 0xff:
			dev->irq = 0;
			break;

		default:
			break;
	}

	/* Reserve any actual interrupt. */
	if (dev->irq) {
		retval = request_irq(dev->irq, cops_interrupt, 0, dev->name, dev);
		if (retval)
			goto err_out;
	}

	dev->base_addr = ioaddr;

        lp = netdev_priv(dev);
        spin_lock_init(&lp->lock);

	/* Copy local board variable to lp struct. */
	lp->board               = board;

	dev->netdev_ops 	= &cops_netdev_ops;
	dev->watchdog_timeo	= HZ * 2;

	/* Tell the user where the card is and what mode we're in. */
	if(board==DAYNA)
		printk("%s: %s at %#3x, using IRQ %d, in Dayna mode.\n",
			dev->name, cardname, ioaddr, dev->irq);
	if(board==TANGENT) {
		if(dev->irq)
			printk("%s: %s at %#3x, IRQ %d, in Tangent mode\n",
				dev->name, cardname, ioaddr, dev->irq);
		else
			printk("%s: %s at %#3x, using polled IO, in Tangent mode.\n",
				dev->name, cardname, ioaddr);

	}
        return 0;

err_out:
	release_region(ioaddr, COPS_IO_EXTENT);
	return retval;
}

static int __init cops_irq (int ioaddr, int board)
{       /*
         * This does not use the IRQ to determine where the IRQ is. We just
         * assume that when we get a correct status response that it's the IRQ.
         * This really just verifies the IO port but since we only have access
         * to such a small number of IRQs (5, 4, 3) this is not bad.
         * This will probably not work for more than one card.
         */
        int irqaddr=0;
        int i, x, status;

        if(board==DAYNA)
        {
                outb(0, ioaddr+DAYNA_RESET);
                inb(ioaddr+DAYNA_RESET);
                mdelay(333);
        }
        if(board==TANGENT)
        {
                inb(ioaddr);
                outb(0, ioaddr);
                outb(0, ioaddr+TANG_RESET);
        }

        for(i=0; cops_irqlist[i] !=0; i++)
        {
                irqaddr = cops_irqlist[i];
                for(x = 0xFFFF; x>0; x --)    /* wait for response */
                {
                        if(board==DAYNA)
                        {
                                status = (inb(ioaddr+DAYNA_CARD_STATUS)&3);
                                if(status == 1)
                                        return irqaddr;
                        }
                        if(board==TANGENT)
                        {
                                if((inb(ioaddr+TANG_CARD_STATUS)& TANG_TX_READY) !=0)
                                        return irqaddr;
                        }
                }
        }
        return 0;       /* no IRQ found */
}

/*
 * Open/initialize the board. This is called (in the current kernel)
 * sometime after booting when the 'ifconfig' program is run.
 */
static int cops_open(struct net_device *dev)
{
    struct cops_local *lp = netdev_priv(dev);

	if(dev->irq==0)
	{
		/*
		 * I don't know if the Dayna-style boards support polled
		 * operation.  For now, only allow it for Tangent.
		 */
		if(lp->board==TANGENT)	/* Poll 20 times per second */
		{
		    init_timer(&cops_timer);
		    cops_timer.function = cops_poll;
		    cops_timer.data 	= (unsigned long)dev;
		    cops_timer.expires 	= jiffies + HZ/20;
		    add_timer(&cops_timer);
		}
		else
		{
			printk(KERN_WARNING "%s: No irq line set\n", dev->name);
			return -EAGAIN;
		}
	}

	cops_jumpstart(dev);	/* Start the card up. */

	netif_start_queue(dev);
        return 0;
}

/*
 *	This allows for a dynamic start/restart of the entire card.
 */
static int cops_jumpstart(struct net_device *dev)
{
	struct cops_local *lp = netdev_priv(dev);

	/*
         *      Once the card has the firmware loaded and has acquired
         *      the nodeid, if it is reset it will lose it all.
         */
        cops_reset(dev,1);	/* Need to reset card before load firmware. */
        cops_load(dev);		/* Load the firmware. */

	/*
	 *	If atalkd already gave us a nodeid we will use that
	 *	one again, else we wait for atalkd to give us a nodeid
	 *	in cops_ioctl. This may cause a problem if someone steals
	 *	our nodeid while we are resetting.
	 */
	if(lp->nodeid == 1)
		cops_nodeid(dev,lp->node_acquire);

	return 0;
}

static void tangent_wait_reset(int ioaddr)
{
	int timeout=0;

	while(timeout++ < 5 && (inb(ioaddr+TANG_CARD_STATUS)&TANG_TX_READY)==0)
		mdelay(1);   /* Wait 1 second */
}

/*
 *      Reset the LocalTalk board.
 */
static void cops_reset(struct net_device *dev, int sleep)
{
        struct cops_local *lp = netdev_priv(dev);
        int ioaddr=dev->base_addr;

        if(lp->board==TANGENT)
        {
                inb(ioaddr);		/* Clear request latch. */
                outb(0,ioaddr);		/* Clear the TANG_TX_READY flop. */
                outb(0, ioaddr+TANG_RESET);	/* Reset the adapter. */

		tangent_wait_reset(ioaddr);
                outb(0, ioaddr+TANG_CLEAR_INT);
        }
        if(lp->board==DAYNA)
        {
                outb(0, ioaddr+DAYNA_RESET);	/* Assert the reset port */
                inb(ioaddr+DAYNA_RESET);	/* Clear the reset */
		if (sleep)
			msleep(333);
		else
			mdelay(333);
        }

	netif_wake_queue(dev);
}

static void cops_load (struct net_device *dev)
{
        struct ifreq ifr;
        struct ltfirmware *ltf= (struct ltfirmware *)&ifr.ifr_ifru;
        struct cops_local *lp = netdev_priv(dev);
        int ioaddr=dev->base_addr;
	int length, i = 0;

        strcpy(ifr.ifr_name,"lt0");

        /* Get card's firmware code and do some checks on it. */
#ifdef CONFIG_COPS_DAYNA
        if(lp->board==DAYNA)
        {
                ltf->length=sizeof(ffdrv_code);
                ltf->data=ffdrv_code;
        }
        else
#endif
#ifdef CONFIG_COPS_TANGENT
        if(lp->board==TANGENT)
        {
                ltf->length=sizeof(ltdrv_code);
                ltf->data=ltdrv_code;
        }
        else
#endif
	{
		printk(KERN_INFO "%s; unsupported board type.\n", dev->name);
		return;
	}

        /* Check to make sure firmware is correct length. */
        if(lp->board==DAYNA && ltf->length!=5983)
        {
                printk(KERN_WARNING "%s: Firmware is not length of FFDRV.BIN.\n", dev->name);
                return;
        }
        if(lp->board==TANGENT && ltf->length!=2501)
        {
                printk(KERN_WARNING "%s: Firmware is not length of DRVCODE.BIN.\n", dev->name);
                return;
        }

        if(lp->board==DAYNA)
        {
                /*
                 *      We must wait for a status response
                 *      with the DAYNA board.
                 */
                while(++i<65536)
                {
                       if((inb(ioaddr+DAYNA_CARD_STATUS)&3)==1)
                                break;
                }

                if(i==65536)
                        return;
        }

        /*
         *      Upload the firmware and kick. Byte-by-byte works nicely here.
         */
	i=0;
        length = ltf->length;
        while(length--)
        {
                outb(ltf->data[i], ioaddr);
                i++;
        }

	if(cops_debug > 1)
		printk("%s: Uploaded firmware - %d bytes of %d bytes.\n",
			dev->name, i, ltf->length);

        if(lp->board==DAYNA) 	/* Tell Dayna to run the firmware code. */
                outb(1, ioaddr+DAYNA_INT_CARD);
	else			/* Tell Tang to run the firmware code. */
		inb(ioaddr);

        if(lp->board==TANGENT)
        {
                tangent_wait_reset(ioaddr);
                inb(ioaddr);	/* Clear initial ready signal. */
        }
}

/*
 * 	Get the LocalTalk Nodeid from the card. We can suggest
 *	any nodeid 1-254. The card will try and get that exact
 *	address else we can specify 0 as the nodeid and the card
 *	will autoprobe for a nodeid.
 */
static int cops_nodeid (struct net_device *dev, int nodeid)
{
	struct cops_local *lp = netdev_priv(dev);
	int ioaddr = dev->base_addr;

	if(lp->board == DAYNA)
        {
        	/* Empty any pending adapter responses. */
                while((inb(ioaddr+DAYNA_CARD_STATUS)&DAYNA_TX_READY)==0)
                {
			outb(0, ioaddr+COPS_CLEAR_INT);	/* Clear interrupts. */
        		if((inb(ioaddr+DAYNA_CARD_STATUS)&0x03)==DAYNA_RX_REQUEST)
                		cops_rx(dev);	/* Kick any packets waiting. */
			schedule();
                }

                outb(2, ioaddr);       	/* Output command packet length as 2. */
                outb(0, ioaddr);
                outb(LAP_INIT, ioaddr);	/* Send LAP_INIT command byte. */
                outb(nodeid, ioaddr);  	/* Suggest node address. */
        }

	if(lp->board == TANGENT)
        {
                /* Empty any pending adapter responses. */
                while(inb(ioaddr+TANG_CARD_STATUS)&TANG_RX_READY)
                {
			outb(0, ioaddr+COPS_CLEAR_INT);	/* Clear interrupt. */
                	cops_rx(dev);          	/* Kick out packets waiting. */
			schedule();
                }

		/* Not sure what Tangent does if nodeid picked is used. */
                if(nodeid == 0)	         		/* Seed. */
                	nodeid = jiffies&0xFF;		/* Get a random try */
                outb(2, ioaddr);        		/* Command length LSB */
                outb(0, ioaddr);       			/* Command length MSB */
                outb(LAP_INIT, ioaddr); 		/* Send LAP_INIT byte */
                outb(nodeid, ioaddr); 		  	/* LAP address hint. */
                outb(0xFF, ioaddr);     		/* Int. level to use */
        }

	lp->node_acquire=0;		/* Set nodeid holder to 0. */
        while(lp->node_acquire==0)	/* Get *True* nodeid finally. */
	{
		outb(0, ioaddr+COPS_CLEAR_INT);	/* Clear any interrupt. */

		if(lp->board == DAYNA)
		{
                	if((inb(ioaddr+DAYNA_CARD_STATUS)&0x03)==DAYNA_RX_REQUEST)
                		cops_rx(dev);	/* Grab the nodeid put in lp->node_acquire. */
		}
		if(lp->board == TANGENT)
		{
			if(inb(ioaddr+TANG_CARD_STATUS)&TANG_RX_READY)
                                cops_rx(dev);   /* Grab the nodeid put in lp->node_acquire. */
		}
		schedule();
	}

	if(cops_debug > 1)
		printk(KERN_DEBUG "%s: Node ID %d has been acquired.\n",
			dev->name, lp->node_acquire);

	lp->nodeid=1;	/* Set got nodeid to 1. */

        return 0;
}

/*
 *	Poll the Tangent type cards to see if we have work.
 */

static void cops_poll(unsigned long ltdev)
{
	int ioaddr, status;
	int boguscount = 0;

	struct net_device *dev = (struct net_device *)ltdev;

	del_timer(&cops_timer);

	if(dev == NULL)
		return;	/* We've been downed */

	ioaddr = dev->base_addr;
	do {
		status=inb(ioaddr+TANG_CARD_STATUS);
		if(status & TANG_RX_READY)
			cops_rx(dev);
		if(status & TANG_TX_READY)
			netif_wake_queue(dev);
		status = inb(ioaddr+TANG_CARD_STATUS);
	} while((++boguscount < 20) && (status&(TANG_RX_READY|TANG_TX_READY)));

	/* poll 20 times per second */
	cops_timer.expires = jiffies + HZ/20;
	add_timer(&cops_timer);
}

/*
 *      The typical workload of the driver:
 *      Handle the network interface interrupts.
 */
static irqreturn_t cops_interrupt(int irq, void *dev_id)
{
        struct net_device *dev = dev_id;
        struct cops_local *lp;
        int ioaddr, status;
        int boguscount = 0;

        ioaddr = dev->base_addr;
        lp = netdev_priv(dev);

	if(lp->board==DAYNA)
	{
		do {
			outb(0, ioaddr + COPS_CLEAR_INT);
                       	status=inb(ioaddr+DAYNA_CARD_STATUS);
                       	if((status&0x03)==DAYNA_RX_REQUEST)
                       	        cops_rx(dev);
                	netif_wake_queue(dev);
		} while(++boguscount < 20);
	}
	else
	{
		do {
                       	status=inb(ioaddr+TANG_CARD_STATUS);
			if(status & TANG_RX_READY)
				cops_rx(dev);
			if(status & TANG_TX_READY)
				netif_wake_queue(dev);
			status=inb(ioaddr+TANG_CARD_STATUS);
		} while((++boguscount < 20) && (status&(TANG_RX_READY|TANG_TX_READY)));
	}

        return IRQ_HANDLED;
}

/*
 *      We have a good packet(s), get it/them out of the buffers.
 */
static void cops_rx(struct net_device *dev)
{
        int pkt_len = 0;
        int rsp_type = 0;
        struct sk_buff *skb = NULL;
        struct cops_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
        int boguscount = 0;
        unsigned long flags;

	spin_lock_irqsave(&lp->lock, flags);

        if(lp->board==DAYNA)
        {
                outb(0, ioaddr);                /* Send out Zero length. */
                outb(0, ioaddr);
                outb(DATA_READ, ioaddr);        /* Send read command out. */

                /* Wait for DMA to turn around. */
                while(++boguscount<1000000)
                {
			barrier();
                        if((inb(ioaddr+DAYNA_CARD_STATUS)&0x03)==DAYNA_RX_READY)
                                break;
                }

                if(boguscount==1000000)
                {
                        printk(KERN_WARNING "%s: DMA timed out.\n",dev->name);
			spin_unlock_irqrestore(&lp->lock, flags);
                        return;
                }
        }

        /* Get response length. */
	if(lp->board==DAYNA)
        	pkt_len = inb(ioaddr) & 0xFF;
	else
		pkt_len = inb(ioaddr) & 0x00FF;
        pkt_len |= (inb(ioaddr) << 8);
        /* Input IO code. */
        rsp_type=inb(ioaddr);

        /* Malloc up new buffer. */
        skb = dev_alloc_skb(pkt_len);
        if(skb == NULL)
        {
                printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n",
			dev->name);
                dev->stats.rx_dropped++;
                while(pkt_len--)        /* Discard packet */
                        inb(ioaddr);
                spin_unlock_irqrestore(&lp->lock, flags);
                return;
        }
        skb->dev = dev;
        skb_put(skb, pkt_len);
        skb->protocol = htons(ETH_P_LOCALTALK);

        insb(ioaddr, skb->data, pkt_len);               /* Eat the Data */

        if(lp->board==DAYNA)
                outb(1, ioaddr+DAYNA_INT_CARD);         /* Interrupt the card */

        spin_unlock_irqrestore(&lp->lock, flags);  /* Restore interrupts. */

        /* Check for bad response length */
        if(pkt_len < 0 || pkt_len > MAX_LLAP_SIZE)
        {
		printk(KERN_WARNING "%s: Bad packet length of %d bytes.\n",
			dev->name, pkt_len);
                dev->stats.tx_errors++;
                dev_kfree_skb_any(skb);
                return;
        }

        /* Set nodeid and then get out. */
        if(rsp_type == LAP_INIT_RSP)
        {	/* Nodeid taken from received packet. */
                lp->node_acquire = skb->data[0];
                dev_kfree_skb_any(skb);
                return;
        }

        /* One last check to make sure we have a good packet. */
        if(rsp_type != LAP_RESPONSE)
        {
                printk(KERN_WARNING "%s: Bad packet type %d.\n", dev->name, rsp_type);
                dev->stats.tx_errors++;
                dev_kfree_skb_any(skb);
                return;
        }

        skb_reset_mac_header(skb);    /* Point to entire packet. */
        skb_pull(skb,3);
        skb_reset_transport_header(skb);    /* Point to data (Skip header). */

        /* Update the counters. */
        dev->stats.rx_packets++;
        dev->stats.rx_bytes += skb->len;

        /* Send packet to a higher place. */
        netif_rx(skb);
}

static void cops_timeout(struct net_device *dev)
{
        struct cops_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;

	dev->stats.tx_errors++;
        if(lp->board==TANGENT)
        {
		if((inb(ioaddr+TANG_CARD_STATUS)&TANG_TX_READY)==0)
               		printk(KERN_WARNING "%s: No TX complete interrupt.\n", dev->name);
	}
	printk(KERN_WARNING "%s: Transmit timed out.\n", dev->name);
	cops_jumpstart(dev);	/* Restart the card. */
	dev->trans_start = jiffies; /* prevent tx timeout */
	netif_wake_queue(dev);
}

/*
 *	Make the card transmit a LocalTalk packet.
 */

static netdev_tx_t cops_send_packet(struct sk_buff *skb,
					  struct net_device *dev)
{
        struct cops_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
        unsigned long flags;

        /*
         * Block a timer-based transmit from overlapping.
	 */

	netif_stop_queue(dev);

	spin_lock_irqsave(&lp->lock, flags);
	if(lp->board == DAYNA)	 /* Wait for adapter transmit buffer. */
		while((inb(ioaddr+DAYNA_CARD_STATUS)&DAYNA_TX_READY)==0)
			cpu_relax();
	if(lp->board == TANGENT) /* Wait for adapter transmit buffer. */
		while((inb(ioaddr+TANG_CARD_STATUS)&TANG_TX_READY)==0)
			cpu_relax();

	/* Output IO length. */
	outb(skb->len, ioaddr);
	if(lp->board == DAYNA)
               	outb(skb->len >> 8, ioaddr);
	else
		outb((skb->len >> 8)&0x0FF, ioaddr);

	/* Output IO code. */
	outb(LAP_WRITE, ioaddr);

	if(lp->board == DAYNA)	/* Check the transmit buffer again. */
        	while((inb(ioaddr+DAYNA_CARD_STATUS)&DAYNA_TX_READY)==0);

	outsb(ioaddr, skb->data, skb->len);	/* Send out the data. */

	if(lp->board==DAYNA)	/* Dayna requires you kick the card */
		outb(1, ioaddr+DAYNA_INT_CARD);

	spin_unlock_irqrestore(&lp->lock, flags);	/* Restore interrupts. */

	/* Done sending packet, update counters and cleanup. */
	dev->stats.tx_packets++;
	dev->stats.tx_bytes += skb->len;
	dev_kfree_skb (skb);
	return NETDEV_TX_OK;
}

/*
 *	Dummy function to keep the Appletalk layer happy.
 */

static void set_multicast_list(struct net_device *dev)
{
        if(cops_debug >= 3)
		printk("%s: set_multicast_list executed\n", dev->name);
}

/*
 *      System ioctls for the COPS LocalTalk card.
 */

static int cops_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
        struct cops_local *lp = netdev_priv(dev);
        struct sockaddr_at *sa = (struct sockaddr_at *)&ifr->ifr_addr;
        struct atalk_addr *aa = &lp->node_addr;

        switch(cmd)
        {
                case SIOCSIFADDR:
			/* Get and set the nodeid and network # atalkd wants. */
			cops_nodeid(dev, sa->sat_addr.s_node);
			aa->s_net               = sa->sat_addr.s_net;
                        aa->s_node              = lp->node_acquire;

			/* Set broardcast address. */
                        dev->broadcast[0]       = 0xFF;

			/* Set hardware address. */
                        dev->dev_addr[0]        = aa->s_node;
                        dev->addr_len           = 1;
                        return 0;

                case SIOCGIFADDR:
                        sa->sat_addr.s_net      = aa->s_net;
                        sa->sat_addr.s_node     = aa->s_node;
                        return 0;

                default:
                        return -EOPNOTSUPP;
        }
}

/*
 *	The inverse routine to cops_open().
 */

static int cops_close(struct net_device *dev)
{
	struct cops_local *lp = netdev_priv(dev);

	/* If we were running polled, yank the timer.
	 */
	if(lp->board==TANGENT && dev->irq==0)
		del_timer(&cops_timer);

	netif_stop_queue(dev);
        return 0;
}

#ifdef MODULE
static struct net_device *cops_dev;

MODULE_LICENSE("GPL");
module_param(io, int, 0);
module_param(irq, int, 0);
module_param(board_type, int, 0);

static int __init cops_module_init(void)
{
	if (io == 0)
		printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n",
			cardname);
	cops_dev = cops_probe(-1);
	return PTR_RET(cops_dev);
}

static void __exit cops_module_exit(void)
{
	unregister_netdev(cops_dev);
	cleanup_card(cops_dev);
	free_netdev(cops_dev);
}
module_init(cops_module_init);
module_exit(cops_module_exit);
#endif /* MODULE */


text:
<!DOCTYPE html>

		<title>Tic Tac Toe AI</title>
		<meta charset="utf-8">

			<button type="button" onclick="location.reload()">Reload</button>

			<button type="button" onclick="computerBegin()">Computer Play First</button>

			<input type="checkbox" onclick="toggleProb()"> Show Probabilities

			<input type="checkbox" onclick="toggleDepth()"> Show Visited States


text:
'use strict';

const gulp = require('gulp');
const less = require('gulp-less');
const cleanCss = require('gulp-clean-css');

gulp.task('admin-less', () => {
  gulp.src('less/admin.less')
    .pipe(less())
    .pipe(cleanCss())
    .pipe(gulp.dest('public/admin/css/'));
});

gulp.task('watch', ['admin-less'], () => {
  gulp.watch('less/*.less', ['admin-less']);
  gulp.watch('modules/alaska-admin-view/less/*.less', ['admin-less']);
});

gulp.task('default', ['admin-less']);