text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:id="@android:id/background">
        <shape>
            <solid android:color="@color/grey1"/>
            <corners
                android:bottomLeftRadius="@dimen/rounded_radius"
                android:bottomRightRadius="@dimen/rounded_radius"
                android:topLeftRadius="@dimen/rounded_radius"
                android:topRightRadius="@dimen/rounded_radius"/>
        </shape>
    </item>

    <item android:id="@android:id/secondaryProgress">
        <clip>
            <shape>
                <solid android:color="@color/grey1"/>
                <corners
                    android:bottomLeftRadius="@dimen/rounded_radius"
                    android:bottomRightRadius="@dimen/rounded_radius"
                    android:topLeftRadius="@dimen/rounded_radius"
                    android:topRightRadius="@dimen/rounded_radius"/>
            </shape>
        </clip>
    </item>

    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <solid android:color="@color/green"/>
                <corners
                    android:bottomLeftRadius="@dimen/rounded_radius"
                    android:bottomRightRadius="@dimen/rounded_radius"
                    android:topLeftRadius="@dimen/rounded_radius"
                    android:topRightRadius="@dimen/rounded_radius"/>
            </shape>
        </clip>
    </item>

</layer-list>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>Namespace Akamai\Open\EdgeGrid | Akamai {OPEN} EdgeGrid Authentication for PHP</title>

	<link rel="stylesheet" href="resources/bootstrap.min.css?973e37a8502921d56bc02bb55321f45b072b6f71">
	<link rel="stylesheet" href="resources/style.css?70c1d062672daa3f906b72e4f5d03d4bc5c4174d">

				Akamai {OPEN} EdgeGrid Authentication for PHP

                <form id="search" class="navbar-form navbar-left" role="search">
                    <input type="hidden" name="cx" value="">
                    <input type="hidden" name="ie" value="UTF-8">

                        <input type="text" name="q" class="search-query form-control" placeholder="Search">

				</form>

Namespace

Class

						Tree

Namespaces

							Akamai

							Open

							EdgeGrid

							Authentication

							Exception

							SignerException

							Exception

							HandlerException

							Handler

Classes

Authentication

Cli

Client

Exceptions

Exception

Namespace Akamai\Open\EdgeGrid

Namespaces summary

			Akamai\Open\EdgeGrid\Authentication

			Akamai\Open\EdgeGrid\Exception

			Akamai\Open\EdgeGrid\Handler

Classes summary

	Authentication
	Akamai {OPEN} EdgeGrid Request Signer

	Cli
	Class Cli

	Client
	Akamai {OPEN} EdgeGrid Client for PHP

Exceptions summary

	Exception
	Class Exception

		Akamai {OPEN} EdgeGrid Authentication for PHP API documentation generated by ApiGen


text:
require 'helper'

class TestGititback < Test::Unit::TestCase
  should "load module properly" do
    Gititback
  end
end


text:
<countries>
  <country name="England">
    <city>Birmingham</city>
    <city>Leeds</city>
    <city capital="true">London</city>
  </country>
  <country name="Germany">
    <city capital="true">Berlin</city>
    <city>Frankfurt</city>
    <city>Munich</city>
  </country>
  <country name="France">
    <city>Cannes</city>
    <city>Lyon</city>
    <city capital="true">Paris</city>
  </country>
</countries>


text:
import networkx as nx
__author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>',
                            'Aric Hagberg (hagberg@lanl.gov)'])
__all__ = ["average_neighbor_degree"]

def _average_nbr_deg(G, source_degree, target_degree, nodes=None, weight=None):
    # average degree of neighbors
    avg = {}
    for n,deg in source_degree(nodes,weight=weight):
        # normalize but not by zero degree
        if deg == 0:
            deg = 1
        nbrdeg = target_degree(G[n])
        if weight is None:
            avg[n] = sum(d for n, d in nbrdeg) / float(deg)
        else:
            avg[n] = sum((G[n][nbr].get(weight,1)*d
                          for nbr,d in nbrdeg)) / float(deg)
    return avg

