text:
<!DOCTYPE html>

    <title>DiscordPresence Structure Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">

          SwiftDiscord Docs

         (100% documented)

        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>

      SwiftDiscord Reference

      DiscordPresence Structure Reference

            Guides

                Getting Started

                Installing SwiftDiscord for iOS

            Classes

                DiscordAuditLog

                DiscordBufferedVoiceDataSource

                DiscordClient

                DiscordEncoderMiddleware

                DiscordEngine

                DiscordGuild

                DiscordLazyValue

                DiscordOpusDecoder

                DiscordOpusEncoder

                DiscordRateLimiter

                DiscordShardManager

                DiscordSilenceVoiceDataSource

                DiscordVoiceEngine

                DiscordVoiceFileDataSource

                DiscordVoiceManager

                DiscordVoiceSessionDecoder

            Enumerations

                DiscordActivityType

                DiscordAuditLogActionType

                DiscordChannelType

                DiscordClientOption

                DiscordDispatchEvent

                DiscordEndpoint

                – EndpointRequest

                – Options

                DiscordGatewayCloseReason

                DiscordGatewayCode

                DiscordGatewayPayloadData

                DiscordHeader

                DiscordLogLevel

                DiscordNormalGatewayCode

                DiscordOAuthEndpoint

                DiscordPermissionOverwriteType

                DiscordPresenceStatus

                DiscordVoiceDataSourceStatus

                DiscordVoiceError

                DiscordVoiceGatewayCode

                HTTPContent

            Protocols

                DiscordChannel

                DiscordClientDelegate

                DiscordClientHolder

                DiscordClientSpec

                DiscordDispatchEventHandler

                DiscordEndpointConsumer

                DiscordEngineHeartbeatable

                DiscordEngineSpec

                DiscordGatewayable

                DiscordGuildChannel

                DiscordLogger

                DiscordOpusCodeable

                DiscordRateLimiterSpec

                DiscordShard

                DiscordShardDelegate

                DiscordShardManagerDelegate

                DiscordTextChannel

                DiscordTokenBearer

                DiscordUserActor

                DiscordVoiceDataSource

                DiscordVoiceEngineDelegate

                DiscordVoiceEngineSpec

                DiscordVoiceManagerDelegate

                DiscordWebSocketable

            Structures

                DiscordActivity

                DiscordActivityAssets

                DiscordActivityTimestamps

                DiscordAttachment

                DiscordAuditLogChange

                DiscordAuditLogEntry

                DiscordBan

                DiscordDMChannel

                DiscordEmbed

                – Author

                – Field

                – Footer

                – Image

                – Provider

                – Thumbnail

                – Video

                DiscordEmoji

                DiscordFileUpload

                DiscordGatewayPayload

                DiscordGroupDMChannel

                DiscordGuildChannelCategory

                DiscordGuildMember

                DiscordGuildTextChannel

                DiscordGuildVoiceChannel

                DiscordInvite

                DiscordInviteChannel

                DiscordInviteGuild

                DiscordLazyDictionary

                DiscordLazyDictionaryIndex

                DiscordMessage

                – MessageType

                – MessageActivity

                – MessageApplication

                DiscordOpusVoiceData

                DiscordParty

                DiscordPermission

                DiscordPermissionOverwrite

                DiscordPresence

                DiscordPresenceUpdate

                DiscordRateLimitKey

                – DiscordRateLimitURLParts

                DiscordRawVoiceData

                DiscordReaction

                DiscordRole

                DiscordShardInformation

                – ShardingError

                DiscordToken

                DiscordUser

                DiscordUserGuild

                DiscordVoiceEngineConfiguration

                DiscordVoiceServerInformation

                DiscordVoiceState

                DiscordWebhook

                Snowflake

            Type Aliases

                AttachmentID

                ChannelID

                EmojiID

                GuildID

                IntegrationID

                MessageID

                OverwriteID

                RoleID

                UserID

                WebhookID

DiscordPresence

public struct DiscordPresence

Represents a presence.

Properties

                    guildId

The snowflake of the guild this presence belongs on.

Declaration

Swift

public let guildId: GuildID

                    user

The user associated with this presence.

Declaration

Swift

public let user: DiscordUser

                    game

The game this user is playing, if they are playing a game.

Declaration

Swift

public var game: DiscordActivity?

                    nick

This user’s nick on this guild.

Declaration

Swift

public var nick: String?

                    roles

The roles?

Declaration

Swift

public var roles: [String]

                    status

The status of this user.

Declaration

Swift

public var status: DiscordPresenceStatus

© 2018 . All rights reserved. (Last updated: 2018-06-21)

Generated by jazzy ♪♫ v0.9.1, a Realm project.


text:
package com.moemao.tgks.wms.commodity.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.moemao.tgks.common.core.dao.TGKSDao;
import com.moemao.tgks.wms.commodity.entity.CommodityEvt;
import com.moemao.tgks.wms.commodity.entity.CommodityReq;

public interface CommodityDao extends TGKSDao
{
    public List<CommodityEvt> wms_queryCommodity(CommodityReq commodityReq)
            throws DataAccessException;

    public int wms_addCommodity(CommodityEvt commodityEvt)
            throws DataAccessException;

    public int wms_updateCommodity(CommodityEvt commodityEvt)
            throws DataAccessException;

    public int wms_deleteCommodity(List<String> list)
            throws DataAccessException;
}

redpajama_set_name: RedPajamaGithub


text:
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Tomataboard.Services;
using Tomataboard.Services.AccessTokens;

namespace Tomataboard.Controllers
{
    [Authorize(Roles = "Administrator")]
    public abstract class OauthController : Controller
    {
        protected string _cookieKey;
        protected readonly ILogger<IOauthService> _logger;
        protected readonly ICookiesService<OauthToken> _cookiesService;
        protected readonly IAccessTokensRepository _accessTokensRepository;
        protected readonly IOauthService _service;

        public OauthController(
            ILogger<IOauthService> logger,
            IOauthService service,
            ICookiesService<OauthToken> cookiesService,
            IAccessTokensRepository accessTokensRepository)
        {
            _logger = logger;
            _service = service;
            _cookiesService = cookiesService;
            _accessTokensRepository = accessTokensRepository;
        }

        public IActionResult Index()
        {
            var accessToken = _accessTokensRepository.Find(_service.GetType().Name);
            ViewData["Token"] = accessToken;
            ViewData["Title"] = _service.GetType().Name;
            return View("~/Views/Oauth/Index.cshtml");
        }

        public async Task<ActionResult> Authenticate()
        {
            try
            {
                var token = await _service.GetRequestToken();
                _cookiesService.Save(_cookieKey, token);

                var uri = _service.GetAuthorizationUrl(token);
                return new RedirectResult(uri);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return View("Error");
            }
        }

        public async Task<ActionResult> Callback(string oauth_token, string oauth_verifier)
        {
            try
            {
                var requestToken = _cookiesService.Load(_cookieKey);
                var accessToken = await _service.GetAccessToken(
                        new OauthToken() { Token = oauth_token, Secret = requestToken.Secret, Verifier = oauth_verifier });

                _accessTokensRepository.Add(_service.GetType().Name, accessToken);
                return RedirectToAction("Index", "Home");
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return View("Error");
            }
        }

        public abstract Task<ActionResult> Execute();

        public abstract Task<ActionResult> Refresh();
    }
}


text:
package com.wanglei.graempinf_core.graempinf_core.dao;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.wanglei.basic.hibernate.dao.BaseDao;
import com.wanglei.basic.hibernate.model.Pager;
import com.wanglei.graempinf_core.graempinf_core.Enum.RoleType;
import com.wanglei.graempinf_core.graempinf_core.model.Group;
import com.wanglei.graempinf_core.graempinf_core.model.Role;
import com.wanglei.graempinf_core.graempinf_core.model.User;
import com.wanglei.graempinf_core.graempinf_core.model.UserGroup;
import com.wanglei.graempinf_core.graempinf_core.model.UserRole;
@SuppressWarnings("unchecked")
@Repository("userDao")
public class UserDao extends BaseDao<User> implements IUserDao{
	Logger log = Logger.getLogger(StudentDao.class);
	@Override
	public List<Role> listUserRoles(String userId) {
		String hql = "select ur.role from UserRole ur where ur.user.userUuid=?";
		return this.getSession().createQuery(hql).setParameter(0, userId).list();
	}

	@Override
	public List<String> listUserRoleIdS(String userId) {
		String hql = "select ur.role.roleUuid from UserRole ur where ur.user.userUuid=?";
		return this.getSession().createQuery(hql).setParameter(0, userId).list();
	}

	@Override
	public List<Group> listUserGroups(String userId) {
		String hql = "select ug.group from UserGroup ug where ug.user.userUuid=?";
		return this.getSession().createQuery(hql).setParameter(0, userId).list();
	}

	@Override
	public List<String> listuserGroupIdS(String userId) {
		String hql = "select ug.group.gruopUuid from UserGroup ug where ug.user.userUuid = ?";
		return this.getSession().createQuery(hql).setParameter(0, userId).list();
	}

	@Override
	public UserRole loadUserRole(String userId, String roleId) {
		String hql ="select ur from UserRole ur left join fetch ur.user u left join ur.role r where u.userUuid = ? and r.roleUuid =?";
		return (UserRole)this.getSession().createQuery(hql).setParameter(0, userId).setParameter(1, roleId).uniqueResult();
	}

	@Override
	public UserGroup loadUserGroup(String userId, String groupId) {
		String hql ="select ug from UserGroup ug left join fetch ug.user u left join fetch ug.group g where u.userUuid = ? and g.gruopUuid =?";
		return (UserGroup)this.getSession().createQuery(hql).
				setParameter(0, userId).setParameter(1, groupId).uniqueResult();
	}

	@Override
	public User loadByUserName(String userName) {
		String hql = "from User where userName =?";
		return (User)this.queryObjectByHqlWithParam(hql, userName);
	}

	@Override
	public List<User> listRoleUsers(String roleId) {
		String hql = "select ur.user from UserRole ur where ur.role.roleUuid= ?";
		return this.listByhqlWithParam(hql, roleId);
	}

	@Override
	public List<User> listRoleUsers(RoleType roleType) {
		String hql = "select ur.user from UserRole ur where ur.role.roleType=?";
		return this.listByhqlWithParam(hql, roleType);
	}

	@Override
	public List<User> listGroupUsers(String groupId) {
		String hql = "select ug.user from UserGroup ug where ug.group.gruopUuid=?";
		return this.listByhqlWithParam(hql, groupId);
	}

	@Override
	public void addUserRole(User user, Role role) {
		UserRole ur = this.loadUserRole(user.getUserUuid(), role.getRoleUuid());
		if(null != ur)return;
		ur = new UserRole();
		ur.setRole(role);
		ur.setUser(user);
		this.getSession().save(ur);
	}

	@Override
	public void adduserGroup(User user, Group group) {
		UserGroup ug = this.loadUserGroup(user.getUserUuid(), group.getGruopUuid());
		if(null != ug)return;
		ug = new UserGroup();
		ug.setGroup(group);
		ug.setUser(user);
		this.getSession().save(ug);
	}

	@Override
	public void deleteUserGroup(String userID) {
		String hql = "delete from UserGroup ug where ug.user.userUuid = ?";
		this.updateByHqlWithParam(hql, userID);
	}

	@Override
	public void deleteUserRole(String userID) {
		String hql = "delete from UserRole ur where ur.user.userUuid = ?";
		this.updateByHqlWithParam(hql, userID);
	}