def average_neighbor_degree(G, source='out', target='out',
                            nodes=None, weight=None):
    r"""Returns the average degree of the neighborhood of each node.

    The average degree of a node `i` is

    .. math::

        k_{nn,i} = \frac{1}{|N(i)|} \sum_{j \in N(i)} k_j

    where `N(i)` are the neighbors of node `i` and `k_j` is
    the degree of node `j` which belongs to `N(i)`. For weighted
    graphs, an analogous measure can be defined [1]_,

    .. math::

        k_{nn,i}^{w} = \frac{1}{s_i} \sum_{j \in N(i)} w_{ij} k_j

    where `s_i` is the weighted degree of node `i`, `w_{ij}`
    is the weight of the edge that links `i` and `j` and
    `N(i)` are the neighbors of node `i`.

    Parameters
    ----------
    G : NetworkX graph

    source : string ("in"|"out")
       Directed graphs only.
       Use "in"- or "out"-degree for source node.

    target : string ("in"|"out")
       Directed graphs only.
       Use "in"- or "out"-degree for target node.

    nodes : list or iterable, optional
        Compute neighbor degree for specified nodes.  The default is
        all nodes in the graph.

    weight : string or None, optional (default=None)
       The edge attribute that holds the numerical value used as a weight.
       If None, then each edge has weight 1.

    Returns
    -------
    d: dict
       A dictionary keyed by node with average neighbors degree value.

    Examples
    --------
    >>> G=nx.path_graph(4)
    >>> G.edge[0][1]['weight'] = 5
    >>> G.edge[2][3]['weight'] = 3

    >>> nx.average_neighbor_degree(G)
    {0: 2.0, 1: 1.5, 2: 1.5, 3: 2.0}
    >>> nx.average_neighbor_degree(G, weight='weight')
    {0: 2.0, 1: 1.1666666666666667, 2: 1.25, 3: 2.0}

    >>> G=nx.DiGraph()
    >>> nx.add_path(G, [0, 1, 2, 3])
    >>> nx.average_neighbor_degree(G, source='in', target='in')
    {0: 1.0, 1: 1.0, 2: 1.0, 3: 0.0}

    >>> nx.average_neighbor_degree(G, source='out', target='out')
    {0: 1.0, 1: 1.0, 2: 0.0, 3: 0.0}

    Notes
    -----
    For directed graphs you can also specify in-degree or out-degree
    by passing keyword arguments.

    See Also
    --------
    average_degree_connectivity

    References
    ----------
    .. [1] A. Barrat, M. Barthélemy, R. Pastor-Satorras, and A. Vespignani,
       "The architecture of complex weighted networks".
       PNAS 101 (11): 3747–3752 (2004).
    """
    source_degree = G.degree
    target_degree = G.degree
    if G.is_directed():
        direction = {'out':G.out_degree,
                     'in':G.in_degree}
        source_degree = direction[source]
        target_degree = direction[target]
    return _average_nbr_deg(G, source_degree, target_degree,
                            nodes=nodes, weight=weight)

# obsolete
# def average_neighbor_in_degree(G, nodes=None, weight=None):
#     if not G.is_directed():
#         raise nx.NetworkXError("Not defined for undirected graphs.")
#     return _average_nbr_deg(G, G.in_degree, G.in_degree, nodes, weight)
# average_neighbor_in_degree.__doc__=average_neighbor_degree.__doc__

# def average_neighbor_out_degree(G, nodes=None, weight=None):
#     if not G.is_directed():
#         raise nx.NetworkXError("Not defined for undirected graphs.")
#     return _average_nbr_deg(G, G.out_degree, G.out_degree, nodes, weight)
# average_neighbor_out_degree.__doc__=average_neighbor_degree.__doc__


text:
require 'test_helper'

class AllControllerTest < ActionController::TestCase
# %%co%%all

  test "alert me..." do
# When Rails re-supports this controller test method:
    assert_raise(NoMethodError){filter_chain()}
  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/nav_settings"
        android:icon="@drawable/ic_settings_black_24dp"
        android:title="@string/nav_menu_settings"/>
    <item
        android:id="@+id/nav_about"
        android:icon="@drawable/ic_help_outline_black_24dp"
        android:title="@string/nav_menu_about"/>
</menu>


text:
using AdventOfCode.Day21;
using NUnit.Framework;

namespace AdventOfCodeTests
{
    [TestFixture]
    public class Day21Tests
    {
        [Test]
        public void TestUndoneDay()
        {
            var d = new Day21();
        }
    }
}


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms").   Any redistribution of this code must retain the above
/// copyright and this notice and otherwise comply with the Use Terms.
/**
 * @path ch15/15.4/15.4.4/15.4.4.19/15.4.4.19-8-c-i-20.js
 * @description Array.prototype.map - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object
 */

function testcase() {

        function callbackfn(val, idx, obj) {
            if (idx === 0) {
                return typeof val === "undefined";
            }
            return false;
        }

        var proto = {};

        var Con = function () { };
        Con.prototype = proto;

        var child = new Con();
        child.length = 2;

        Object.defineProperty(child, "0", {
            set: function () { },
            configurable: true
        });

        Object.defineProperty(proto, "0", {
            get: function () {
                return 100;
            },
            configurable: true
        });

        var testResult = Array.prototype.map.call(child, callbackfn);

        return testResult[0] === true;
    }
runTestCase(testcase);