	@Override
	public Pager<User> findUser() {
		return this.findByhql("from User");
	}

	@Override
	public void deleteUserRole(String uid, String rid) {
		String hql = "delete UserRole ur where ur.user.userUuid = ? and ur.role.roleUuid =?";
		this.updateByHqlWithParams(hql, new Object[]{uid,rid});
	}

	@Override
	public void deleteUserGroup(String uid, String rid) {
		String hql = "delete UserGroup ug where ug.user.userUuid =? and ug.group.gruopUuid =?";
		this.updateByHqlWithParams(hql, new Object[]{uid,rid});
	}

	@Override
	public void deleteUserBystuid(String stuuid) {
		String hql ="delete User u where u.stuUuid =?";
		this.updateByHqlWithParam(hql, stuuid);
	}

	@Override
	public User loadUserByuStuUuid(String stuuid) {
		String hql ="from User u where u.stuUuid =?";
		return (User)this.listByhqlWithParam(hql, stuuid).get(0);
	}

}


text:
#ifndef Py_HASH_H

#define Py_HASH_H
#ifdef __cplusplus
extern "C" {
#endif

/* Helpers for hash functions */
#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
#endif

/* Prime multiplier used in string and various other hashes. */
#define _PyHASH_MULTIPLIER 1000003UL  /* 0xf4243 */

/* Parameters used for the numeric hash implementation.  See notes for
   _Py_HashDouble in Objects/object.c.  Numeric hashes are based on
   reduction modulo the prime 2**_PyHASH_BITS - 1. */

#if SIZEOF_VOID_P >= 8
#  define _PyHASH_BITS 61
#else
#  define _PyHASH_BITS 31
#endif

#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
#define _PyHASH_INF 314159
#define _PyHASH_NAN 0
#define _PyHASH_IMAG _PyHASH_MULTIPLIER

/* hash secret
 *
 * memory layout on 64 bit systems
 *   cccccccc cccccccc cccccccc  uc -- unsigned char[24]
 *   pppppppp ssssssss ........  fnv -- two Py_hash_t
 *   k0k0k0k0 k1k1k1k1 ........  siphash -- two uint64_t
 *   ........ ........ ssssssss  djbx33a -- 16 bytes padding + one Py_hash_t
 *   ........ ........ eeeeeeee  pyexpat XML hash salt
 *
 * memory layout on 32 bit systems
 *   cccccccc cccccccc cccccccc  uc
 *   ppppssss ........ ........  fnv -- two Py_hash_t
 *   k0k0k0k0 k1k1k1k1 ........  siphash -- two uint64_t (*)
 *   ........ ........ ssss....  djbx33a -- 16 bytes padding + one Py_hash_t
 *   ........ ........ eeee....  pyexpat XML hash salt
 *
 * (*) The siphash member may not be available on 32 bit platforms without
 *     an unsigned int64 data type.
 */
#ifndef Py_LIMITED_API
typedef union {
    /* ensure 24 bytes */
    unsigned char uc[24];
    /* two Py_hash_t for FNV */
    struct {
        Py_hash_t prefix;
        Py_hash_t suffix;
    } fnv;
    /* two uint64 for SipHash24 */
    struct {
        uint64_t k0;
        uint64_t k1;
    } siphash;
    /* a different (!) Py_hash_t for small string optimization */
    struct {
        unsigned char padding[16];
        Py_hash_t suffix;
    } djbx33a;
    struct {
        unsigned char padding[16];
        Py_hash_t hashsalt;
    } expat;
} _Py_HashSecret_t;
PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
#endif

#ifdef Py_DEBUG
PyAPI_DATA(int) _Py_HashSecret_Initialized;
#endif

/* hash function definition */
#ifndef Py_LIMITED_API
typedef struct {
    Py_hash_t (*const hash)(const void *, Py_ssize_t);
    const char *name;
    const int hash_bits;
    const int seed_bits;
} PyHash_FuncDef;

PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
#endif

/* cutoff for small string DJBX33A optimization in range [1, cutoff).
 *
 * About 50% of the strings in a typical Python application are smaller than
 * 6 to 7 chars. However DJBX33A is vulnerable to hash collision attacks.
 * NEVER use DJBX33A for long strings!
 *
 * A Py_HASH_CUTOFF of 0 disables small string optimization. 32 bit platforms
 * should use a smaller cutoff because it is easier to create colliding
 * strings. A cutoff of 7 on 64bit platforms and 5 on 32bit platforms should
 * provide a decent safety margin.
 */
#ifndef Py_HASH_CUTOFF
#  define Py_HASH_CUTOFF 0
#elif (Py_HASH_CUTOFF > 7 || Py_HASH_CUTOFF < 0)
#  error Py_HASH_CUTOFF must in range 0...7.
#endif /* Py_HASH_CUTOFF */

/* hash algorithm selection
 *
 * The values for Py_HASH_SIPHASH24 and Py_HASH_FNV are hard-coded in the
 * configure script.
 *
 * - FNV is available on all platforms and architectures.
 * - SIPHASH24 only works on plaforms that don't require aligned memory for integers.
 * - With EXTERNAL embedders can provide an alternative implementation with::
 *
 *     PyHash_FuncDef PyHash_Func = {...};
 *
 * XXX: Figure out __declspec() for extern PyHash_FuncDef.
 */
#define Py_HASH_EXTERNAL 0
#define Py_HASH_SIPHASH24 1
#define Py_HASH_FNV 2

#ifndef Py_HASH_ALGORITHM
#  ifndef HAVE_ALIGNED_REQUIRED
#    define Py_HASH_ALGORITHM Py_HASH_SIPHASH24
#  else
#    define Py_HASH_ALGORITHM Py_HASH_FNV
#  endif /* uint64_t && uint32_t && aligned */
#endif /* Py_HASH_ALGORITHM */

#ifdef __cplusplus
}
#endif

#endif /* !Py_HASH_H */


text:
<?php if ($field->isPartial()): ?>
    <?php include_partial('aPollAnswerAdmin/' . $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php elseif ($field->isComponent()): ?>
    <?php include_component('aPollAnswerAdmin', $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php else: ?>
    <div class="<?php echo $class ?>">

<?php echo $label ? $label : ($form->getWidget($name)->getLabel() ? $form->getWidget($name)->getLabel() : $name) ?>

            <?php echo aPollToolkit::renderAdminFieldValue($form, $field instanceof sfOutputEscaper ? $field->getRawValue() : $field, $form[$name]->getValue()); ?>

<?php endif; ?>


text:
package org.apache.polygene.library.locking;

import org.apache.polygene.api.concern.Concerns;
import org.apache.polygene.api.mixin.Mixins;

/**
 * JAVADOC
 */
@Concerns( { ReadLockConcern.class, WriteLockConcern.class } )
@Mixins( LockMixin.class )
public interface LockingAbstractComposite
{
}


text:
package org.apache.pinot.core.transport;

import com.google.common.net.InternetDomainName;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.concurrent.ThreadSafe;
import org.apache.pinot.spi.config.table.TableType;

/**
 * The {@code ServerRoutingInstance} class represents the routing target instance which contains the information of
 * hostname, port, and table type it serves.
 * <p>Different table types on same host and port are counted as different instances. Therefore, one single Pinot Server
 * might be treated as two different routing target instances based on the types of table it serves.
 */
@ThreadSafe
public class ServerRoutingInstance {
  private static final String SHORT_OFFLINE_SUFFIX = "_O";
  private static final String SHORT_REALTIME_SUFFIX = "_R";
  private static final Map<String, String> SHORT_HOSTNAME_MAP = new ConcurrentHashMap<>();

  private final boolean _tlsEnabled;
  private final String _hostname;
  private final int _port;
  private final TableType _tableType;

  public ServerRoutingInstance(String hostname, int port, TableType tableType) {
    this(hostname, port, tableType, false);
  }

  public ServerRoutingInstance(String hostname, int port, TableType tableType, boolean tlsEnabled) {
    _hostname = hostname;
    _port = port;
    _tableType = tableType;
    _tlsEnabled = tlsEnabled;
  }

  public String getHostname() {
    return _hostname;
  }

  public int getPort() {
    return _port;
  }

  public TableType getTableType() {
    return _tableType;
  }

  public String getShortName() {
    String shortHostname = SHORT_HOSTNAME_MAP.computeIfAbsent(_hostname, hostname -> {
      try {
        InternetDomainName domainName = InternetDomainName.from(hostname);
        return domainName.parts().get(0);
      } catch (Exception e) {
        return hostname;
      }
    });
    return shortHostname + (_tableType == TableType.OFFLINE ? SHORT_OFFLINE_SUFFIX : SHORT_REALTIME_SUFFIX);
  }

  public boolean isTlsEnabled() {
    return _tlsEnabled;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ServerRoutingInstance that = (ServerRoutingInstance) o;
    return _tlsEnabled == that._tlsEnabled && _port == that._port && _hostname.equals(that._hostname)
        && _tableType == that._tableType;
  }

  @Override
  public int hashCode() {
    return Objects.hash(_tlsEnabled, _hostname, _port, _tableType);
  }

  @Override
  public String toString() {
    return getShortName();
  }
}


text:
/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * Copyright 2001-2004 The Apache Software Foundation.
 *
 * 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.
 */
/*
 * $Id: ApplyTemplates.java,v 1.2.4.1 2005/09/12 09:59:21 pvedula Exp $
 */

package com.sun.org.apache.xalan.internal.xsltc.compiler;

import java.util.Enumeration;
import java.util.Vector;

import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeSetType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ResultTreeType;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
import com.sun.org.apache.xml.internal.utils.XML11Char;

/**
 * @author Jacek Ambroziak
 * @author Santiago Pericas-Geertsen
 */
final class ApplyTemplates extends Instruction {
    private Expression _select;
    private Type       _type = null;
    private QName      _modeName;
    private String     _functionName;

    public void display(int indent) {
        indent(indent);
        Util.println("ApplyTemplates");
        indent(indent + IndentIncrement);
        Util.println("select " + _select.toString());
        if (_modeName != null) {
            indent(indent + IndentIncrement);
            Util.println("mode " + _modeName);
        }
    }

    public boolean hasWithParams() {
        return hasContents();
    }

    public void parseContents(Parser parser) {
        final String select = getAttribute("select");
        final String mode   = getAttribute("mode");

        if (select.length() > 0) {
            _select = parser.parseExpression(this, "select", null);

        }

        if (mode.length() > 0) {
            if (!XML11Char.isXML11ValidQName(mode)) {
                ErrorMsg err = new ErrorMsg(ErrorMsg.INVALID_QNAME_ERR, mode, this);
                parser.reportError(Constants.ERROR, err);
            }
            _modeName = parser.getQNameIgnoreDefaultNs(mode);
        }

        // instantiate Mode if needed, cache (apply temp) function name
        _functionName =
            parser.getTopLevelStylesheet().getMode(_modeName).functionName();
        parseChildren(parser);// with-params
    }

    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
        if (_select != null) {
            _type = _select.typeCheck(stable);
            if (_type instanceof NodeType || _type instanceof ReferenceType) {
                _select = new CastExpr(_select, Type.NodeSet);
                _type = Type.NodeSet;
            }
            if (_type instanceof NodeSetType||_type instanceof ResultTreeType) {
                typeCheckContents(stable); // with-params
                return Type.Void;
            }
            throw new TypeCheckError(this);
        }
        else {
            typeCheckContents(stable);          // with-params
            return Type.Void;
        }
    }

    /**
     * Translate call-template. A parameter frame is pushed only if
     * some template in the stylesheet uses parameters.
     */
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
        boolean setStartNodeCalled = false;
        final Stylesheet stylesheet = classGen.getStylesheet();
        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
        final int current = methodGen.getLocalIndex("current");

        // check if sorting nodes is required
        final Vector sortObjects = new Vector();
        final Enumeration children = elements();
        while (children.hasMoreElements()) {
            final Object child = children.nextElement();
            if (child instanceof Sort) {
                sortObjects.addElement(child);
            }
        }

        // Push a new parameter frame
        if (stylesheet.hasLocalParams() || hasContents()) {
            il.append(classGen.loadTranslet());
            final int pushFrame = cpg.addMethodref(TRANSLET_CLASS,
                                                   PUSH_PARAM_FRAME,
                                                   PUSH_PARAM_FRAME_SIG);
            il.append(new INVOKEVIRTUAL(pushFrame));
            // translate with-params
            translateContents(classGen, methodGen);
        }

        il.append(classGen.loadTranslet());

        // The 'select' expression is a result-tree
        if ((_type != null) && (_type instanceof ResultTreeType)) {
            // <xsl:sort> cannot be applied to a result tree - issue warning
            if (sortObjects.size() > 0) {
                ErrorMsg err = new ErrorMsg(ErrorMsg.RESULT_TREE_SORT_ERR,this);
                getParser().reportError(WARNING, err);
            }
            // Put the result tree (a DOM adapter) on the stack
            _select.translate(classGen, methodGen);
            // Get back the DOM and iterator (not just iterator!!!)
            _type.translateTo(classGen, methodGen, Type.NodeSet);
        }
        else {
            il.append(methodGen.loadDOM());

            // compute node iterator for applyTemplates
            if (sortObjects.size() > 0) {
                Sort.translateSortIterator(classGen, methodGen,
                                           _select, sortObjects);
                int setStartNode = cpg.addInterfaceMethodref(NODE_ITERATOR,
                                                             SET_START_NODE,
                                                             "(I)"+
                                                             NODE_ITERATOR_SIG);
                il.append(methodGen.loadCurrentNode());
                il.append(new INVOKEINTERFACE(setStartNode,2));
                setStartNodeCalled = true;
            }
            else {
                if (_select == null)
                    Mode.compileGetChildren(classGen, methodGen, current);
                else
                    _select.translate(classGen, methodGen);
            }
        }

        if (_select != null && !setStartNodeCalled) {
            _select.startIterator(classGen, methodGen);
        }

        //!!! need to instantiate all needed modes
        final String className = classGen.getStylesheet().getClassName();
        il.append(methodGen.loadHandler());
        final String applyTemplatesSig = classGen.getApplyTemplatesSig();
        final int applyTemplates = cpg.addMethodref(className,
                                                    _functionName,
                                                    applyTemplatesSig);
        il.append(new INVOKEVIRTUAL(applyTemplates));

        // Pop parameter frame
        if (stylesheet.hasLocalParams() || hasContents()) {
            il.append(classGen.loadTranslet());
            final int popFrame = cpg.addMethodref(TRANSLET_CLASS,
                                                  POP_PARAM_FRAME,
                                                  POP_PARAM_FRAME_SIG);
            il.append(new INVOKEVIRTUAL(popFrame));
        }
    }
}


text:
Scala.js façade for https://github.com/pimterry/loglevel

### Usage:

```
libraryDependencies += "com.codemettle.scalajs" %%% "loglevel" % "1.0.0"
```

```scala
import com.github.pimterry.loglevel.LogLevel

object Test {
  private val logger = LogLevel.log

  logger.debug("log message")
}
```


text:
Rent.$=$475

Utilities.Separate.List=Electricity ($21 meter charge plus actual usage);  Water  ($21.30 meter charge plus actual usage) 	Trash ($8.75 flat);	Sewer ($12.50 flat);  Natural Gas (not available); Propane (not provided)

Utilities.Included.List=None.


text:
class CMailSlotMsg;
struct lua_State;

#define DMOD_NONE					0
#define DMOD_STEP_INTO				1
#define DMOD_STEP_OVER				2
#define DMOD_STEP_OUT				3
#define DMOD_RUN_TO_CURSOR			4
//#define DMOD_SHOW_STACK_LEVEL		5

#define DMOD_BREAK					10
#define DMOD_STOP					11

struct SBreakPoint{
	shared_str	fileName;
	s32			nLine;
	SBreakPoint()	{nLine=0;};
	SBreakPoint(const SBreakPoint& other)
	{
		operator = (other);
	};
	SBreakPoint& operator = (const SBreakPoint& other){
		fileName=	other.fileName;
		nLine	=	other.nLine;
		return *this;
	}
};

class CScriptDebugger
{
public:
	void			Connect				(LPCSTR mslot_name);
	void			Eval				(const char* strCode, char* res, int res_sz);
	void			AddLocalVariable	(const Variable& var);
	void			ClearLocalVariables	();
	void			AddGlobalVariable	(const char* name, const char* type, const char* value);
	void			ClearGlobalVariables();
	void			StackLevelChanged	();
	void			initiateDebugBreak	();
	void			DebugBreak			(const char* szFile, int nLine);
	void			ErrorBreak			(const char* szFile = 0, int nLine = 0);
	void			LineHook			(const char* szFile, int nLine);
	void			FunctionHook		(const char* szFile, int nLine, BOOL bCall);
	void			Write				(const char* szMsg);

	int				PrepareLua			(lua_State* );
	void			UnPrepareLua		(lua_State* l, int idx);
	BOOL			PrepareLuaBind		();

					CScriptDebugger		();
	virtual			~CScriptDebugger	();

	void			Go					();
	void			StepInto			();
	void			StepOver			();
	void			StepOut				();
	void			RunToCursor			();

	void			ClearThreads		();
	void			AddThread			(SScriptThread&);

	void			ClearStackTrace		();
	void			AddStackTrace		(const char* strDesc, const char* strFile, int nLine);
	int				GetStackTraceLevel	();

	BOOL			Active				();
//	static CScriptDebugger* GetDebugger	() { return m_pDebugger; };
	LRESULT			_SendMessage(UINT message, WPARAM wParam, LPARAM lParam);

protected:
	void			DrawVariableInfo	(char* varName);
	void			DrawCurrentState	();
	void			DrawThreadInfo		(int nThreadID);
	void			GetBreakPointsFromIde();
	void			FillBreakPointsIn	(CMailSlotMsg* msg);
	bool			HasBreakPoint		(const char* fileName, s32 lineNum);
	void			CheckNewMessages	();
	LRESULT			DebugMessage		(UINT nMsg, WPARAM wParam, LPARAM lParam);
	void			WaitForReply		(bool bWaitForModalResult);
	bool			TranslateIdeMessage (CMailSlotMsg*);
	void			SendMessageToIde	(CMailSlotMsg&);

	CDbgScriptThreads					*m_threads;
	CDbgLuaHelper						*m_lua;
	CScriptCallStack					*m_callStack;
//	static CScriptDebugger*				m_pDebugger;
	int									m_nMode;
	int									m_nLevel;  //for step into/over/out
	string_path							m_strPathName;	//for run_to_line_number
	int									m_nLine;		//for run_to_line_number

	HANDLE								m_mailSlot;
	BOOL								m_bIdePresent;

	xr_vector<SBreakPoint>				m_breakPoints;
	string_path							m_curr_connected_mslot;
};


text:
package io.variability.jhipster.repository;

import io.variability.jhipster.domain.User;

import java.time.ZonedDateTime;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;
import java.util.Optional;

/**
 * Spring Data MongoDB repository for the User entity.
 */
public interface UserRepository extends MongoRepository<User, String> {

    Optional<User> findOneByActivationKey(String activationKey);

    List<User> findAllByActivatedIsFalseAndCreatedDateBefore(ZonedDateTime dateTime);

    Optional<User> findOneByResetKey(String resetKey);

    Optional<User> findOneByEmail(String email);

    Optional<User> findOneByLogin(String login);

    Optional<User> findOneById(String userId);

    @Override
    void delete(User t);

}


text:
<?php

declare(strict_types=1);

namespace WyriHaximus\CpuCoreDetector\Tests;

use Throwable;
use WyriHaximus\CpuCoreDetector\Core\AffinityInterface;
use WyriHaximus\CpuCoreDetector\Resolver;
use WyriHaximus\TestUtilities\TestCase;

use function React\Promise\resolve;

final class ResolverTest extends TestCase
{
    protected function setUp(): void
    {
        parent::setUp();
        Resolver::reset();
    }

    public function testResolve(): void
    {
        $promise  = resolve(null);
        $affinity = $this->prophesize(AffinityInterface::class);
        $affinity->execute(13, 'cowsay')->shouldBeCalled()->willReturn($promise);
        Resolver::setAffinity($affinity->reveal());
        self::assertSame($promise, Resolver::resolve('13', 'cowsay'));
    }

    public function testGetAffinity(): void
    {
        self::expectException(Throwable::class);
        self::expectExceptionMessage('Affinity not set');
        Resolver::getAffinity();
    }

    public function testSetAffinity(): void
    {
        $affinity = $this->prophesize(AffinityInterface::class)->reveal();
        Resolver::setAffinity($affinity);
        self::assertSame($affinity, Resolver::getAffinity());
    }
}


text:
<script src="{{ base_path }}/assets/js/main.min.js"></script>

{% include analytics.html %}
{% include /comments-providers/scripts.html %}

<script type="text/javascript" async
  src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>


text:
Open vSwitch
============
# ovs-igmp-v3
Onecloud's contribution to IGMPV3 support for OVS.

Release note:
=============
1. The current release is an experimental implementation of IGMPv3 built to validate against the functionality.
2. The existing code has leveraged mcast to build a lighter version of IGMPv3 (IGMPv3-light).
3. Currently the design is tested for SSM (single source) and ASM. The default mode is controlled by the Linux kernel.
4. The code is not tuned for performance. Mainly the reason is; it needs a overhaul for architectural design
   to have a full fledged code. This would take longer time for completion.
   However, it is a good starting point for having the IGMPv3 support on OVS.
5. CHANGE_TO_INCLUDE, CHANGE_TO_EXCLUDE, ALLOW_NEW_SROUCE DROP_OLD_SOURCES
   are taken care with what ever capabilty we have as tools to test.

----------------------ORIGINAL-README---------------------------

What is Open vSwitch?
---------------------

Open vSwitch is a multilayer software switch licensed under the open
source Apache 2 license.  Our goal is to implement a production
quality switch platform that supports standard management interfaces
and opens the forwarding functions to programmatic extension and
control.

Open vSwitch is well suited to function as a virtual switch in VM
environments.  In addition to exposing standard control and visibility
interfaces to the virtual networking layer, it was designed to support
distribution across multiple physical servers.  Open vSwitch supports
multiple Linux-based virtualization technologies including
Xen/XenServer, KVM, and VirtualBox.

The bulk of the code is written in platform-independent C and is
easily ported to other environments.  The current release of Open
vSwitch supports the following features:

* Standard 802.1Q VLAN model with trunk and access ports
* NIC bonding with or without LACP on upstream switch
* NetFlow, sFlow(R), and mirroring for increased visibility
* QoS (Quality of Service) configuration, plus policing
* Geneve, GRE, GRE over IPSEC, VXLAN, and LISP tunneling
* 802.1ag connectivity fault management
* OpenFlow 1.0 plus numerous extensions
* Transactional configuration database with C and Python bindings
* High-performance forwarding using a Linux kernel module

The included Linux kernel module supports Linux 2.6.32 and up, with
testing focused on 2.6.32 with Centos and Xen patches.  Open vSwitch
also has special support for Citrix XenServer and Red Hat Enterprise
Linux hosts.

Open vSwitch can also operate, at a cost in performance, entirely in
userspace, without assistance from a kernel module.  This userspace
implementation should be easier to port than the kernel-based switch.
It is considered experimental.

What's here?
------------

The main components of this distribution are:

* ovs-vswitchd, a daemon that implements the switch, along with
  a companion Linux kernel module for flow-based switching.
* ovsdb-server, a lightweight database server that ovs-vswitchd
  queries to obtain its configuration.
* ovs-dpctl, a tool for configuring the switch kernel module.
* Scripts and specs for building RPMs for Citrix XenServer and Red
  Hat Enterprise Linux.  The XenServer RPMs allow Open vSwitch to
  be installed on a Citrix XenServer host as a drop-in replacement
  for its switch, with additional functionality.
* ovs-vsctl, a utility for querying and updating the configuration
  of ovs-vswitchd.
* ovs-appctl, a utility that sends commands to running Open
      vSwitch daemons.

Open vSwitch also provides some tools:

* ovs-ofctl, a utility for querying and controlling OpenFlow
  switches and controllers.
* ovs-pki, a utility for creating and managing the public-key
  infrastructure for OpenFlow switches.
* ovs-testcontroller, a simple OpenFlow controller that may be useful
  for testing (though not for production).
* A patch to tcpdump that enables it to parse OpenFlow messages.

What other documentation is available?
--------------------------------------

To install Open vSwitch on a regular Linux or FreeBSD host, please
read [INSTALL.md]. For specifics around installation on a specific
platform, please see one of these files:

- [INSTALL.Debian.md]
- [INSTALL.Fedora.md]
- [INSTALL.RHEL.md]
- [INSTALL.XenServer.md]

To use Open vSwitch...

- ...with Docker on Linux, read [INSTALL.Docker.md]

- ...with KVM on Linux, read [INSTALL.md], read [INSTALL.KVM.md]

- ...with Libvirt, read [INSTALL.Libvirt.md].

- ...without using a kernel module, read [INSTALL.userspace.md].

For answers to common questions, read [FAQ.md].

To learn how to set up SSL support for Open vSwitch, read [INSTALL.SSL.md].

To learn about some advanced features of the Open vSwitch software
switch, read the [tutorial/Tutorial.md].

Each Open vSwitch userspace program is accompanied by a manpage.  Many
of the manpages are customized to your configuration as part of the
build process, so we recommend building Open vSwitch before reading
the manpages.

Contact
-------

bugs@openvswitch.org

[INSTALL.md]:INSTALL.md
[INSTALL.Debian.md]:INSTALL.Debian.md
[INSTALL.Docker.md]:INSTALL.Docker.md
[INSTALL.Fedora.md]:INSTALL.Fedora.md
[INSTALL.KVM.md]:INSTALL.KVM.md
[INSTALL.Libvirt.md]:INSTALL.Libvirt.md
[INSTALL.RHEL.md]:INSTALL.RHEL.md
[INSTALL.SSL.md]:INSTALL.SSL.md
[INSTALL.userspace.md]:INSTALL.userspace.md
[INSTALL.XenServer.md]:INSTALL.XenServer.md
[FAQ.md]:FAQ.md
[tutorial/Tutorial.md]:tutorial/Tutorial.md