text:
var FONTAWESOME_URL, async, fs, path, targz, utils, _;

_ = require("underscore");

path = require("path");

fs = require("fs-extra");

targz = require('tar.gz');

utils = require("./utils");

async = require("async");

FONTAWESOME_URL = "https://github.com/FortAwesome/Font-Awesome/archive/<%=version%>.tar.gz";

module.exports = function(BPM) {
  var options;

  if (!BPM.options["font-awesome"]) {
    return;
  }
  options = _.defaults(BPM.options["font-awesome"], {
    path: null,
    version: "master"
  });
  BPM.on("download", function(next) {
    var cur, len, url,
      _this = this;

    this.progress.emit("fa-download-start");
    url = _.template(FONTAWESOME_URL, {
      version: options.version
    });
    cur = 0;
    len = 0;
    return utils.download_package(url, {
      dest: this.dir,
      start: function(res) {
        return len = parseInt(res.headers['content-length'], 10);
      },
      data: function(chunk) {
        cur += chunk.length;
        return _this.progress.emit("fa-download", cur / len);
      },
      complete: function(dest) {
        _.extend(_this.runtime, {
          fa_url: url,
          fa_archive: dest
        });
        _this.progress.emit("fa-download-end");
        return next();
      },
      error: next
    });
  });
  BPM.on("download", function(next) {
    var archive;

    this.progress.emit("fa-unarchive");
    archive = this.runtime.fa_archive;
    _.extend(this.runtime, {
      fa_lib: path.join(path.dirname(archive), path.basename(archive, ".tar.gz"))
    });
    return new targz().extract(archive, this.dir, next);
  });
  BPM.on("download", function(next) {
    var to_folder,
      _this = this;

    this.progress.emit("fa-copy-less");
    to_folder = path.join(this.runtime.lib, "less/font-awesome");
    this.runtime.folders["less"].whitelist.push("font-awesome");
    return fs.copy(path.join(this.runtime.fa_lib, "less"), to_folder, function(err) {
      if (err) {
        return next(err);
      }
      return async.parallel([
        function(cb) {
          if (!options.path) {
            return cb();
          }
          return utils.fix_file(path.join(to_folder, "variables.less"), /@FontAwesomePath(.*?);/i, "@FontAwesomePath: \"" + options.path + "\";", cb);
        }, function(cb) {
          return utils.fix_file(path.resolve(to_folder, "../bootstrap.less"), "sprites.less", "font-awesome/font-awesome.less", cb);
        }
      ], next);
    });
  });
  BPM.on("install", function(next) {
    this.progress.emit("fa-copy-fonts");
    return fs.copy(path.join(this.runtime.fa_lib, "font"), path.join(this.dir, "font"), next);
  });
  return BPM.on("cleanup", function(next) {
    var rm;

    this.progress.emit("fa-cleanup");
    rm = _.values(_.pick(this.runtime, "fa_archive", "fa_lib"));
    return async.each(rm, fs.remove, next);
  });
};


text:
package org.redisson.client.protocol.decoder;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.redisson.client.handler.State;

import io.netty.buffer.ByteBuf;

/**
 *
 * @author Nikita Koksharov
 *
 */
public class GeoMapReplayDecoder implements MultiDecoder<Map<Object, Object>> {

    @Override
    public Object decode(ByteBuf buf, State state) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Map<Object, Object> decode(List<Object> parts, State state) {
        Map<Object, Object> result = new LinkedHashMap<Object, Object>(parts.size());
        for (Object object : parts) {
            List<Object> vals = ((List<Object>) object);
            result.put(vals.get(0), vals.get(1));
        }
        return result;
    }

    @Override
    public boolean isApplicable(int paramNum, State state) {
        return false;
    }

}


text:
/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that
   the proper_name function might be candidate for attribute 'const'  */
#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
#endif

#include <config.h>

/* Specification.  */
#include "propername.h"

#include <ctype.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if HAVE_ICONV
# include <iconv.h>
#endif

#include "trim.h"
#include "mbchar.h"
#include "mbuiter.h"
#include "localcharset.h"
#include "c-strcase.h"
#include "xstriconv.h"
#include "xalloc.h"
#include "gettext.h"

/* Tests whether STRING contains trim (SUB), starting and ending at word
   boundaries.
   Here, instead of implementing Unicode Standard Annex #29 for determining
   word boundaries, we assume that trim (SUB) starts and ends with words and
   only test whether the part before it ends with a non-word and the part
   after it starts with a non-word.  */
static bool
mbsstr_trimmed_wordbounded (const char *string, const char *sub)
{
  char *tsub = trim (sub);
  bool found = false;

  for (; *string != '\0';)
    {
      const char *tsub_in_string = mbsstr (string, tsub);
      if (tsub_in_string == NULL)
        break;
      else
        {
          if (MB_CUR_MAX > 1)
            {
              mbui_iterator_t string_iter;
              bool word_boundary_before;
              bool word_boundary_after;

              mbui_init (string_iter, string);
              word_boundary_before = true;
              if (mbui_cur_ptr (string_iter) < tsub_in_string)
                {
                  mbchar_t last_char_before_tsub;
                  do
                    {
                      if (!mbui_avail (string_iter))
                        abort ();
                      last_char_before_tsub = mbui_cur (string_iter);
                      mbui_advance (string_iter);
                    }
                  while (mbui_cur_ptr (string_iter) < tsub_in_string);
                  if (mb_isalnum (last_char_before_tsub))
                    word_boundary_before = false;
                }

              mbui_init (string_iter, tsub_in_string);
              {
                mbui_iterator_t tsub_iter;

                for (mbui_init (tsub_iter, tsub);
                     mbui_avail (tsub_iter);
                     mbui_advance (tsub_iter))
                  {
                    if (!mbui_avail (string_iter))
                      abort ();
                    mbui_advance (string_iter);
                  }
              }
              word_boundary_after = true;
              if (mbui_avail (string_iter))
                {
                  mbchar_t first_char_after_tsub = mbui_cur (string_iter);
                  if (mb_isalnum (first_char_after_tsub))
                    word_boundary_after = false;
                }

              if (word_boundary_before && word_boundary_after)
                {
                  found = true;
                  break;
                }

              mbui_init (string_iter, tsub_in_string);
              if (!mbui_avail (string_iter))
                break;
              string = tsub_in_string + mb_len (mbui_cur (string_iter));
            }
          else
            {
              bool word_boundary_before;
              const char *p;
              bool word_boundary_after;

              word_boundary_before = true;
              if (string < tsub_in_string)
                if (isalnum ((unsigned char) tsub_in_string[-1]))
                  word_boundary_before = false;

              p = tsub_in_string + strlen (tsub);
              word_boundary_after = true;
              if (*p != '\0')
                if (isalnum ((unsigned char) *p))
                  word_boundary_after = false;

              if (word_boundary_before && word_boundary_after)
                {
                  found = true;
                  break;
                }

              if (*tsub_in_string == '\0')
                break;
              string = tsub_in_string + 1;
            }
        }
    }
  free (tsub);
  return found;
}

/* Return the localization of NAME.  NAME is written in ASCII.  */

const char *
proper_name (const char *name)
{
  /* See whether there is a translation.   */
  const char *translation = gettext (name);

  if (translation != name)
    {
      /* See whether the translation contains the original name.  */
      if (mbsstr_trimmed_wordbounded (translation, name))
        return translation;
      else
        {
          /* Return "TRANSLATION (NAME)".  */
          char *result =
            XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);

          sprintf (result, "%s (%s)", translation, name);
          return result;
        }
    }
  else
    return name;
}

/* Return the localization of a name whose original writing is not ASCII.
   NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
   escape sequences.  NAME_ASCII is a fallback written only with ASCII
   characters.  */