text:
import { Component, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { NavController } from 'ionic-angular';

import { AppearIn } from './../../utils/animations';
import { IListComponent } from './../interfaces';
import { ListParentComponent } from './../ListParent';
import { ListAuthorPage } from './../../pages/list/list-author';

/*
  Generated class for the PagesList component.

  See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
  for more info on Angular 2 Components.
*/
@Component({
  selector: 'users-list',
  templateUrl: 'users-list.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  animations: [AppearIn],
})
export class UsersListComponent extends ListParentComponent implements IListComponent {

  constructor(
    public navCtrl: NavController,
    public cdRef: ChangeDetectorRef,
  ) {
    super(navCtrl, cdRef);
  }

  openPage = (e, item) => {
    this.navCtrl.push(ListAuthorPage, {
      type: 'posts',
      id: item.id,
    })
  }
}


text:
https://gist.github.com/xgqfrms-GitHub/83f022cd3274d923a1adb7cb33a69605

https://app.pluralsight.com/paths/skills/react

https://app.pluralsight.com/player?course=react-js-getting-started&author=samer-buna&name=react-js-getting-started-m1&clip=0

https://codepen.io/SitePoint/pen/eWZeOp?editors=1010

https://codepen.io/xgqfrms/pen/yXXQdW?editors=0010


text:
module Rack
  module SimpleAuth
    # Contains different classes for authorizing against a hmac signed request
    module HMAC
      ##
      # Middleware class which represents the interface to the rack api via {#call}
      # and checks if a request is hmac authorized.
      #
      # @example Basic Usage
      #   "request_config = {
      #      'GET' => 'path',
      #      'POST' => 'params',
      #      'DELETE' => 'path',
      #      'PUT' => 'path',
      #      'PATCH' => 'path'
      #    }
      #
      #    use Rack::SimpleAuth::HMAC::Middleware do |options|
      #      options.tolerance = 1500
      #
      #      options.secret = 'test_secret'
      #      options.signature = 'test_signature'
      #
      #      options.logpath = "#{File.expand_path('..', __FILE__)}/logs"
      #      options.request_config = request_config
      #
      #      options.verbose = true
      #    end
      #
      #    run Rack::Lobster.new"
      #
      class Middleware
        ##
        # Constructor for Rack Middleware (passing the rack stack)
        #
        # @param [Rack Application] app [next middleware or rack app which gets called]
        #
        def initialize(app)
          @app, @config = app, Config.new

          yield @config if block_given?
        end

        ##
        # Rack API Interface Method
        #
        # @param [Hash] env [Rack Env Hash which contains headers etc..]
        #
        def call(env)
          # self.dup.call!(env)
          dup.call!(env)
        end

        ##
        # call! Method
        #
        # @param [Hash] env [Rack Env Hash which contains headers etc..]
        #
        def call!(env)
          env = env.dup
          request = Request.new(env, @config)

          if request.valid?
            @app.call(env)
          else
            response = Response.new('Unauthorized', 401, 'Content-Type' => 'text/html')
            response.finish
          end
        end
      end # Middleware
    end # HMAC
  end # SimpleAuth
end # Rack


text:
import * as constants from "./constants/effects";

export type IEffectStatistic =
  | "speed"
  | "footwork"
  | "strike"
  | "damage"
  | "block"
  | "toughness";

export interface IEffectCombatStatistic {
  type: constants.EFFECT_COMBAT_STATISTIC;
  increase: number;
  statistic: IEffectStatistic;
}

export interface IEffectConditionalText {
  type: constants.EFFECT_CONDITIONAL_TEXT;
  text: string[];
}

export interface IEffectChiThresholdIncreaseBaseChi {
  type: constants.EFFECT_CHI_THRESHOLD_INCREASE_BASE_CHI;
  chiIncrease: number;
}

export type IEffect =
  | IEffectCombatStatistic
  | IEffectConditionalText
  | IEffectChiThresholdIncreaseBaseChi;

export function effectToString(effect: IEffect): string {
  switch (effect.type) {
    case constants.EFFECT_COMBAT_STATISTIC:
      return (
        (effect.increase > 0 ? "+" : "") +
        effect.increase +
        " to " +
        effect.statistic
      );
    case constants.EFFECT_CONDITIONAL_TEXT:
      return effect.text.toString();
    case constants.EFFECT_CHI_THRESHOLD_INCREASE_BASE_CHI:
      return (
        (effect.chiIncrease > 0 ? "+" : "") +
        effect.chiIncrease +
        " to Chi Threshold"
      );
  }
}


text: Pair programming is fun


text:
import json

import numpy as np
import src.Graphics as artist
import matplotlib.pyplot as plt

from numpy.random import random_sample
from matplotlib import rcParams
from numpy.random import randint
from random import random
from itertools import izip_longest
from pprint import pprint

rcParams['text.usetex'] = True

#Connection matrix
READ = 'rU'
directory = json.load(open('directory.json',READ))

settings = directory['settings']['basal-ganglia']
params = settings['params']
total_duration = len(params['pattern'])*params['duration']['pattern'] + (len(params['pattern'])+1)*params['duration']['interpattern']

format = lambda txt: r'\Large \textbf{%s}'%txt

def sgn(activity):
	activity[activity>=0]=1
	activity[activity!=1]=-1
	return activity

M = np.loadtxt(settings['connections'],delimiter=',')
n_brain_areas = M.shape[1]

#Quick meaningful access to parts of connection matrix
stn = 3
gpi = 2

current = {'stn':np.array([0,0,0,-2,0,0]),
		   'gpi':np.array([0,0,-2,0,0,0]),
		   'background':np.zeros((n_brain_areas,))}

current['interpattern_interval'] = current['background']

area = {int(k):v for k,v in settings['area'].iteritems()}
inverse_area = {v: k for k, v in area.items()}

rectify = lambda current: current*np.greater(current,0)

#--Create patterns of stimulation
pattern_ = filter(None,[val for pair in izip_longest(['interpattern_interval']*(len(params['pattern'])+1),
										params['pattern'],fillvalue=None) for val in pair])

stimulation_pattern = np.concatenate([np.tile(current[condition],(params['duration']['interpattern' if 'interpattern' in condition else 'pattern'],1)).T
						for condition in pattern_],axis=1)

afferent_activation_pattern = np.concatenate([2*np.tile(rectify(M[eval(condition),:]) if 'gpi' in condition  or 'stn' in condition else np.zeros((n_brain_areas,)),
								(params['duration']['interpattern' if 'interpattern' in condition else 'pattern'],1)).T
									for condition in pattern_],axis=1)

#--Initial conditions
idx = randint(low=0,high=n_brain_areas,size=(total_duration,))
background_noise = 2*randint(2,size=(total_duration))-1

#initial_activity = 2*randint(2,size=(n_brain_areas,))-1
initial_activity = -np.ones((6,))
#Simulate  Parkinson's patient by making GPi,STN active
initial_activity[inverse_area['Gpi']] = 1
initial_activity[inverse_area['STN']] = 1

v = np.tile(initial_activity,(total_duration,1)).T
#v = np.zeros((n_brain_areas,total_duration))
v[:,0] = initial_activity

threshold = random_sample(size=(total_duration,))
F = lambda current: 1./(1+np.exp(-current))

debugging=False
for t in range(1,total_duration):
		# Determine the state of unit idx[t] at time t
		I = afferent_activation_pattern[:,t]#*v[:,t] # Afferent activation
		I[idx[t]] += M[:,idx[t]].dot(v[:,t-1])+stimulation_pattern[idx[t],t] #Target inhibition

		#Stochastically update the state of unit idx[t]
		v[idx[t],t] = 1 if F(I[idx[t]]) > threshold[t] else -1
		v[:,t] += stimulation_pattern[:,t] + afferent_activation_pattern[:,t]
		v[:,t] = sgn(v[:,t])
		#---Debugging
		if debugging:
			print '------------'
			print 'Unit %d selected, corresponding to %s'%(idx[t],area[idx[t]])
			print 'Kernel: ',M[:,idx[t]]
			print 'Network activity: ', v[:,t-1]
			print 'Stimulation pattern: ', stimulation_pattern[idx[t],t]
			print 'Total input %.02f'%I[5]
			print 'Probability: %.02f, threshold:%.02f'%(F(I[idx[t]]),threshold[t])
			print 'Acitvity %d -> %d'%(v[idx[t],t-1],v[idx[t],t])
			print '--------'
		#---

artist.raster_plot(v,filename='pain',duration=[params['duration']['interpattern' if 'interpattern' in condition else 'pattern'] for condition in pattern_])
#	parasite_labels=[condition if 'interpattern' not in condition else '' for condition in pattern_])

artist.firing_rate_plot(v,filename='pain',duration=[params['duration']['interpattern' if 'interpattern' in condition else 'pattern'] for condition in pattern_],
	parasite_labels=[condition if 'interpattern' not in condition else '' for condition in pattern_])


text:
var http = require('http'),
    httpProxy = require('http-proxy');

// --- Configuration section ---

// The server we want to call
var host = 'localhost';
var port = '8080';
var protocol = 'http'

// Proxy configuration
var proxyPort = 18080;

// Delay time for all requests not handled by the delay section
defaultTimeout = 0;

// --- End of configuration section ---

//
// Create the slowify proxy.
//
httpProxy.createServer(function (req, res, proxy) {
    //
    // Buffer the request so that `data` and `end` events
    // are not lost during async operation(s).
    //
    var buffer = httpProxy.buffer(req);

    // Set default timeout for all other request (NOT defined in delay section)
    var timeout = defaultTimeout;

    //
    // --- Delay section ---
    //
    // Set delay for different paths
    if (req.url.indexOf("/test") != -1) {
        timeout = 1000;
    }
    //
    // --- End of delay section ---
    //

    //
    // Wait until delegating the request.
    //
    setTimeout(function () {
            proxy.proxyRequest(req, res, {
                protocol: protocol,
                host: host,
                port: port,
                buffer: buffer
            });
        },
        // this is the delay
        timeout);

}).listen(proxyPort);


text:
var restify = require('restify');
var http = require("http");
var cheerio = require("cheerio");

/* node cachemanager */
var cacheManager = require('cache-manager');
/* storage for the cachemanager */
var fsStore = require('cache-manager-fs');
/* our cache store */
var diskCache = cacheManager.caching(
  {store: fsStore,
    options: {
      ttl: 60*60*100 /* seconds */,
      maxsize: 1000*1000*1000 /* max size in bytes on disk */,
      path:'appscache',
      preventfill:false
    }});

var globalDefineFlavor = "wandoujia";

var server = restify.createServer({
  name: 'app-apis',
  version: '1.0.5'
});

server.use(restify.acceptParser(server.acceptable));
server.use(restify.queryParser());
server.use(restify.bodyParser());

function download(url, reqCallback, package) {
  diskCache.get(package, function (err, result) {
        if (err) { return reqCallback(null); }

        /* cached, take it right from cache */
        if (result) {
            console.log("package [" + package + "] load from cache.");
            return reqCallback(result);
        }

        /* not cached, load it and parse the data */
        http.get(url, function(res) {
          var data = "";
          res.on('data', function (chunk) {
            data += chunk;
          });
          res.on("end", function() {
            console.log("package [" + package + "] load from network.");
            $ = cheerio.load(data);
            var parser = getParser(globalDefineFlavor);
            var result = parser($, package);
            diskCache.set(package,result);
            reqCallback(result);
          });
        }).on("error", function() {
          console.log("package [" + package + "] load html error.");
          reqCallback(null);
        });

    });
}

//by package name
var wandoujia = "http://www.wandoujia.com/apps/"
var appchina = "http://www.appchina.com/app/";
var coolapk = "http://coolapk.com/game/";//"http://coolapk.com/apk/";
var myapp = "http://android.myapp.com/myapp/detail.htm?apkName=";
var hiapk = "http://apk.hiapk.com/appinfo/";

// game flavor types
var wandoujiaTypes = ["wandoujia","wdj"];
var appchinaTypes = ["appchina","yyh"];
var myappTypes = ["tencent","tx","yyb","yingyongbao","tengxun"];
var hiapkTypes = ["baidu","bd","anzhuo"];

//by search
var _anzhi = "http://www.anzhi.com/search.php?keyword=weixin";
var _baidu = "http://shouji.baidu.com/s?wd=ai&data_type=app&f=header_all%40input&from=landing";
var _360 = "";

function getParser(flavor){
  switch(flavor){
    case "appchina":
      return appchinaParser;
    break;
    case "wandoujia":
      return wandoujiaParser;
    break;
    case "myapp":
      return myappParser;
    break;
    case "hiapk":
      return hiapkParser;
    break;
  }
}

function getRemoteServer(flavor){
  switch(flavor){
    case "appchina":
      return appchina;
    break;
    case "wandoujia":
      return wandoujia;
    break;
    case "coolapk":
      return coolapk;
    break;
    case "myapp":
      return myapp;
    break;
    case "hiapk":
      return hiapk;
    break;
  }
}

function appchinaParser($,package){
  var category = $(".breadcrumb a").eq(1).text();
  var subCategory = $(".breadcrumb a").eq(2).text();
  var appName = $(".app-msg .app-name").text();
  var appIconUrl = $(".app-msg .Content_Icon").attr("src");
  var appTextIntro = $(".main-info .art-content").text();
  var flavor = "";
  var flavorName = "";
  //分析渠道,通常只有游戏会有渠道
  for(var i = 0;i < appchinaTypes.length; i++){
    if(package.indexOf(appchinaTypes[i]) > 0){
      flavor = "appchina";
      flavorName = "应用汇";
    }
  }
  var result = {
    package:package,
    "category":category,
    "subCategory":subCategory,
    "appName":appName,
    "appIconUrleng":appIconUrl,
    "appTextIntro":appTextIntro,
    "tags":"",
    "flavor":flavor,
    "flavorName":flavorName
  };
  return result;
}

function wandoujiaParser($,package){
  var appTypes = "旅行·购票,理财·红包,视频·春晚,购物·年货,音乐,图像,新闻阅读,生活,实用工具,系统工具,美化手机,效率,办公,聊天社交,电话通讯,交通导航,生活服务,运动健康,教育培训,丽人,母婴";
  var gameTypes = "休闲时间,跑酷竞速,宝石消除,网络游戏,动作射击,扑克棋牌,儿童益智,塔防守卫,体育格斗,角色扮演,经营策略";
  var subCategory = $(".crumb .second span").text();
  var category = "";
  if(gameTypes.indexOf(subCategory) > 0){
    category = "游戏";
  }else{
    category = "软件";
  }
  var appName = $(".detail-top .app-name .title").text().trim();
  if(!appName) return;// app not in wandoujia market, absorb
  var appTag = $(".detail-top .app-info .tagline").text().trim();
  var appIconUrl = $(".detail-top .app-icon img").attr("src");
  var appTextIntro = $(".desc-info .con").text();
  var flavor = "";
  var flavorName = "";
  flavor = "wandoujia";
  flavorName = "豌豆荚";
  var result = {
    package:package,
    "category":category,
    "subCategory":subCategory,
    "appName":appName,
    "appIconUrl":appIconUrl,
    "appTextIntro":appTextIntro,
    "tags":appTag,
    "flavor":flavor,
    "flavorName":flavorName
  };
  return result;
}

function myappParser($,package){
  var appTypes = "视频,音乐,购物,阅读,导航,社交,摄影,新闻,工具,美化,教育,生活,安全,旅游,儿童,理财,系统,健康,娱乐,办公,通讯";
  var gameTypes = "休闲益智,网络游戏,动作冒险,棋牌中心,飞行射击,经营策略,角色扮演,体育竞速";
  var subCategory = $(".det-type-link").text();
  var category = "";
  if(gameTypes.indexOf(subCategory) > 0){
    category = "游戏";
  }else{
    category = "软件";
  }
  var appName = $(".det-main-container .det-name .det-name-int").text();
  var appIconUrl = $(".det-main-container .det-icon img").attr("src");
  var appTextIntro = $(".det-intro-container .det-app-data-info").text();
  var flavor = "";
  var flavorName = "";
  //分析渠道,通常只有游戏会有渠道
  for(var i = 0;i < myappTypes.length; i++){
    if(package.indexOf(myappTypes[i]) > 0){
      flavor = "myapp";
      flavorName = "应用宝";
    }
  }
  var result = {
    package:package,
    "category":category,
    "subCategory":subCategory,
    "appName":appName,
    "appIconUrl":appIconUrl,
    "appTextIntro":appTextIntro,
    "tags":"",
    "flavor":flavor,
    "flavorName":flavorName
  };
  return result;
}

function hiapkParser($,package){
  var subCategory = $(".detail_tip #categoryLink").text();
  var category = $(".detail_tip #categoryParent").text();
  var appName = $(".detail_content .detail_description .detail_title").text().trim();
  var appIconUrl = $(".detail_content .left img").attr("src");
  var appTextIntro = $(".soft_description #softIntroduce").text();
  var flavor = "";
  var flavorName = "";
  //分析渠道,通常只有游戏会有渠道
  for(var i = 0;i < hiapkTypes.length; i++){
    if(package.indexOf(myappTypes[i]) > 0){
      flavor = "hiapk";
      flavorName = "安智市场";
    }
  }
  var result = {
    package:package,
    "category":category,
    "subCategory":subCategory,
    "appName":appName,
    "appIconUrl":appIconUrl,
    "appTextIntro":appTextIntro,
    "tags":"",
    "flavor":flavor,
    "flavorName":flavorName
  };
  return result;
}

/* 将所有其他渠道的都转为豌豆荚渠道的 */
function transformPackage(package){
  return package.replace(/(\.mzw|\.muzhiwan|\.appchina|\.yyh|\.yinyonghui|\.yyb|\.myapp|\.hiapk|\.tencent|\.qq|\.baidu|\.bd|\.mi$)/ig,".wdj");
}

server.get('/app/category/:package', function (req, res, next) {
  console.log(getRemoteServer(globalDefineFlavor) + req.params.package)
  var transformedPackage = transformPackage(req.params.package);
  download(getRemoteServer(globalDefineFlavor) + transformedPackage, function(result) {
    if (result) {
      res.send(result);
      return next();
    }else {
      console.log("get html error for package:" + req.params.package);
      res.send({"result":"error","code":500,"msg":"cannot get html"});
      return next();
    }
  },transformedPackage);
});

server.post('/app/category', function (req, res, next) {
  if(req.params.packages){
    var packages = req.params.packages.split(",");
    var results = [];
    var success = 0;
    var failure = 0;
    console.log("start loading : " + req);
    function loadResult(packages,i){
      (function(packages,i){
        var transformedPackage = transformPackage(packages[i]);
        download(getRemoteServer(globalDefineFlavor) + transformedPackage, function(result) {
          if(result){
            results.push(result);
            success = success + 1;
          }else{
            failure = failure + 1;
          }
          if(success + failure == packages.length){
            res.send(results);
            return next();
          } else {
            j = i + 1;
            loadResult(packages,j);
          }
        },transformedPackage);
      })(packages,i);
    }
    loadResult(packages,0);
  }
});

server.listen(8080, function () {
  console.log('%s listening at %s', server.name, server.url);
});


text:
For now, see https://github.com/shexSpec/schemas/tree/master/biology/pathways/Wikipathways

## Data Nodes

* **data node** is tested for some minimal info by [datanode.shex](datanode.shex) and [datanode.json](datanode.json) ([run](https://rawgit.com/shexSpec/shex.js/master/packages/shex-webapp/doc/shex-simple.html?manifestURL=https://raw.githubusercontent.com/wikipathways/GPML2RDF/master/WP2RDF/src/test/resources/shex/datanode.json))


text:
def test_swagger_spec(client):
    res = client.get('/spec/')
    assert res.status_code == 200

def assert_redirect(res, location):
    assert res.status_code == 302
    assert 'Location' in res.headers
    assert res.headers['Location'].endswith(location)

def test_swagger_doc_redirect(client):
    res = client.get('/')
    assert_redirect(res, '/docs/')
    res = client.get('/docs/')
    assert_redirect(res, '/static/index.html')


text:
// Generated Source

interface PermissionCategoryResource {

    /**
     *
     */
    uri?: string;

    /**
     *
     */
    id?: string;

    /**
     *
     */
    displayName?: string;

    /**
     *
     */
    description?: string;
}

export default PermissionCategoryResource;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServiceStack.DataAnnotations;

namespace Canwell.OrmLite.MSAccess2003Tests.Entity
{
    [Alias("GuidTable")]
    public class GuidTableEntity
    {
        public Guid GuidColumn { get; set; }
        public string Name { get; set; }
    }
}


text:
name: Image
---
<section className={helpers.classNames({'mod-image': true, 'border-top': props.borderTop})}>
	<ResponsiveImage
		imageSrc={props.imageSrcSetM}
		imageSrcSetS={props.imageSrcSetS}
		imageSrcSetM={props.imageSrcSetM}
		imageSrcSetL={props.imageSrcSetL}
		ratioS="1.4"
		ratioM="1.86"
		ratioL="1.89"
		alt={props.alt}
		centeredImage={props.centeredImage}
		/>
</section>


text:
FROM ubuntu:18.04

# install challenge dependencies within the image
RUN apt-get update && apt-get install -y \
    openssh-server \
    socat

WORKDIR /challenge

# create a user with an authorized ssh key
RUN useradd -U challenge -d /challenge -s /bin/bash && \
    ssh-keygen -f /opt/challenge -C challenge@target -P "" && \
    mkdir -p /challenge/.ssh && \
    cat /opt/challenge.pub > /challenge/.ssh/authorized_keys &&  \
    chown -R challenge:challenge /challenge/.ssh && \
    chmod 600 /challenge/.ssh/authorized_keys

# disable motd
RUN sed -i '/^session    optional     pam_motd.so/d' /etc/pam.d/sshd

# the flag file is templated by pico prior to being copied in
COPY flag /challenge/flag

COPY start.sh /opt/start.sh

EXPOSE 22
EXPOSE 5555
CMD ["/opt/start.sh"]


text:
<!DOCTYPE html>

<title>BookmarkFolder_constructor</title>
<meta charset="utf-8"/>


text:
- Retrieving Events
    - From various data sources supporting various message formats
 - Mapping Events
    - Mapping events with various data formats to Stream for processing
    - Mapping streams to multiple data formats for publishing
 - Processing Streams
    - Filter
        - Filtering stream based on conditions
    - Window
        - Support for sliding and batch (tumbling) and many other type of windows
    - Aggregation
        - For long running aggregations and aggregation over windows
        - Supporting `Avg`, `Sum`, `Min`, `Max`, etc
        - Ability aggregate processing with `Group by` and filter aggrigated data with `Having` conditions
    - Incremental summarisation
        - Support for processing and retrieving long running summarisations
    - Table
        - For storing events for future processing and retrieving them on demand
        - Supporting storage in in-memory, RDBMs, Solr, mongoDb, etc
    - Join
        - Joining two streams based on conditions
        - Joining a streams with table or incremental summarisation based on conditions
        - Supports Left, Right & Full Outer Joins and Inner Joins
    - Pattern
        - Identifies event occurrence patterns among streams
        - Identify non occurrence of events
        - Supports repetitive matches of event pattern occurrences with logical conditions and time bound
    - Sequence processing
        - Identifies continuous sequence of events from streams
        - Supports zero to many, one to many, and zero to one condition
    - Partitions
        - Grouping queries and based on keywords and value ranges for isolated parallel processing
    - Scripting
        - Support writing scripts like JavaScript, Scala and R within Siddhi Queries
    - Process Based on event time
        - Whole execution driven by the event time
 - Publishing Events
    - To various data sources with various message formats
    - Supporting load balancing and failover data publishing
 - Snapshot and restore
    - Support for periodic state persistence and restore capabilities for long running execution


text:
.. Control Charts documentation master file, created by
   sphinx-quickstart on Mon Nov 19 13:39:01 2012.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

==================================================
Control Charts for people who need them
==================================================

Release v\ |version|. (:ref:`Installation <install>`)

Controlchart is an :ref:`ISC Licensed <isc>` Control Chart library, written in Python, for normal people.

Control charts are really useful tools to help you understand how 'in control your process is'
so you can help make management changes based on real information.

Here's a quick demo:

Say I have a process that churns out widgets, and the quality (% of customers where the widget
has met or exceeded the customer's expectation)
is distributed as below:

    >>> widgets_quality = [56, 75, 82, 12, 34, 18, 22, 81, 88, 91, 76, 85, 100, 88, 43, 44]

Control charts are really easy to create - read the code - but reading a control chart, and doing
the right thing is more important than writing the code.

This is people's lives we're messing with :)

    >>> from spcchart import SpcChart
    >>> widgets_quality = [56, 75, 82, 12, 34, 18, 22, 81, 88, 91, 76, 85, 100, 88, 43, 44]
    >>> c = SpcChart(widgets_quality, title="Widget Quality")
    >>> c.render()

From the command line
----------------------

    >>> spcchart --data=56,75,82,12,34,18,22,81,88,91,76,85,100,88,43,44 --title="Widget Quality"
    >>> Created file: file:///<your working directory>/SzaQfdjhMaqhQBFMTw8UZe.svg

When open it in a browser you get:

.. image:: http://benhughes.org.s3.amazonaws.com/controlcharts/spc.png

Thanks
-------
**Kenneth Reitz**
    For inspiring great software, wirting great Python, and most of all for the outstanding
    libraries he writes including tablib - on which controlchart is based.

**John Chaimberlain**
    All round firebrand and lecturer at the University of Derby.

**John Seddon**
    For applying uncommon sense to common practice.

Contents:

.. toctree::
   :maxdepth: 2

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
import React from 'react';
import {action} from '@storybook/addon-actions';
import {withInfo} from '@storybook/addon-info';

import ConfigStore from 'app/stores/configStore';
import Note from 'app/components/activity/note';

const user = {
  username: 'billy@sentry.io',
  identities: [],
  id: '1',
  name: 'billy@sentry.io',
  dateJoined: '2019-03-09T06:52:42.836Z',
  avatar: {avatarUuid: null, avatarType: 'letter_avatar'},
  email: 'billy@sentry.io',
};

ConfigStore.set('user', {...user, isSuperuser: true, options: {}});

export default {
  title: 'UI/Activity/Note',
};

export const Default = withInfo(
  'A `<Note>` is an `<ActivityItem>` that can be edited with an editor. The editor has an input mode and a preview mode.'
)(() => (
  <Note
    author={{name: 'Billy'}}
    item={{id: '123', data: {text: 'hello'}, user, dateCreated: new Date()}}
    group={{project: {slug: 'sentry'}}}
    onDelete={action('Deleted item')}
    sessionUser={{}}
    memberList={[]}
  />
));

Default.story = {
  name: 'default',
};


text:
package com.glaf.ueditor.web.springmvc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.glaf.ueditor.ActionEnter;

@Controller("/ueditor")
@RequestMapping("/ueditor")
public class UeditorController {
	protected static final Log logger = LogFactory.getLog(UeditorController.class);

	@RequestMapping("/execute")
	@ResponseBody
	public byte[] execute(HttpServletRequest request, HttpServletResponse response, String action) throws Exception {
		logger.debug("action:" + action);
		request.setCharacterEncoding("utf-8");
		response.setHeader("Content-Type", "application/json");
		String rootPath = request.getServletContext().getRealPath("/");
		ActionEnter actionEnter = new ActionEnter(request, rootPath);
		String exec = actionEnter.exec();
		if (action != null && (action.equals("listfile") || action.equals("listimage"))) {
			rootPath = rootPath.replace("\\", "/");
			exec = exec.replaceAll(rootPath, request.getContextPath());// 针对图片保存到库处理
		}
		// logger.debug(exec);
		return exec.getBytes("UTF-8");
	}

}


text:
/* jshint expr: true */
/* global chai, before, describe, it */

var expect = chai.expect;

var ready;
before(function (done) {
  ready = done;
});

window.addEventListener('WebComponentsReady', function() {

  // Add the HTMLImport for the custom element.
  document.head.innerHTML += '<link rel="import" id="el" href="/base/src/brick-listview.html">';

  document.querySelector('#el').addEventListener('load', function() {

    // Create the custom element.
    var customElement = document.createElement('brick-listview');
    // customElement.setAttribute('attribute-value', attrbute);

    // Add the custom element to the page.
    // This will trigger the element's attachedCallback function.
    document.body.appendChild(customElement);

    ready();

  });
});

describe("the brick-listview", function(){

  it("should be attached to the DOM", function(){
    expect(document.querySelector("brick-listview")).not.to.be.null;
  });

});


text:
package jToolkit4FixedPipeline.vector.triangle.sector;

import jToolkit4FixedPipeline.vector.triangle.Trianglef;

/**
 * Each 3D world is basically a collection of sectors.
 * A sector can be a room, a cube, or any enclosed volume.
 * @author Astemir Eleev
 */
public class Sectorf {
    private  int numTriangles;
    private Trianglef triangle[]; //holds class Triangle objects

    public Sectorf(int num) {
        numTriangles = num;
        triangle = new Trianglef[numTriangles];

        for (int i = 0; i < numTriangles; i++) {
            triangle[i] = new Trianglef();
        }
    }

    public Sectorf getSector () {
        return this;
    }

    @Override
    public String toString () {
        return triangle[0].toString() + "\n" +
                    triangle[1].toString() + "\n" +
                        triangle[2].toString();
    }
}


text:
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_HTMLSpanElement_h
#define mozilla_dom_HTMLSpanElement_h

#include "mozilla/Attributes.h"
#include "nsIDOMHTMLElement.h"
#include "nsGenericHTMLElement.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsIAtom.h"
#include "nsRuleData.h"

namespace mozilla {
namespace dom {

class HTMLSpanElement final : public nsGenericHTMLElement
{
public:
  explicit HTMLSpanElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
    : nsGenericHTMLElement(aNodeInfo)
  {
  }

  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;

protected:
  virtual ~HTMLSpanElement();

  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLSpanElement_h


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<base href="../../../" />

		<link type="text/css" rel="stylesheet" href="page.css" />

Testando com NPM

            Este artigo mostra como colocar o three.js em um ambiente [link:https://nodejs.org/en/ node.js] para que você
            possa executar testes automatizados. Os testes podem ser executados na linha de comando ou por
            Ferramentas de CI como [link:https://travis-ci.org/ Travis].

A versão curta

			Se você estiver confortável com node e npm,

				$ npm install three --save-dev

			e adicione

			const THREE = require('three');

			para o seu teste.

Criar um projeto testável do zero

            Se você não estiver familiarizado com essas ferramentas, aqui está um guia rápido (para linux, o processo de instalação
            será um pouco diferente do que usando o Windows, mas os comandos do NPM são idênticos).

Configuração básica

					Instale o [link:https://www.npmjs.org/ npm] e o nodejs. O caminho mais curto normalmente parece algo como

$ sudo apt-get install -y npm nodejs-legacy
# fix any problems with SSL in the default registry URL
$ npm config set registry http://registry.npmjs.org/

					Crie um novo diretório de projeto

						 $ mkdir test-example; cd test-example

					Peça ao npm para criar um novo arquivo de projeto para você:

					 $ npm init

                    e aceite todas as opções default pressionando Enter em todos os prompts.
                    Isso criará o package.json.

					Experimente iniciar o recurso de teste com

$ npm test

					Isso falhará, o que é esperado.
                    Se você olhar no package.json, a definição do script de teste é

						"test": "echo \"Error: no test specified\" && exit 1"

Adicionar mocha

			Vamos usar o [link:https://mochajs.org/mocha].

					Instale o mocha com

$ npm install mocha --save-dev

					Observe que a pasta node_modules/ é criada e suas dependências aparecem lá.
                    Observe também que seu package.json foi atualizado: a propriedade devDependencies
                    é adicionada e atualizada pelo uso de --save-dev.

                    Edite o package.json para usar o mocha para teste. Quando o teste for chamado, queremos apenas executar
                    o mocha e especificar um relatório detalhado. Por padrão, isso executará qualquer coisa em test/
                    (não ter a pasta test/ pode levar a um ERR! no npm, crie-a pelo comando mkdir test)

						"test": "mocha --reporter list"

					Reexecute o teste com

						$ npm test

                    Isso agora deve correr bem, reportando "0 passing (1ms)"
                    ou similar.

Adicionar three.js

					Vamos baixar nossa dependência three.js com

$ npm install three --save-dev

							Se você precisar de uma versão diferente do three.js, use

								$ npm show three versions

                          para listar o que está disponível. Para escolher pelo npm a versão correta, use

 $ npm install three@0.84.0 --save

							(0.84.0 nesse exemplo). --save torna isso uma dependência do projeto, em vez de
                            dependência dev. Veja os documentos [link:https://docs.npmjs.com/cli/v8/configuring-npm/package-json aqui] para mais informações.

					Mocha irá procurar por testes em test/, então vamos executar

					$ mkdir test

                    Finalmente, precisamos de um teste JS para ser executado. Vamos adicionar um teste simples que verificará que
                    o objeto three.js está disponível e funcionando. Crie test/verify-three.js contendo:

const THREE = require('three');
const assert = require('assert');

describe('The THREE object', function() {
  it('should have a defined BasicShadowMap constant', function() {
    assert.notEqual('undefined', THREE.BasicShadowMap);
  }),

  it('should be able to construct a Vector3 with default of x=0', function() {
    const vec3 = new THREE.Vector3();
    assert.equal(0, vec3.x);
  })
})

                Finalmente vamos testar novamente com $ npm test. Isso deve executar os testes acima e ter sucesso,
                mostrando algo como:

The THREE object should have a defined BasicShadowMap constant: 0ms
The THREE object should be able to construct a Vector3 with default of x=0: 0ms
2 passing (8ms)

Adicione seu próprio código

			Você precisa fazer três coisas:

					Escreva um teste para o comportamento esperado do seu código e coloque-o em test/.
					[link:https://github.com/air/encounter/blob/master/test/Physics-test.js aqui] tem um exemplo de um projeto real.

					Exporte seu código funcional de forma que o nodejs possa vê-lo, para uso em conjunto com require.
					Veja isso [link:https://github.com/air/encounter/blob/master/js/Physics.js aqui].

                    Requisite seu código no arquivo de teste, da mesma forma que fizemos um require('three') no exemplo acima.

                Os itens 2 e 3 variam dependendo de como você gerencia seu código. No exemplo de Physics.js
                dado acima, a parte de exportação está bem no final. Atribuímos um objeto a module.exports:

//=============================================================================
// make available in nodejs
//=============================================================================
if (typeof exports !== 'undefined')
{
  module.exports = Physics;
}

Lidando com dependências

				Se você já estiver usando algo como require.js ou browserify, pule esta parte.

                Normalmente, um projeto three.js será executado no navegador. O carregamento do módulo é, portanto, feito pelo
                navegador, executando um monte de tags de script. Seus arquivos individuais não precisam se preocupar
                com dependências. No entanto, em um contexto nodejs, não há index.html vinculando tudo
                junto, então você tem que ser explícito.

				Se você estiver exportando um módulo que depende de outros arquivos, precisará dizer ao node para carregá-los.
                Aqui está uma abordagem:

					No início do seu módulo, verifique se você está em um ambiente nodejs.

					Em caso afirmativo, declare explicitamente suas dependências.

					Caso contrário, você provavelmente está em um navegador, então não precisa fazer mais nada.

			Código de exemplo de Physics.js:

//=============================================================================
// setup for server-side testing
//=============================================================================
if (typeof require === 'function') // test for nodejs environment
{
  const THREE = require('three');
  const MY3 = require('./MY3.js');
}


text:
pymatgen.analysis.chemenv.utils.coordination\_geometry\_utils module
====================================================================

.. automodule:: pymatgen.analysis.chemenv.utils.coordination_geometry_utils
    :members:
    :undoc-members:
    :show-inheritance:


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <name>Workaround for Asakusa Runtime Libraries</name>
  <artifactId>asakusa-runtime-workaround</artifactId>
  <parent>
    <artifactId>asakusa-core-project</artifactId>
    <groupId>com.asakusafw</groupId>
    <version>0.10.5-SNAPSHOT</version>
  </parent>

  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>asakusa-runtime</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>${hadoop.artifact.id}</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


text:
Metro Hair Salon & Spa

place13505 Icot Blvd. Suite 201 Clearwater, FL 33760

phone(727)-539-7797

emailmetrohairtexts@gmail.com

		Metro Hair Salon & Spa &copy Copyright 2016. All Rights Reserved.
		favorite


text:
package de.spqrinfo.resubmission.persistence;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Entity
@NamedQueries({
        @NamedQuery(name="UploadFile.deleteOlderThan",
                query="DELETE from UploadFile c WHERE c.temporary = true AND c.created <= :when"),
        @NamedQuery(name= "UploadFile.findTemporary",
                query="SELECT uf FROM UploadFile uf WHERE uf.temporary = true AND uf.uploadId = :id")
})
public class UploadFile {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long uploadId;

    @NotNull
    private String filename;

    @NotNull
    private String contentType;

    @NotNull
    private long size;

    @NotNull
    @Column(length = 1024 * 1024 * 10)
    private byte[] data;

    @NotNull
    private Date created;

    private boolean temporary = true;

    public Long getUploadId() {
        return this.uploadId;
    }

    @SuppressWarnings("UnusedDeclaration")
    public void setUploadId(final Long uploadId) {
        this.uploadId = uploadId;
    }

    public String getFilename() {
        return this.filename;
    }

    public void setFilename(final String filename) {
        this.filename = filename;
    }

    public String getContentType() {
        return this.contentType;
    }

    public void setContentType(final String contentType) {
        this.contentType = contentType;
    }

    public long getSize() {
        return this.size;
    }

    public void setSize(final long size) {
        this.size = size;
    }

    public byte[] getData() {
        return this.data;
    }

    public void setData(final byte[] data) {
        this.data = data;
    }

    public Date getCreated() {
        return this.created;
    }

    public void setCreated(final Date created) {
        this.created = created;
    }

    public boolean isTemporary() {
        return this.temporary;
    }

    public void setTemporary(final boolean temporary) {
        this.temporary = temporary;
    }
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="api_platform.metadata.operation.metadata_factory" class="ApiPlatform\Metadata\Operation\Factory\OperationMetadataFactory" public="false">
            <argument type="service" id="api_platform.metadata.resource.name_collection_factory" />
            <argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
        </service>
    </services>
</container>


text:
/*
 * autodiff.h
 *
 *  Created on: 16 Apr 2013
 *      Author: s0965328
 */

#ifndef AUTODIFF_H_
#define AUTODIFF_H_
#include <boost/unordered_set.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
#include "auto_diff_types.h"
#include "Node.h"
#include "VNode.h"
#include "OPNode.h"
#include "PNode.h"
#include "ActNode.h"
#include "EdgeSet.h"

/*
 * + Function and Gradient Evaluation
 * The tapeless implementation for function and derivative evaluation
 * Advantage for tapeless:
 * 			Low memory usage
 * 			Function evaluation use one stack
 * 			Gradient evaluation use two stack.
 * Disadvantage for tapeless:
 * 			Inefficient if the expression tree have repeated nodes.
 * 			for example:
 * 						 root
 * 						 /  \
 * 						*    *
 * 					   / \	/ \
 * 				      x1 x1 x1 x1
 * 				      Tapeless implementation will go through all the edges.
 * 				      ie. adjoint of x will be updated 4 times for the correct
 * 				      gradient of x1.While the tape implemenation can discovery this
 * 				      dependence and update adjoint of x1 just twice. The computational
 * 				      graph (DAG) for a taped implemenation will be look like bellow.
 * 				       root
 * 				        /\
 * 				        *
 * 				        /\
 * 				        x1
 *
 * + Forward Hessian Evaluation:
 * This is an inefficient implementation of the forward Hessian method. It will evaluate the diagonal
 * and upper triangular of the Hessian. The gradient is also evaluation in the same routine. The result
 * will be returned in an array.
 * To use this method, one have to provide a len parameter. len = (nvar+3)*nvar/2 where nvar is the number
 * of independent variables. ie. x_1 x_2 ... x_nvar. And the varaible id need to be a consequent integer start
 * with 0.
 * ret_vec will contains len number of doubles. Where the first nvar elements is the gradient vector,
 * and the rest of (nvar+1)*nvar/2 elements are the upper/lower plus the diagonal part of the Hessian matrix
 * in row format.
 * This algorithm is inefficient, because at each nodes, it didn't check the dependency of the independent
 * variables up to the current node. (or it is hard to do so for this setup). Therefore, it computes a full
 * for loops over each independent variable (ie. assume they are all dependent), for those independent
 * variables that are not dependent at the current node, zero will be produced by computation.
 * By default the forward mode hessian routing is disabled. To enable the forward hessian interface, the
 * compiler marco FORWARD_ENABLED need to be set equal to 1 in auto_diff_types.h
 *
 * + Reverse Hessian*Vector Evaluation:
 * Simple, building a tape in the forward pass, and a reverse pass will evaluate the Hessian*vector. The implemenation
 * also discovery the repeated subexpression and use one piece of memory on the tape for the same subexpression. This
 * allow efficient evaluation, because the repeated subexpression only evaluate once in the forward and reverse pass.
 * This algorithm can be called n times to compute a full Hessian, where n equals the number of independent
 * variables.
 * */

typedef boost::numeric::ublas::compressed_matrix<double,boost::numeric::ublas::column_major,0,std::vector<std::size_t>,std::vector<double> >  col_compress_matrix;
typedef boost::numeric::ublas::matrix_row<col_compress_matrix > col_compress_matrix_row;
typedef boost::numeric::ublas::matrix_column<col_compress_matrix  > col_compress_matrix_col;

namespace AutoDiff{

	//node creation methods
	extern PNode* create_param_node(double value);
	extern VNode* create_var_node(double v=NaN_Double);
	extern OPNode* create_uary_op_node(OPCODE code, Node* left);
	extern OPNode* create_binary_op_node(OPCODE code, Node* left,Node* right);

	//single constraint version
	extern double eval_function(Node* root);
	extern unsigned int nzGrad(Node* root);
	extern double grad_reverse(Node* root,vector<Node*>& nodes, vector<double>& grad);
	extern unsigned int nzHess(EdgeSet&);
	extern double hess_reverse(Node* root, vector<Node*>& nodes, vector<double>& dhess);

	//multiple constraints version
	extern unsigned int nzGrad(Node* root, boost::unordered_set<Node*>& vnodes);
	extern double grad_reverse(Node* root, vector<Node*>& nodes, col_compress_matrix_row& rgrad);
	extern unsigned int nzHess(EdgeSet&,boost::unordered_set<Node*>& set1, boost::unordered_set<Node*>& set2);
	extern double hess_reverse(Node* root, vector<Node*>& nodes, col_compress_matrix_col& chess);

#if FORWARD_ENDABLED
	//forward methods
	extern void hess_forward(Node* root, unsigned int nvar, double** hess_mat);
#endif

	//utiliy methods
	extern void nonlinearEdges(Node* root, EdgeSet& edges);
	extern unsigned int numTotalNodes(Node*);
	extern string tree_expr(Node* root);
	extern void print_tree(Node* root);
	extern void autodiff_setup();
	extern void autodiff_cleanup();
};

#endif /* AUTODIFF_H_ */


text:
		<title>My personal portfolio - Maurizio Aru</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="author" content="Maurizio Aru" />
		<meta name="description" content="Maurizio Aru's Personal portfolio page" />

		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster" />
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
		<link rel="stylesheet" href="css/styles.css" />

				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">

				</button>
				.:: Maurizio Aru ::.

Home

About

Portfolio

Contact

Maurizio Aru

Personal portfolio page

ABOUT ME

My name is Maurizio and I am an developer. I work hard to improve myself and achieve my goals. Now I learn on FreeCodeCamp course.
						My passions are my family, music and new technologies. I like doing sports and meet with my friends whenever I can.

Below you can see some of my work.

Front-End Skills:

HTML

CSS

Javascript

Bootstrap

Back-End Skills:

NodeJs

Java

Perl

PHP

PORTFOLIO

 GinoPc.it

 StudioAru.it

 DecorParty.it

 ScSardegna.it

 DesparSardegna.it

 Wikipedia

CONTACT

				<form method="post" action="#">

						<input type="text" id="name" name="name" required="required" placeholder="Put you name" />

						<input type="email" id="email" name="email" placeholder="address@example.com" required="required" />

						<textarea id="message" name="message" required="required" data-minlength="20"></textarea>

						<input type="submit" value="Submit" class="btn btn-default" id="submit-button" />

You can also visit my personal social pages. Press buttons on top of the page

							Go Up

				</form>

Home

About

Portfolio

Contact


text:
import re
from collections import Counter

from unidecode import unidecode

__author__ = 'Michał Ciołczyk'

_remove_not_letters = re.compile("[^a-z\s]")

def n_grams_from_data(data, n):
    n_grams = Counter()
    data = unidecode(data.lower()).lower()
    data = _remove_not_letters.sub('', data)
    for word in data.split():
        for n_gram in zip(*(word[c:] for c in range(n))):
            n_grams["".join(n_gram)] += 1
    return n_grams


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boletín de la Soc. Ciencias de Córdoba 29(2-3): 169 (1926)

#### Original name
Pyrenochaeta argentinensis Speg.

### Remarks
null


text:
Run the shell scripts inline in pre and post create steps

[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run)


text:
package com.google.privacy.dlp.v2;

/**
 * AUTO-GENERATED DOCUMENTATION AND CLASS
 *
 * @deprecated This resource name class will be removed in the next major version.
 */
@javax.annotation.Generated("by GAPIC protoc plugin")
@Deprecated
public class InspectTemplateNames {
  private InspectTemplateNames() {}

  public static InspectTemplateName parse(String resourceNameString) {
    if (OrganizationInspectTemplateName.isParsableFrom(resourceNameString)) {
      return OrganizationInspectTemplateName.parse(resourceNameString);
    }
    if (ProjectInspectTemplateName.isParsableFrom(resourceNameString)) {
      return ProjectInspectTemplateName.parse(resourceNameString);
    }
    return UntypedInspectTemplateName.parse(resourceNameString);
  }
}


text:
(function () {
	'use strict'

	const HtmlReporter = {}

	let progressElement
	let progressValue, progressTotal

	HtmlReporter.describe = function (description, config, nTests) {
		const entry = document.createElement('div')
		entry.classList.add('config')

		const title = document.createElement('h5')
		title.classList.add('config-title')
		title.innerText = description
		entry.appendChild(title)

		progressValue = 0
		progressTotal = nTests

		const progress = document.createElement('span')
		progress.classList.add('config-progress')
		progress.innerText = '(' + progressValue + '/' + progressTotal + ')'
		title.appendChild(progress)

		if (config) {
			const content = document.createElement('p')
			content.classList.add('config-content')

			const stringifiedConfig = Object.keys(config).reduce(function (prev, key) {
				return prev + (key + ': ' + config[key] + '<br>')
			}, '')

			content.innerHTML = stringifiedConfig
			entry.appendChild(content)
		}

		document.body.appendChild(entry)

		progressElement = progress
	}

	HtmlReporter.report = function (message) {
		const entry = document.createElement('p')
		entry.classList.add('mismatch')

		const title = document.createElement('h5')
		title.innerText = '!'
		title.classList.add('mismatch-title')
		entry.appendChild(title)

		const content = document.createElement('p')
		content.innerHTML = message
		content.classList.add('mismatch-content')
		entry.appendChild(content)

		document.body.appendChild(entry)
	}

	HtmlReporter.advance = function () {
		progressValue++
		progressElement.innerText = '(' + progressValue + '/' + progressTotal + ')'
	}

	window.rand = window.rand || {}
	window.rand.HtmlReporter = HtmlReporter
})()


text:
/**
* Exit script interface.
*/
#pragma once
#include "../mud.h"

void RegisterExitMethods(const char* obj);
void InitializeExit();


text:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.OLE.Interop;

namespace Microsoft.VisualStudio.LanguageServices.Lua.Shared
{
    internal class CommandFilter : IOleCommandTarget
    {
        public CommandFilter()
        {
            this.MiniFilters = new List<IMiniCommandFilter>();
        }

        public IOleCommandTarget Next { get; set; }

        public IList<IMiniCommandFilter> MiniFilters { get; private set; }

        internal static char GetTypedChar(IntPtr pvaIn)
        {
            return (char)(ushort)Marshal.GetObjectForNativeVariant(pvaIn);
        }

        public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            bool handled = false;
            int hresult = VSConstants.S_OK;

            // Give the commands a chance to pre-process the command
            foreach (IMiniCommandFilter filter in this.MiniFilters)
            {
                handled = filter.PreProcessCommand(pguidCmdGroup, nCmdID, pvaIn);

                if (handled)
                {
                    break;
                }
            }

            if (!handled)
            {
                hresult = this.Next.Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
            }

            if (ErrorHandler.Succeeded(hresult))
            {
                // Let the command filters post-process any successful commands
                foreach (IMiniCommandFilter filter in this.MiniFilters)
                {
                    // Let all commands post-process for now.
                    filter.PostProcessCommand(pguidCmdGroup, nCmdID, pvaIn, handled);
                }
            }

            return hresult;
        }

        public void Close()
        {
            foreach (IMiniCommandFilter filter in this.MiniFilters)
            {
                filter.Close();
            }

            this.MiniFilters.Clear();
        }

        public int QueryStatus(ref Guid pguidCmdGroup, uint commandsCount, OLECMD[] prgCmds, IntPtr pCmdText)
        {
            foreach (IMiniCommandFilter filter in this.MiniFilters)
            {
                OLECMDF commandStatus;
                if (filter.QueryCommandStatus(pguidCmdGroup, prgCmds[0].cmdID, pCmdText, out commandStatus))
                {
                    prgCmds[0].cmdf = (uint)commandStatus;
                    return VSConstants.S_OK;
                }
            }

            return this.Next.QueryStatus(pguidCmdGroup, commandsCount, prgCmds, pCmdText);
        }
    }
}


text:
import * as assert from 'assert';
import { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { range } from 'vs/base/common/arrays';
import { timeout } from 'vs/base/common/async';

suite('ListWidget', function () {
	test('Page up and down', async function () {
		const element = document.createElement('div');
		element.style.height = '200px';
		element.style.width = '200px';

		const delegate: IListVirtualDelegate<number> = {
			getHeight() { return 20; },
			getTemplateId() { return 'template'; }
		};

		let templatesCount = 0;

		const renderer: IListRenderer<number, void> = {
			templateId: 'template',
			renderTemplate() { templatesCount++; },
			renderElement() { },
			disposeTemplate() { templatesCount--; }
		};

		const listWidget = new List<number>('test', element, delegate, [renderer]);

		listWidget.layout(200);
		assert.strictEqual(templatesCount, 0, 'no templates have been allocated');
		listWidget.splice(0, 0, range(100));
		listWidget.focusFirst();

		listWidget.focusNextPage();
		assert.strictEqual(listWidget.getFocus()[0], 9, 'first page down moves focus to element at bottom');

		// scroll to next page is async
		listWidget.focusNextPage();
		await timeout(0);
		assert.strictEqual(listWidget.getFocus()[0], 19, 'page down to next page');

		listWidget.focusPreviousPage();
		assert.strictEqual(listWidget.getFocus()[0], 10, 'first page up moves focus to element at top');

		// scroll to previous page is async
		listWidget.focusPreviousPage();
		await timeout(0);
		assert.strictEqual(listWidget.getFocus()[0], 0, 'page down to previous page');

		listWidget.dispose();
	});

	test('Page up and down with item taller than viewport #149502', async function () {
		const element = document.createElement('div');
		element.style.height = '200px';
		element.style.width = '200px';

		const delegate: IListVirtualDelegate<number> = {
			getHeight() { return 200; },
			getTemplateId() { return 'template'; }
		};

		let templatesCount = 0;

		const renderer: IListRenderer<number, void> = {
			templateId: 'template',
			renderTemplate() { templatesCount++; },
			renderElement() { },
			disposeTemplate() { templatesCount--; }
		};

		const listWidget = new List<number>('test', element, delegate, [renderer]);

		listWidget.layout(200);
		assert.strictEqual(templatesCount, 0, 'no templates have been allocated');
		listWidget.splice(0, 0, range(100));
		listWidget.focusFirst();
		assert.strictEqual(listWidget.getFocus()[0], 0, 'initial focus is first element');

		// scroll to next page is async
		listWidget.focusNextPage();
		await timeout(0);
		assert.strictEqual(listWidget.getFocus()[0], 1, 'page down to next page');

		// scroll to previous page is async
		listWidget.focusPreviousPage();
		await timeout(0);
		assert.strictEqual(listWidget.getFocus()[0], 0, 'page up to next page');

		listWidget.dispose();
	});
});