const char *
proper_name_utf8 (const char *name_ascii, const char *name_utf8)
{
  /* See whether there is a translation.   */
  const char *translation = gettext (name_ascii);

  /* Try to convert NAME_UTF8 to the locale encoding.  */
  const char *locale_code = locale_charset ();
  char *alloc_name_converted = NULL;
  char *alloc_name_converted_translit = NULL;
  const char *name_converted = NULL;
  const char *name_converted_translit = NULL;
  const char *name;

  if (c_strcasecmp (locale_code, "UTF-8") != 0)
    {
#if HAVE_ICONV
      name_converted = alloc_name_converted =
        xstr_iconv (name_utf8, "UTF-8", locale_code);

# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
      && !defined __UCLIBC__) \
     || _LIBICONV_VERSION >= 0x0105
      {
        char *converted_translit;

        size_t len = strlen (locale_code);
        char *locale_code_translit = XNMALLOC (len + 10 + 1, char);
        memcpy (locale_code_translit, locale_code, len);
        memcpy (locale_code_translit + len, "//TRANSLIT", 10 + 1);

        converted_translit =
          xstr_iconv (name_utf8, "UTF-8", locale_code_translit);

        free (locale_code_translit);

        if (converted_translit != NULL)
          {
#  if !_LIBICONV_VERSION
            /* Don't use the transliteration if it added question marks.
               glibc's transliteration falls back to question marks; libiconv's
               transliteration does not.
               mbschr is equivalent to strchr in this case.  */
            if (strchr (converted_translit, '?') != NULL)
              free (converted_translit);
            else
#  endif
              name_converted_translit = alloc_name_converted_translit =
                converted_translit;
          }
      }
# endif
#endif
    }
  else
    {
      name_converted = name_utf8;
      name_converted_translit = name_utf8;
    }

  /* The name in locale encoding.  */
  name = (name_converted != NULL ? name_converted :
          name_converted_translit != NULL ? name_converted_translit :
          name_ascii);

  /* See whether we have a translation.  Some translators have not understood
     that they should use the UTF-8 form of the name, if possible.  So if the
     translator provided a no-op translation, we ignore it.  */
  if (strcmp (translation, name_ascii) != 0)
    {
      /* See whether the translation contains the original name.  */
      if (mbsstr_trimmed_wordbounded (translation, name_ascii)
          || (name_converted != NULL
              && mbsstr_trimmed_wordbounded (translation, name_converted))
          || (name_converted_translit != NULL
              && mbsstr_trimmed_wordbounded (translation, name_converted_translit)))
        {
          if (alloc_name_converted != NULL)
            free (alloc_name_converted);
          if (alloc_name_converted_translit != NULL)
            free (alloc_name_converted_translit);
          return translation;
        }
      else
        {
          /* Return "TRANSLATION (NAME)".  */
          char *result =
            XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);

          sprintf (result, "%s (%s)", translation, name);

          if (alloc_name_converted != NULL)
            free (alloc_name_converted);
          if (alloc_name_converted_translit != NULL)
            free (alloc_name_converted_translit);
          return result;
        }
    }
  else
    {
      if (alloc_name_converted != NULL && alloc_name_converted != name)
        free (alloc_name_converted);
      if (alloc_name_converted_translit != NULL
          && alloc_name_converted_translit != name)
        free (alloc_name_converted_translit);
      return name;
    }
}

#ifdef TEST1
# include <locale.h>
int
main (int argc, char *argv[])
{
  setlocale (LC_ALL, "");
  if (mbsstr_trimmed_wordbounded (argv[1], argv[2]))
    printf("found\n");
  return 0;
}
#endif

#ifdef TEST2
# include <locale.h>
# include <stdio.h>
int
main (int argc, char *argv[])
{
  setlocale (LC_ALL, "");
  printf ("%s\n", proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard"));
  return 0;
}
#endif


text:
layout: docs
authors:
  - blairanderson
date: 2014-08-12 22:22:22
title: event.metaKey in Javascript - without jQuery
description: Indicates whether the META key was pressed when the event fired.
method: event.metaKey
href: "docs/event.metaKey.html"
status: "inactive"
---

#### Sorry, we do not have code examples for implementing [event.metaKey](http://api.jquery.com/event.metaKey/) in vanilla javascript.

It would be great if you submitted code on [github](https://github.com/blairanderson/without-jquery/blob/master/docs/event.metaKey.md)

### Example:

```javascript
  //jQuery
  var i = event.metaKey(taco);

  //Javascript
  var i = document[somethingOtherThanevent.metaKey](taco);

```

**REASONS:**
> Faster, and creates an event upon xyz

*example is computer generated, obviously not real.*


text:
layout: post
title: Patricia Urquila para Alessi
tags:
- micrographic
- product design
---
La confirmación definitiva. Se puede estar apareciendo en todas las revistas de diseño italianas durante meses, pero yo creo que no se entra dentro de la élite del diseño mundial hasta que no se diseña un producto para Alessi. Y en esas está la asturiana Patricia Urquiola.

Orloff es un bol geométrico de acero inoxidable y Buckle es un reloj realizado en acero y piel que se puede utilizar como gargantilla o como reloj de pulsera.

Visto en designbeans


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hygrophoropsis aurantiaca var. nana Singer

### Remarks
null


text:
<?php namespace Arcanesoft\Auth\Providers;

use Arcanesoft\Auth\Http\Routes;
use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider;

/**
 * Class     RouteServiceProvider
 *
 * @package  Arcanesoft\Auth\Providers
 * @author   ARCANEDEV <arcanedev.maroc@gmail.com>
 */
class RouteServiceProvider extends ServiceProvider
{
    /* -----------------------------------------------------------------
     |  Properties
     | -----------------------------------------------------------------
     */

    /**
     * The admin controller namespace for the application.
     *
     * @var string
     */
    protected $adminNamespace = 'Arcanesoft\\Auth\\Http\\Controllers\\Admin';

    /* -----------------------------------------------------------------
     |  Main Methods
     | -----------------------------------------------------------------
     */

    /**
     * Define the routes for the application.
     */
    public function map()
    {
        // Admin Routes
        $this->adminGroup(function () {
            $this->name('auth.')->group(function () {
                $this->mapAdminRoutes();
            });
        });
    }

    /* -----------------------------------------------------------------
     |  Other Methods
     | -----------------------------------------------------------------
     */

    /**
     * Define the foundation routes for the application.
     */
    protected function mapAdminRoutes()
    {
        Routes\Admin\ProfileRoutes::register();

        $this->prefix($this->config()->get('arcanesoft.auth.route.prefix', 'authorization'))
             ->group(function () {
                 Routes\Admin\StatsRoutes::register();
                 Routes\Admin\UsersRoutes::register();
                 Routes\Admin\RolesRoutes::register();
                 Routes\Admin\PermissionsRoutes::register();
                 Routes\Admin\PasswordResetsRoutes::register();
             });
    }

    /**
     * Register the route bindings.
     */
    protected function registerRouteBindings()
    {
        Routes\Admin\UsersRoutes::bindings();
        Routes\Admin\RolesRoutes::bindings();
        Routes\Admin\PermissionsRoutes::bindings();
    }
}


text:
function dist = codedist_loss(C1,C2,Ylat,loss)
% compute the distance using a loss function metric between 'C1' and  'C2'
%
%    dist = codedist_loss(C1,C2,Ylatent)
%    dist = codedist_loss(C1,C2,Ylatent, loss_fct)
%
% 'C1' contains the result code,
% 'C2' contains the codebooks prototype. An infine small number 'eps'  represents the don't care
% 'loss_fct' is the loss function used in order to compute the loss
%            between 2 codewords. By default the sum of squares is used.
%            One can do 'winner-takes-all' decoding by using the
%            loss function 'max'.
%
% An example:
%  >> Ye = [1 1; 1 1; -1 -1; 1 -1];
%  >> codebook = [1 2 3];
%  >> old_codebook = [1 1 -1; 1 -1 -1];
%  >> code(Ye, codebook, [],old_codebook,'codedist_loss',{'Ylatent','mse'})
%
% To use this distance measure in LS-SVMlab, the following
% procedure is to be followed, assume input data 'X' and multiclass
% output 'Y'
%
% % encode for training
% >> model = initlssvm(X,Y,'classification',gam,sig2,'preprocess','RBF_kernel');
% >> model = changelssvm(model,'codetype','code_OneVsOne');
% >> model = trainlssvm(model);
%
% % decode for simulating
% >> [Yhamming, Ylatent] = simlssvm(model,Xt);
% >> model = changelssvm(model,'codedist_fct','codedist_loss');
% >> model = changelssvm(model,'codedist_args',{Ylatent,'sse'});
% >>   Yt  = simlssvm(model,Xt);
%
% see also:
%   bay_modoutClass, codedist_hamming, code_ECOC

% (c) SCD-KULeuven, rights & help @ http://www.esat.kuleuven.ac.be/sista/lssvmlab

if nargin<3,
  warning('The latent variables should be used, proceeding with the binary classifiers...');
  Ylat = C1;
end
eval('loss;','loss=''sse'';');

[nb,nbin] = size(Ylat);
[~,dim] = size(C2);
dist = zeros(nb,dim);

for d = 1:dim,
  for n= 1:nb,
    nondontcare = find(Ylat(n,:)~=eps & C2(:,d)'~=eps);
    dist(n,d) = feval(loss, Ylat(n,nondontcare),C2(nondontcare,d)');
  end
end
dist

function l = sse(X,Y)
l = sum(sum((X-Y).^2));

function l = winnertakesall(X,Y)
p = find(Y>0);
l = max(X(P));


text:
#include "private.h"

static uv_prepare_t* luv_check_prepare(lua_State* L, int index) {
  uv_prepare_t* handle = (uv_prepare_t*)luv_checkudata(L, index, "uv_prepare");
  luaL_argcheck(L, handle->type == UV_PREPARE && handle->data, index, "Expected uv_prepare_t");
  return handle;
}

static int luv_new_prepare(lua_State* L) {
  luv_ctx_t* ctx = luv_context(L);
  uv_prepare_t* handle = (uv_prepare_t*)luv_newuserdata(L, uv_handle_size(UV_PREPARE));
  int ret = uv_prepare_init(ctx->loop, handle);
  if (ret < 0) {
    lua_pop(L, 1);
    return luv_error(L, ret);
  }
  handle->data = luv_setup_handle(L, ctx);
  return 1;
}

static void luv_prepare_cb(uv_prepare_t* handle) {
  luv_handle_t* data = (luv_handle_t*)handle->data;
  lua_State* L = data->ctx->L;
  luv_call_callback(L, data, LUV_PREPARE, 0);
}

static int luv_prepare_start(lua_State* L) {
  uv_prepare_t* handle = luv_check_prepare(L, 1);
  int ret;
  luv_check_callback(L, (luv_handle_t*)handle->data, LUV_PREPARE, 2);
  ret = uv_prepare_start(handle, luv_prepare_cb);
  return luv_result(L, ret);
}

static int luv_prepare_stop(lua_State* L) {
  uv_prepare_t* handle = luv_check_prepare(L, 1);
  int ret = uv_prepare_stop(handle);
  return luv_result(L, ret);
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">

		<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
		<title>PMD 4.2.6 Reference Package test.net.sourceforge.pmd.rules.unusedcode</title>
		<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="style" />

        	test.net.sourceforge.pmd.rules.unusedcode

Classes

            	UnusedCodeRulesTest


text:
(function () {
  'use strict';

  // Configuring the Brands Admin module
  angular
    .module('shops.admin')
    .run(menuConfig);

  menuConfig.$inject = ['menuService'];

  function menuConfig(Menus) {
    Menus.addSubMenuItem('topbar', 'admin', {
      title: 'Manage Shops',
      state: 'admin.shops.list'
    });
  }
}());


text:
RSpec.describe RuboCop::Cop::Lint::LiteralAsCondition do
  subject(:cop) { described_class.new }

  %w(1 2.0 [1] {} :sym :"#{a}").each do |lit|
    it "registers an offense for literal #{lit} in if" do
      inspect_source(<<-RUBY.strip_indent)
        if #{lit}
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in while" do
      inspect_source(<<-RUBY.strip_indent)
        while #{lit}
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in post-loop while" do
      inspect_source(<<-RUBY.strip_indent)
        begin
          top
        end while(#{lit})
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in until" do
      inspect_source(<<-RUBY.strip_indent)
        until #{lit}
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in post-loop until" do
      inspect_source(<<-RUBY.strip_indent)
        begin
          top
        end until #{lit}
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in case" do
      inspect_source(<<-RUBY.strip_indent)
        case #{lit}
        when x then top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in a when " \
       'of a case without anything after case keyword' do
      inspect_source(<<-RUBY.strip_indent)
        case
        when #{lit} then top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "accepts literal #{lit} in a when of a case with " \
       'something after case keyword' do
      expect_no_offenses(<<-RUBY.strip_indent)
        case x
        when #{lit} then top
        end
      RUBY
    end

    it "registers an offense for literal #{lit} in &&" do
      inspect_source(<<-RUBY.strip_indent)
        if x && #{lit}
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in complex cond" do
      inspect_source(<<-RUBY.strip_indent)
        if x && !(a && #{lit}) && y && z
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in !" do
      inspect_source(<<-RUBY.strip_indent)
        if !#{lit}
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for literal #{lit} in complex !" do
      inspect_source(<<-RUBY.strip_indent)
        if !(x && (y && #{lit}))
          top
        end
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "accepts literal #{lit} if it's not an and/or operand" do
      expect_no_offenses(<<-RUBY.strip_indent)
        if test(#{lit})
          top
        end
      RUBY
    end

    it "accepts literal #{lit} in non-toplevel and/or" do
      expect_no_offenses(<<-RUBY.strip_indent)
        if (a || #{lit}).something
          top
        end
      RUBY
    end

    it "registers an offense for `!#{lit}`" do
      inspect_source(<<-RUBY.strip_indent)
        !#{lit}
      RUBY
      expect(cop.offenses.size).to eq(1)
    end

    it "registers an offense for `not #{lit}`" do
      inspect_source(<<-RUBY.strip_indent)
        not(#{lit})
      RUBY
      expect(cop.offenses.size).to eq(1)
    end
  end

  it 'accepts array literal in case, if it has non-literal elements' do
    expect_no_offenses(<<-RUBY.strip_indent)
      case [1, 2, x]
      when [1, 2, 5] then top
      end
    RUBY
  end

  it 'accepts array literal in case, if it has nested non-literal element' do
    expect_no_offenses(<<-RUBY.strip_indent)
      case [1, 2, [x, 1]]
      when [1, 2, 5] then top
      end
    RUBY
  end

  it 'registers an offense for case with a primitive array condition' do
    expect_offense(<<-RUBY.strip_indent)
      case [1, 2, [3, 4]]
           ^^^^^^^^^^^^^^ Literal `[1, 2, [3, 4]]` appeared as a condition.
      when [1, 2, 5] then top
      end
    RUBY
  end

  it 'accepts dstr literal in case' do
    expect_no_offenses(<<-'RUBY'.strip_indent)
      case "#{x}"
      when [1, 2, 5] then top
      end
    RUBY
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Orchard;
using Orchard.Data;
using Orchard.Security;
using TestApi.Entities;

namespace TestApi.Repository
{
    public class AuthRepository : IDisposable
    {
        private readonly IWorkContextAccessor _workContextAccessor;
        private readonly IRepository<Client> _clientRepository;
        private readonly IRepository<RefreshToken> _refreshTokenRepository;

        public AuthRepository(IWorkContextAccessor workContextAccessor,
            IRepository<Client> clientRepository,
            IRepository<RefreshToken> refreshTokenRepository) {
            _workContextAccessor = workContextAccessor;
            _clientRepository = clientRepository;
            _refreshTokenRepository = refreshTokenRepository;
        }

        public IUser FindUser(string userName, string password)
        {
            var membershipService = _workContextAccessor.GetContext().Resolve<IMembershipService>();
            var user = membershipService.ValidateUser(userName, password);
            return user;
        }

        public Client FindClient(string clientId) {
            var client = _clientRepository.Fetch(x => x.Id == clientId).FirstOrDefault();
            return client;
        }

        public void AddRefreshToken(RefreshToken token)
        {

            var existingToken = _refreshTokenRepository.Get(r => r.Subject == token.Subject && r.ClientId == token.ClientId);

            if (existingToken != null)
            {
                RemoveRefreshToken(existingToken.Id);
            }

            _refreshTokenRepository.Create(token);
        }

        public void RemoveRefreshToken(string refreshTokenId)
        {
            var refreshToken = _refreshTokenRepository.Fetch(x => x.Id == refreshTokenId).FirstOrDefault();
            if (refreshToken != null)
                _refreshTokenRepository.Delete(refreshToken);
        }

        public RefreshToken FindRefreshToken(string refreshTokenId)
        {
            var refreshToken = _refreshTokenRepository.Fetch(x => x.Id == refreshTokenId).FirstOrDefault();

            return refreshToken;
        }

        public List<RefreshToken> GetAllRefreshTokens()
        {
            return _refreshTokenRepository.Fetch(x => true).ToList();
        }

        protected virtual void Dispose(bool disposing) {
            if (disposing) { }
        }

        public void Dispose() {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
    }
}


text:
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude, MagicHash #-}
{-# OPTIONS_GHC -funbox-strict-fields #-}
{-# OPTIONS_HADDOCK hide #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.IORef
-- Copyright   :  (c) The University of Glasgow 2008
-- License     :  see libraries/base/LICENSE
--
-- Maintainer  :  cvs-ghc@haskell.org
-- Stability   :  internal
-- Portability :  non-portable (GHC Extensions)
--
-- The IORef type
--
-----------------------------------------------------------------------------

module GHC.IORef (
        IORef(..),
        newIORef, readIORef, writeIORef, atomicModifyIORef
    ) where

import GHC.Base
import GHC.STRef
import GHC.IO

-- ---------------------------------------------------------------------------
-- IORefs

-- |A mutable variable in the 'IO' monad
newtype IORef a = IORef (STRef RealWorld a)
  deriving Eq
  -- ^ Pointer equality.
  --
  -- @since 4.1.0.0

-- |Build a new 'IORef'
newIORef    :: a -> IO (IORef a)
newIORef v = stToIO (newSTRef v) >>= \ var -> return (IORef var)

-- |Read the value of an 'IORef'
readIORef   :: IORef a -> IO a
readIORef  (IORef var) = stToIO (readSTRef var)

-- |Write a new value into an 'IORef'
writeIORef  :: IORef a -> a -> IO ()
writeIORef (IORef var) v = stToIO (writeSTRef var v)

atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b
atomicModifyIORef (IORef (STRef r#)) f = IO $ \s -> atomicModifyMutVar# r# f s


text:
package de.jformchecker.utils;

import java.lang.reflect.InvocationTargetException;

import org.junit.Assert;
import org.junit.Test;

import de.jformchecker.FormCheckerElement;
import de.jformchecker.FormCheckerForm;

public class BeanTransferTests {

  String exContent = "Example";

  @Test
  public void testFillEmptyForm() {
    FormCheckerForm form = BeanUtils.fromBean(new TestBean());
    Assert.assertEquals(5, form.getElements().size());
  }

  @Test
  public void testFillPrefilledForm() {
    TestBean t = new TestBean();
    t.setFirstname(exContent);
    FormCheckerForm form = BeanUtils.fromBean(t);
    Assert.assertEquals(exContent, form.getElement("firstname").getValue());
  }

  @Test
  public void testFromForm() {
    FormCheckerForm form = new ExampleFormShort();
    FormCheckerElement elem = form.getElement("firstname");
    elem.setValue(exContent);

    TestBean bean = new TestBean();
    try {
      System.err.println(Utils.getDebugOutput(form));
      BeanUtils.fillBean(form, bean);
      System.err.println(bean);
    } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    Assert.assertEquals(exContent, bean.getFirstname());

  }

}