text:
<?xml version="1.0" encoding="utf-8"?>

<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />

<meta name="paf_template" content="" />

<meta name="ncbi_db" content="pmc" />
<meta name="ncbi_pdid" content="article" />
<meta name="ncbi_acc" content="" />
<meta name="ncbi_domain" content="brjclinpharm" />
<meta name="ncbi_report" content="record" />
<meta name="ncbi_type" content="fulltext" />
<meta name="ncbi_objectid" content="" />
<meta name="ncbi_pcid" content="/articles/PMC2042747/" />
<meta name="ncbi_app" content="pmc" />
<title>Effect of ketoconazole on the pharmacokinetics of imipramine
and desipramine in healthy subjects</title>

<link rel="stylesheet" href="/core/jig/1.14.4/css/jig.min.css" />

<meta name="robots" content="INDEX,NOFOLLOW,NOARCHIVE" />
<link rel="canonical" href="/pmc/articles/PMC2042747/" />
<link rel="schema.DC" href="http://purl.org/DC/elements/1.0/" />
<meta name="citation_journal_title" content=
"British Journal of Clinical Pharmacology" />
<meta name="citation_title" content=
"Effect of ketoconazole on the pharmacokinetics of imipramine and desipramine in healthy subjects" />
<meta name="citation_authors" content=
"E. 					 Spina, A. 					 Avenoso, G. M. 					 Campo, M. G. 					 Scordo, A. P. 					 Caputi, E. 					 Perucca" />
<meta name="citation_date" content="March 1997" />
<meta name="citation_issue" content="3" />
<meta name="citation_volume" content="43" />
<meta name="citation_firstpage" content="315" />
<meta name="citation_doi" content=
"10.1046/j.1365-2125.1997.00539.x" />
<meta name="citation_pdf_url" content=
"/pmc/articles/PMC2042747/pdf/bcp_0539.pdf" />
<meta name="citation_abstract_html_url" content=
"/pmc/articles/PMC2042747/?report=abstract" />
<meta name="citation_pmid" content="9088587" />
<meta name="DC.Title" content=
"Effect of ketoconazole on the pharmacokinetics of imipramine and desipramine in healthy subjects" />
<meta name="DC.Type" content="Text" />
<meta name="DC.Publisher" content="Wiley-Blackwell" />
<meta name="DC.Contributor" content="E. 					 Spina" />
<meta name="DC.Contributor" content="A. 					 Avenoso" />
<meta name="DC.Contributor" content="G. M. 					 Campo" />
<meta name="DC.Contributor" content="M. G. 					 Scordo" />
<meta name="DC.Contributor" content="A. P. 					 Caputi" />
<meta name="DC.Contributor" content="E. 					 Perucca" />
<meta name="DC.Date" content="1997 Mar" />
<meta name="DC.Identifier" content=
"10.1046/j.1365-2125.1997.00539.x" />
<meta name="DC.Language" content="en" />
<meta property="og:title" content=
"Effect of ketoconazole on the pharmacokinetics of imipramine and desipramine in healthy subjects" />
<meta property="og:type" content="article" />
<meta property="og:description" content=
"Aims The aim of the study was to characterize further the role of CYP3A4 in the metabolism of tricyclic antidepressants. 				Methods The effect of oral ketoconazole (200 mg day[−1] for 14 days) on the kinetics of a single ..." />
<meta property="og:url" content=
"http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2042747/" />
<meta property="og:site_name" content="PubMed Central (PMC)" />
<meta property="og:image" content=
"http://www.ncbi.nlm.nih.gov/corehtml/pmc/pmcgifs/pmc-logo-share.png" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@ncbi" />
<link rel="stylesheet" href="/corehtml/pmc/css/3.4/pmc.min.css"
type="text/css" />
<link rel="stylesheet" href=
"/corehtml/pmc/css/3.4/pmc_extras_prnt.min.css" type="text/css"
media="print" />

<meta name="citationexporter" content=
"backend:'/pmc/utils/ctxp/'" />

<link rel="stylesheet" href=
"/corehtml/pmc/ctxp/citationexporter.css" type="text/css" />

<link rel="alternate" type="application/pdf" href=
"/pmc/articles/PMC2042747/pdf/bcp_0539.pdf" />

<link rel="shortcut icon" href=
"//www.ncbi.nlm.nih.gov/favicon.ico" />
<meta name="ncbi_phid" content=
"F4FC457E6FE7C5110000000000DED88E" />
<link type="text/css" rel="stylesheet" href=
"//static.pubmed.gov/portal/portal3rc.fcgi/4072591/css/3852956/3985586/3808861/3734262/3974050/3917732/251717/4048120/3846471/14534/45193/3988413/3849091/3984811/3751656/4033350/3840896/3577051/3852958/3881636/3579733/4062871/12930/3964959/3855473/4047625/3854974/3854955/4076335/4052581/9685/3549676/3609192/3609193/3609213/3395586/3855312.css" />
<link type="text/css" rel="stylesheet" href=
"//static.pubmed.gov/portal/portal3rc.fcgi/4072591/css/3411343/3882866/3929378.css"
media="print" />

Warning: The NCBI web site
requires JavaScript to function. more...

NCBI

Skip to main content

Skip to navigation

Resources

How To

About NCBI Accesskeys

My NCBISign in to NCBISign Out

PMC

US National Library of
Medicine

National Institutes of
Health

<form method="get" action="/pmc/">

Search database<select id="database">
<optgroup label="Recent">
<option value="pmc" selected="selected" class="last" data-ac_dict=
"pmc-search-autocomplete">PMC</option>
</optgroup>
<optgroup label="All">
<option value="gquery">All Databases</option>
<option value="assembly">Assembly</option>
<option value="bioproject">BioProject</option>
<option value="biosample">BioSample</option>
<option value="biosystems">BioSystems</option>
<option value="books">Books</option>
<option value="clinvar">ClinVar</option>
<option value="clone">Clone</option>
<option value="cdd">Conserved Domains</option>
<option value="gap">dbGaP</option>
<option value="dbvar">dbVar</option>
<option value="epigenomics">Epigenomics</option>
<option value="nucest">EST</option>
<option value="gene">Gene</option>
<option value="genome">Genome</option>
<option value="gds">GEO DataSets</option>
<option value="geoprofiles">GEO Profiles</option>
<option value="nucgss">GSS</option>
<option value="gtr">GTR</option>
<option value="homologene">HomoloGene</option>
<option value="medgen">MedGen</option>
<option value="mesh">MeSH</option>
<option value="ncbisearch">NCBI Web Site</option>
<option value="nlmcatalog">NLM Catalog</option>
<option value="nuccore">Nucleotide</option>
<option value="omim">OMIM</option>
<option value="pmc" data-ac_dict="pmc-search-autocomplete">
PMC</option>
<option value="popset">PopSet</option>
<option value="probe">Probe</option>
<option value="protein">Protein</option>
<option value="proteinclusters">Protein Clusters</option>
<option value="pcassay">PubChem BioAssay</option>
<option value="pccompound">PubChem Compound</option>
<option value="pcsubstance">PubChem Substance</option>
<option value="pubmed">PubMed</option>
<option value="pubmedhealth">PubMed Health</option>
<option value="snp">SNP</option>
<option value="sra">SRA</option>
<option value="structure">Structure</option>
<option value="taxonomy">Taxonomy</option>
<option value="toolkit">ToolKit</option>
<option value="toolkitall">ToolKitAll</option>
<option value="toolkitbook">ToolKitBook</option>
<option value="toolkitbookgh">ToolKitBookgh</option>
<option value="unigene">UniGene</option>
</optgroup>
</select>

Search term

<input type="text" name="term" id="term" title=
"Search PMC. Use up and down arrows to choose an item from the autocomplete."
value="" class="jig-ncbiclearbutton jig-ncbiautocomplete" config=
"dictionary:'pmc-search-autocomplete',disableUrl:'NcbiSearchBarAutoComplCtrl'"
autocomplete="off" data-sbconfig=
"ds:'no',pjs:'no',afs:'yes'" />

<button id="search" type="submit" class="button_search nowrap" cmd=
"go">Search</button>

</form>

Limits

Advanced

Journal list

Help

Journal List

Br J Clin Pharmacol

v.43(3); 1997 Mar

PMC2042747

<map id=
"logo-imagemap" name="logo-imagemap">
<area alt="Link to Publisher's site" title=
"Link to Publisher's site" shape="default" coords="0,0,499,74"
href="http://www.blackwellpublishing.com/journal.asp?ref=0306-5251"
target="pmc_ext" ref=
"reftype=publisher&article-id=2042747&issue-id=152782&journal-id=279&FROM=Article%7CBanner&TO=Publisher%7COther%7CN/A&rendering-type=normal" />
</map>

Br J Clin Pharmacol. 1997 Mar; 43(3):
315–318.

doi:
10.1046/j.1365-2125.1997.00539.x

PMCID: PMC2042747

Effect of ketoconazole on the
pharmacokinetics of imipramine and desipramine in healthy
subjects

E. Spina, A. Avenoso, G. M. Campo, M. G. Scordo, A. P. Caputi, and
E. Perucca

1 Clinical Pharmacology
Unit, University of Pavia, Pavia, Italy

Correspondence to: Dr Edoardo
SpinaInstitute of Pharmacology, University of Messina, Piazza
XX Settembre 4, 98122 Messina, Italy

Author information ► Copyright and License
information ►

Copyright

This article has been cited by other articles in
PMC.

Abstract

Aims The aim of the study
was to characterize further the role of CYP3A4 in the metabolism of
tricyclic antidepressants.

Methods The effect of oral ketoconazole
(200 mg day−1 for 14 days) on the kinetics of a single
oral dose of imipramine (100 mg) and desipramine (100 mg) was
evaluated in two groups of six healthy male subjects.

Results Ketoconazole administration was
associated with a decrease in imipramine apparent oral clearance
(from 1.16±0.21 to 0.96±0.20 l h−1 kg−1,
mean±s.d.; 'of2\P<0.02), a prolongation in imipramine
half-life (from 16.7±3.3 to 19.2±5.4 h, 'of2\P<0.05)
and a decrease in area under the curve of metabolically derived
desipramine (from 3507±1707 to 3180±1505 nmol l−1 h,
P<0.05), whereas concentrations of 2-hydroxy-imipramine
were unaffected. In the subjects given desipramine, no significant
changes in desipramine and 2-hydroxy-desipramine kinetics were
observed during ketoconazole treatment.

Conclusions These findings
indicate that ketoconazole, a relatively specific inhibitor of
CYP3A4, inhibits the N-demethylation of imipramine without
affecting the 2-hydroxylation of imipramine and desipramine. This
interaction, confirms that CYP3A4 plays a role in the demethylation
of tricyclic antidepressants.

Keywords:
ketoconazole, imipramine, desipramine,
CYP3A4, CYP2D6, drug interaction

Full
Text

The Full Text of this article is available as
a PDF (249K).

Articles from
British Journal of
Clinical Pharmacology are provided here courtesy of
British Pharmacological Society

Formats:

Summary

|

PDF
(249K)

|

Citation

Share

 Facebook

 Twitter

 Google+

You are here: NCBI > Literature >
PubMed Central
(PMC)

Write
to the Help Desk

External
link. Please review our privacy policy.

NLM

NIH

DHHS

USA.gov

Copyright | Disclaimer | Privacy
| Browsers | Accessibility |
Contact

National
Center for Biotechnology Information, U.S. National Library
of Medicine 8600 Rockville Pike, Bethesda MD,
20894 USA


text:
import json
import unittest.mock
import urllib.parse
import urllib.request

from . import errors
from . import utils

API_CREATE_MESSAGE = 'https://cp.pushwoosh.com/json/1.3/createMessage'
API_GET_CLUSTERS = 'https://cp.pushwoosh.com/json/1.3/listGeoZoneClusters'
API_ADD_CLUSTER = 'https://cp.pushwoosh.com/json/1.3/addGeoZoneCluster'
API_DELETE_CLUSTER = 'https://cp.pushwoosh.com/json/1.3/deleteGeoZoneCluster'
API_GET_ZONES = 'https://cp.pushwoosh.com/json/1.3/listGeoZones'
API_ADD_ZONE = 'https://cp.pushwoosh.com/json/1.3/addGeoZone'
API_DELETE_ZONE = 'https://cp.pushwoosh.com/json/1.3/deleteGeoZone'

dummy_logger = unittest.mock.Mock()

class Client:

    def __init__(self, auth_token, application, log=dummy_logger):
        self._auth_token = auth_token
        self._application = application
        self._log = log

    def create_message(self, content, params=None, filters=None):
        """
        :type content: dict[str, str]
        :type params: dict[str, Any]
        :type filters: dict[str, Any]
        """
        notification = _create_notification(content, filters, params)
        self._send(API_CREATE_MESSAGE, {'notifications': [notification]})
        self._log.info('Notification (%s) pushed', utils.dumps(notification))

    def get_clusters(self):
        """
        :return list of clusters
            example:
            [{
                'name': 'Cluster on Times',
                'code': 'AE2C4-4E070',
                'cooldown': 86400,
                'geozones': 1,
            }]
        """
        response = self._send(API_GET_CLUSTERS)
        return response['response']['clusters']

    def create_cluster(self, name, cooldown=60):
        """
        :type name: str
        :type cooldown: int, silent period after sending notification (seconds)
        :return str, cluster_id
        """
        body = {'name': name, 'cooldown': cooldown}
        response = self._send(API_ADD_CLUSTER, body)
        cluster_id = response['response']['GeoZoneCluster']
        self._log.info('Zone cluster (%s) created, id=%r', body, cluster_id)
        return cluster_id

    def delete_cluster(self, cluster_id):
        """
        :type cluster_id: str
        """
        self._send(API_DELETE_CLUSTER, {'geoZoneCluster': cluster_id})
        self._log.info('Zone cluster deleted, id=%r', cluster_id)

    def get_zones(self):
        """
        :return List[Dict], zones grouped by cluster
            example:
            [{
                'name': 'Cluster',
                'geoZones': [{
                    'name': 'Geozone 1',
                    'lat': 52.26816,
                    'lng': -109.6875,
                    'cooldown': 86340,
                    'range': 100,
                    'presetCode': null,
                    'content': {
                         'default': 'Push for Geozone 1'
                    }
                }],
            }]
        """
        response = self._send(API_GET_ZONES)
        return response['response']['clusters']

    def create_zones(self, zones):
        """
        :type zones: List[Dict]
            zone example:
            {
                'content': 'Lorem ipsum',  # or dict with language as key
                'lat': '40.70087797',
                'lng': '-73.931851387',

                # Optional
                'cluster': 'CLUSTER ID',
                'name': 'ZONE NAME',
                'range': 50,  # geozone range. In meters, from 50 to 1000.
                'cooldown': 60,  # silent period after sending, in seconds
            }

        :return List[int], zone ids
        """
        for zone in zones:
            for param, default_value in (
                ('name', 'geozone'),
                ('range', 1000),
                ('cooldown', 60),
            ):
                if param not in zone:
                    zone[param] = default_value

        body = {'geozones': zones}
        response = self._send(API_ADD_ZONE, body)
        zone_ids = response['response']['GeoZones']

        self._log.info(
            'Zones (%s) created, ids=%r', utils.dumps(body), zone_ids,
        )

        return response['response']['GeoZones']

    def delete_zones(self, zone_ids):
        """
        :type zone_ids: List[int]
        """
        self._send(API_DELETE_ZONE, {'geozones': zone_ids})
        self._log.info('Zones with id in %r deleted', zone_ids)

    def _send(self, url, body=None):
        request = self._create_request(body)
        response = self._execute_request(url, request)

        if (
            response['status_code'] != 200 or
            response['status_message'] != 'OK'
        ):
            raise errors.RequestError(response)

        return response

    def _create_request(self, body):
        request = {
            'request': {
                'application': self._application,
                'auth': self._auth_token,
            },
        }
        if body is not None:
            request['request'].update(body)
        return request

    @staticmethod
    def _execute_request(url, request):
        req = urllib.request.Request(
            url, json.dumps(request, ensure_ascii=False).encode(),
        )

        with urllib.request.urlopen(req) as response:
            return json.loads(response.read().decode())

def _create_notification(content, filters, params):
    notification = {
        'content': content,
        'send_date': 'now',
    }

    if filters is not None:
        notification['conditions'] = _make_conditions(filters)

    if params is not None:
        for k, v in params.items():
            notification[k] = v

    return notification

def _make_conditions(filters):
    conditions = []

    for k, v in filters.items():
        if isinstance(v, list):
            operator = 'IN'
        else:
            operator = 'EQ'
        conditions.append([k, operator, v])

    return conditions

redpajama_set_name: RedPajamaGithub


text:
require 'kontena_cli'

puts Kontena::Cli::Config.instance.config_filename


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

namespace RSG
{
    /// <summary>
    /// Event args for BoundPropertyChanged event.
    /// </summary>
    public class BoundPropertyChangedEventArgs : EventArgs
    {
        /// <summary>
        /// The name of the property whose value changed.
        /// </summary>
        public string PropertyName { get; private set; }

        /// <summary>
        /// The binding.
        /// </summary>
        public IBinding Binding { get; private set; }

        public BoundPropertyChangedEventArgs(string propertyName, IBinding binding)
        {
            if (string.IsNullOrEmpty(propertyName))
            {
                throw new ArgumentException("Invalid property name", "propertyName");
            }

            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }

            this.PropertyName = propertyName;
            this.Binding = binding;
        }

        public override string ToString()
        {
            return string.Format("BoundPropertyChangedEventArgs - PropertyName: {0}", PropertyName);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!-- Copyright 2015 Google Inc. All Rights Reserved. -->
<resources>
    <!-- Attributes for SignInButton
    WARNING: When making changes here, remember to update corresponding constants at
             com.google.android.gms.common.SignInButton
             For backward compatibility, you can only add new constant but not remove or change
             existing constants -->
    <declare-styleable name="SignInButton">
        <attr name="buttonSize" format="reference|enum">
            <enum name="standard" value="0" />
            <enum name="wide" value="1" />
            <enum name="icon_only" value="2" />
        </attr>
        <attr name="colorScheme" format="reference|enum">
            <enum name="dark" value="0" />
            <enum name="light" value="1" />
            <enum name="auto" value="2"/>
        </attr>
        <attr name="scopeUris" format="reference|string"/>
    </declare-styleable>

</resources>


text:
title: Locate JSON Web Key Sets
description: Learn how to use the JSON Web Keys (JWKs) discovered using the JSON Web Key Set (JWKS) endpoint to verify a JWT signature.
topics:
  - tokens
  - jwks
  - jwt
contentType:
  - how-to
useCase:
  - invoke-api
  - secure-api
  - add-login
---
# Locate JSON Web Key Sets

Auth0 exposes a discovery endpoint, which exists at `https://${account.namespace}/.well-known/openid-configuration`. You can use this endpoint to configure your application or API to automatically locate the [JSON Web Key Set (JWKS)](/tokens/concepts/jwks) endpoint (`jwks_uri`), which contains the JWKS used to sign all Auth0-issued <dfn data-key="json-web-token">JSON Web Tokens (JWTs)</dfn> signed with the RS256 [signing algorithm](/tokens/concepts/signing-algorithms).

When [validating a JWT](/tokens/guides/validate-jwts) using a JWKS, you will need to:

1. Retrieve the JWKS from the Auth0 discovery endpoint, and filter for potential signing keys (e.g., any keys missing a public key or with a `kid` property).
2. Grab the `kid` property from the Header of the decoded JWT.
3. Search your filtered JWKS for the key with the matching `kid` property.
4. Build a certificate using the corresponding `x5c` property in your JWKS.
5. Use the certificate to verify the JWT's signature.

For an example that uses JWKS to verify a JWT's signature, see [Navigating RS256 and JWKS](https://auth0.com/blog/navigating-rs256-and-jwks/) (uses Node.js), or check out our [Backend/API Quickstarts](/quickstart/backend).

For more info about the structure of a JWT, see [JSON Web Token Structure](/tokens/references/jwt-structure).

::: note
It's good practice to assume that multiple signing keys could be present in your JWKS. This may seem unnecessary since the Auth0 JWKS endpoint typically contains a single signing key; however, multiple keys can be found in the JWKS when rotating signing certificates.
:::

::: panel Best Practice
You can cache your signing keys to improve application performance and avoid running into [rate limits](/policies/rate-limits), but you will want to make sure that if decoding a token fails, you invalidate the cache and retrieve new signing keys before trying **only one** more time.
:::

## Keep reading

* [JSON Web Key Sets](/tokens/concepts/jwks)
* [JSON Web Key Set Properties](/tokens/references/jwks-properties)
* [JSON Web Token Structure](/tokens/references/jwt-structure)
* [Validate a JSON Web Token](/tokens/guides/validate-jwt)
* [Backend/API Quickstarts](/quickstart/backend)
* [Navigating RS256 and JWKS](https://auth0.com/blog/navigating-rs256-and-jwks/) (uses Node.js)


text:
<!DOCTYPE html>

		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title> Data Kondisi </title>

		<meta name="description" content="Inventaris & Barang" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<link rel="stylesheet" href="<?php echo base_url()?>assets/theme/ac_master/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<?php echo base_url()?>assets/theme/ac_master/font-awesome/4.2.0/css/font-awesome.min.css" />

		<link rel="stylesheet" href="<?php echo base_url()?>assets/theme/ac_master/fonts/fonts.googleapis.com.css" />

		<link rel="stylesheet" href="<?php echo base_url()?>assets/theme/ac_master/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<?php $this->load->view('components/header')?>

			<?php $this->load->view('components/menu')?>

											<select id="skin-colorpicker" class="hide">
												<option data-skin="no-skin" value="#438EB9">#438EB9</option>
												<option data-skin="skin-1" value="#222A2D">#222A2D</option>
												<option data-skin="skin-2" value="#C6487E">#C6487E</option>
												<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
											</select>

										  Choose Skin

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
										 Fixed Navbar

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
										 Fixed Sidebar

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs" />
										 Fixed Breadcrumbs

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" />
										 Right To Left (rtl)

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />

											Inside
											.container

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover" />
										 Submenu on Hover

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact" />
										 Compact Sidebar

										<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight" />
										 Alt. Active Item

								Tampil Data

									Kondisi Inventaris

										<?php
											isset($message)? print_r($message):null;
										?>

															<input type="checkbox" class="ace" />

													 ID Kondisi
													 Kode Kondisi
													 Nama Kondisi
													 Keterangan
													 Aksi

											<?php foreach ($cond as $conds) { ?>

															<input type="checkbox" class="ace" />

													<?php echo $conds->cond_id; ?>
													<?php echo $conds->cond_code; ?>
													<?php echo $conds->cond_name; ?>
													<?php echo $conds->cond_desc; ?>

															<a href="<?php echo site_url('condition/condition_edit/'.$conds->cond_id);?>">
																<button class="btn btn-xs btn-info">

																</button>

															<a href="<?php echo site_url('condition/condition_delete/'.$conds->cond_id);?>">
																<button class="btn btn-xs btn-danger">

																</button>

												<?php } ?>

			<?php $this->load->view('components/footer')?>


text:
@implementation DOMHTMLCollection (TDAdditions)

- (NSMutableArray *)asMutableArray {
    NSUInteger count = [self length];
    NSMutableArray *result = [NSMutableArray arrayWithCapacity:count];

    for (NSUInteger i = 0; i < count; i++) {
        DOMNode *el = [self item:i];
        if (el) [result addObject:el];
    }

    return result;
}

- (NSArray *)asArray {
    return [[[self asMutableArray] copy] autorelease];
}

@end


text:
$(document).ready(function(){
    $(".checkbox").click(function(){
        $(this).toggleClass("checked");
    });

    // Step 1: Write a function that take a number as an arument.
    // Step 1a: Inside the function, multiply the number by 10
    // Step 1b: Return that new number
    function multiplyBy10(int) {
        return int*10;
    };

    // Step 3: Create a new array with 5 different numbers in it.
    var array = [10, 20, 30, 40, 50];

    // Step 4:
    // Write a for loop that iterates through the array you just created.
    for (var i=0; i < array.length; i++) {
    }

    // Step 5:
    // For each iteration create a variable named returnString with the following string:
    // "[current item in the array] times 10 = "
    for (var i=0; i < array.length; i++) {
        var returnString = array[i] + " * 10 = ";
    }

    // Step 5:
    // Run your multiplyBy10 function with the current value of your array as the input.
    for (var i=0; i < array.length; i++) {
        var returnString = array[i] + " * 10 = ";
        multiplyBy10(array[i]);
    }

    // Step 6: Add the return value of multiplyBy10 to returnString.
    for (var i=0; i < array.length; i++) {
        var returnString = array[i] + " * 10 = ";
        returnString += multiplyBy10(array[i]);
    }

    // Step 7: Write returnString to the console each time through the iteration
    for (var i=0; i < array.length; i++) {
        var returnString = array[i] + " * 10 = ";
        returnString += multiplyBy10(array[i]);
        console.log(returnString);
    }
});


text:
/* tslint:disable: component-selector */

import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, Output } from '@angular/core';
import { ContentDto, getContentValue, LanguageDto, META_FIELDS } from '@app/shared';

@Component({
    selector: '[sqxReferenceItem][language][languages]',
    styleUrls: ['./reference-item.component.scss'],
    templateUrl: './reference-item.component.html',
    changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ReferenceItemComponent implements OnChanges {
    public readonly metaFields = META_FIELDS;

    @Output()
    public delete = new EventEmitter();

    @Output()
    public clone = new EventEmitter();

    @Input()
    public language!: LanguageDto;

    @Input()
    public languages!: ReadonlyArray<LanguageDto>;

    @Input()
    public canRemove?: boolean | null = true;

    @Input()
    public isCompact?: boolean | null;

    @Input()
    public isDisabled?: boolean | null;

    @Input()
    public validations?: { [id: string]: boolean };

    @Input()
    public validityVisible?: boolean | null;

    @Input()
    public columns = 0;

    @Input('sqxReferenceItem')
    public content!: ContentDto;

    public values: ReadonlyArray<any> = [];

    public get isValid() {
        return !this.validations ? undefined : this.validations[this.content.id];
    }

    public ngOnChanges() {
        const values = [];

        for (let i = 0; i < this.columns; i++) {
            const field = this.content.referenceFields[i];

            if (field) {
                const { formatted } = getContentValue(this.content, this.language, field);

                values.push(formatted);
            } else {
                values.push('');
            }
        }

        this.values = values;
    }
}


text:
namespace ash {
namespace attestation {

enum class CertificateExpiryStatus {
  kValid,
  kExpiringSoon,
  kExpired,
  kInvalidPemChain,
  kInvalidX509,
};

// Checks if |certificate_chain| is a PEM certificate chain that contains a
// certificate this is expired or expiring soon according to |expiry_threshold|.
// Returns the expiry status with the following precedence:
//  1. If there is an expired token in |certificate_chain|, returns kExpired.
//  2. If there is an expiring soon token but no expired token, returns
//     kExpiringSoon.
//  3. If there are no expired or expiring soon tokens but there is an invalid
//     token, returns kInvalidX509.
//  4. If there are no parsable tokens, returns kInvalidPemChain.
//  5. Otherwise, returns kValid.
CertificateExpiryStatus CheckCertificateExpiry(
    const std::string& certificate_chain,
    base::TimeDelta expiry_threshold);

std::string CertificateExpiryStatusToString(CertificateExpiryStatus status);

}  // namespace attestation
}  // namespace ash

#endif  // CHROME_BROWSER_ASH_ATTESTATION_CERTIFICATE_UTIL_H_


text:
package com.github.j5ik2o.dddbase.memory

trait MemoryDaoSupport {

  trait Record {
    val id: String
  }

  trait SoftDeletableRecord extends Record {
    type This <: SoftDeletableRecord
    val status: String
    def withStatus(value: String): This
  }

  trait Dao[M[_], R <: Record] {

    def set(record: R): M[Long]

    def setMulti(records: Seq[R]): M[Long]

    def get(id: String): M[Option[R]]

    def getAll: M[Seq[R]]

    def getMulti(ids: Seq[String]): M[Seq[R]]

    def delete(id: String): M[Long]

    def deleteMulti(ids: Seq[String]): M[Long]

  }

  trait DaoSoftDeletable[M[_], R <: SoftDeletableRecord] { this: Dao[M, R] =>

    def softDelete(id: String): M[Long]

    def softDeleteMulti(ids: Seq[String]): M[Long]

  }

}


text:
namespace blink {

PassRefPtrWillBeRawPtr<USBConnectionEvent> USBConnectionEvent::create(const AtomicString& type, const USBConnectionEventInit& initializer)
{
    return adoptRefWillBeNoop(new USBConnectionEvent(type, initializer));
}

PassRefPtrWillBeRawPtr<USBConnectionEvent> USBConnectionEvent::create(const AtomicString& type, USBDevice* device)
{
    return adoptRefWillBeNoop(new USBConnectionEvent(type, device));
}

USBConnectionEvent::USBConnectionEvent(const AtomicString& type, const USBConnectionEventInit& initializer)
    : Event(type, initializer)
    , m_device(nullptr)
{
    if (initializer.hasDevice())
        m_device = initializer.device();
}

USBConnectionEvent::USBConnectionEvent(const AtomicString& type, USBDevice* device)
    : Event(type, false, false)
    , m_device(device)
{
}

DEFINE_TRACE(USBConnectionEvent)
{
    visitor->trace(m_device);
    Event::trace(visitor);
}

} // namespace blink


text:
package com.mambu.ant.phraseapp.api;

/**
 * General constants for Phrase APP API integration.
 *
 * @author fgavrilescu
 */
final class Constants {

	static final String PHRASE_HOSTNAME = "api.phraseapp.com";
	static final int PHRASE_PORT = 443;
	static final String PHRASE_PROTOCOL = "https";

	static final String BASE_ENDPOINT = "https://api.phraseapp.com/api/v2/projects/%s";

	private Constants() {

	}
}


text:
package org.nutz.dao.impl.jdbc.sqlserver2005;

import java.util.ArrayList;
import java.util.List;

import org.nutz.dao.DB;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Entity;
import org.nutz.dao.entity.MappingField;
import org.nutz.dao.entity.PkType;
import org.nutz.dao.impl.entity.macro.SqlFieldMacro;
import org.nutz.dao.impl.jdbc.AbstractJdbcExpert;
import org.nutz.dao.jdbc.JdbcExpertConfigFile;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.PItem;
import org.nutz.dao.sql.Pojo;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Pojos;

/**
 *
 * @author wendal
 */
public class Sqlserver2005JdbcExpert extends AbstractJdbcExpert {

    // private static String COMMENT_TABLE =
    // "EXECUTE sp_updateextendedproperty N'Description', '$tableComment', N'user', N'dbo', N'table', N'$table', NULL, NULL";

    private static String COMMENT_COLUMN = "EXECUTE sp_addextendedproperty N'MS_Description', '$columnComment', N'user', N'dbo', N'table', N'$table', N'column', N'$column'";

    public Sqlserver2005JdbcExpert(JdbcExpertConfigFile conf) {
        super(conf);
    }

    public String getDatabaseType() {
        return DB.SQLSERVER.name();
    }

    public boolean createEntity(Dao dao, Entity<?> en) {
        StringBuilder sb = new StringBuilder("CREATE TABLE " + en.getTableName() + "(");
        // 创建字段
        for (MappingField mf : en.getMappingFields()) {
            if (mf.isReadonly())
                continue;
            sb.append('\n').append(mf.getColumnName());
            sb.append(' ').append(evalFieldType(mf));
            // 非主键的 @Name,应该加入唯一性约束
            if (mf.isName() && en.getPkType() != PkType.NAME) {
                sb.append(" UNIQUE NOT NULL");
            }
            // 普通字段
            else {
                if (mf.isUnsigned())
                    sb.append(" UNSIGNED");
                if (mf.isNotNull())
                    sb.append(" NOT NULL");
                if (mf.isAutoIncreasement())
                    sb.append(" IDENTITY");
                if (mf.hasDefaultValue())
                    sb.append(" DEFAULT '").append(getDefaultValue(mf)).append('\'');
            }
            sb.append(',');
        }
        // 创建主键
        List<MappingField> pks = en.getPks();
        if (!pks.isEmpty()) {
            sb.append('\n');
            sb.append("PRIMARY KEY (");
            for (MappingField pk : pks) {
                sb.append(pk.getColumnName()).append(',');
            }
            sb.setCharAt(sb.length() - 1, ')');
            sb.append("\n ");
        }

        // 结束表字段设置
        sb.setCharAt(sb.length() - 1, ')');

        // 执行创建语句
        dao.execute(Sqls.create(sb.toString()));
        // 创建索引
        dao.execute(createIndexs(en).toArray(new Sql[0]));
        // 创建关联表
        createRelation(dao, en);
        // 添加注释(表注释与字段注释)
        addComment(dao, en, COMMENT_COLUMN);

        return true;
    }

    private void addComment(Dao dao, Entity<?> en, String commentColumn) {
        // TODO 表注释 SQLServer2005中貌似不行
        // 字段注释
        if (en.hasColumnComment()) {
            List<Sql> sqls = new ArrayList<Sql>();
            for (MappingField mf : en.getMappingFields()) {
                if (mf.hasColumnComment()) {
                    Sql columnCommentSQL = Sqls.create(commentColumn);
                    columnCommentSQL.vars()
                                    .set("table", en.getTableName())
                                    .set("column", mf.getColumnName())
                                    .set("columnComment", mf.getColumnComment());
                    sqls.add(columnCommentSQL);
                }
            }
            // 执行创建语句
            dao.execute(sqls.toArray(new Sql[sqls.size()]));
        }
    }

    public String evalFieldType(MappingField mf) {
        if (mf.getCustomDbType() != null)
            return mf.getCustomDbType();
        switch (mf.getColumnType()) {
        case BOOLEAN:
            return "BIT";

        case TIMESTAMP:
            return "DATETIME";// TODO 值得讨论

        case DATETIME:
        case DATE:
        case TIME:
            return "DATETIME";
        case INT:
            // 用户自定义了宽度
            if (mf.getWidth() > 0)
                return "NUMERIC(" + mf.getWidth() + ")";
            // 用数据库的默认宽度
            return "INT";

        case FLOAT:
            // 用户自定义了精度
            if (mf.getWidth() > 0 && mf.getPrecision() > 0) {
                return "decimal(" + mf.getWidth() + "," + mf.getPrecision() + ")";
            }
            // 用默认精度
            if (mf.getTypeMirror().isDouble())
                return "decimal(15,10)";
            return "float";
        case BINARY:
            return "varbinary(max)";
        //case TEXT :
        //    return "nvarchar(max)";
        default :
            break;
        }
        return super.evalFieldType(mf);
    }

    public void formatQuery(Pojo pojo) {
        Pager pager = pojo.getContext().getPager();
        if (null != pager && pager.getPageNumber() > 0) {
            // -----------------------------------------------------
            // TODO XXX 这个写法灰常暴力!!But , it works!!!! 期待更好的写法
            PItem pi = pojo.getItem(0);
            StringBuilder sb = new StringBuilder();
            pi.joinSql(pojo.getEntity(), sb);
            String str = sb.toString();
            if (str.trim().toLowerCase().startsWith("select")) {
                pojo.setItem(0, Pojos.Items.wrap(str.substring(6)));
            } else
                return;// 以免出错.
            pojo.insertFirst(Pojos.Items.wrapf(    "select * from(select row_number()over(order by __tc__)__rn__,* from(select top %d 0 __tc__, ",
                                                pager.getOffset() + pager.getPageSize()));
            pojo.append(Pojos.Items.wrapf(")t)tt where __rn__ > %d order by __rn__", pager.getOffset()));
        }
    }

    @Override
    public void formatQuery(Sql sql) {
        Pager pager = sql.getContext().getPager();
        // 需要进行分页
        if (null != pager && pager.getPageNumber() > 0) {
            // -----------------------------------------------------
            // TODO XXX 这个写法灰常暴力!!But , it works!!!! 期待更好的写法
            if (!sql.getSourceSql().toUpperCase().startsWith("SELECT "))
                return;// 以免出错.
            String xSql = sql.getSourceSql().substring(6);
            String pre = String.format(    "select * from(select row_number()over(order by __tc__)__rn__,* from(select top %d 0 __tc__, ",
                                                            pager.getOffset() + pager.getPageSize());
            String last = String.format(")t)tt where __rn__ > %d", pager.getOffset());
            sql.setSourceSql(pre + xSql + last);
        }
    }

    protected String createResultSetMetaSql(Entity<?> en) {
        return "SELECT top 1 * FROM " + en.getViewName();
    }

    public Pojo fetchPojoId(Entity<?> en, MappingField idField) {
        String autoSql = "SELECT @@@@IDENTITY as $field";
        Pojo autoInfo = new SqlFieldMacro(idField, autoSql);
        autoInfo.setEntity(en);
        return autoInfo;
    }
}


text:
const spawn = require('cross-spawn')

const postinstallTask = ({ plugins, projectPath }) => {
  Object.keys(plugins).forEach(pluginName => {
    const { postinstall } = plugins[pluginName]
    if (postinstall) {
      const commands = postinstall.split('&&')
      commands.forEach(command => {
        const args = command.trim().split(/\s+/)
        spawn.sync(
          args[0],
          args.slice(1),
          {
            cwd: projectPath,
            stdio: 'inherit',
          }
        )
      })
    }
  })
}

const postinstall = {
  title: 'Run postinstall scripts',
  task: postinstallTask,
}

module.exports = postinstall


text:
@class DVTDevice;

@protocol DVTDevicesWindowDetailViewController <DVTInvalidation>
@property(retain) DVTDevice *device;

@optional
- (void)detailViewDidDisappear;
- (void)detailViewDidAppear;
@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="TsLintConfiguration" use-custom-config-file="true" custom-config-file-path="$PROJECT_DIR$/workspace/tslint.json" rules="$PROJECT_DIR$/node_modules/tslint-microsoft-contrib" />
</project>


text:
@implementation TTTwitterSearchFeedDataSource

///////////////////////////////////////////////////////////////////////////////////////////////////
- (id)initWithSearchQuery:(NSString*)searchQuery {
  if (self = [super init]) {
    _searchFeedModel = [[TTTwitterSearchFeedModel alloc] initWithSearchQuery:searchQuery];
  }

  return self;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)dealloc {
  TT_RELEASE_SAFELY(_searchFeedModel);

  [super dealloc];
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (id<TTModel>)model {
  return _searchFeedModel;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)tableViewDidLoadModel:(UITableView*)tableView {
  NSMutableArray* items = [[NSMutableArray alloc] init];

  for (TTTwitterTweet* tweet in _searchFeedModel.tweets) {
    //TTDPRINT(@"Response text: %@", response.text);
    TTStyledText* styledText = [TTStyledText textFromXHTML:
                                [NSString stringWithFormat:@"%@\n<b>%@</b>",
                                 [[tweet.text stringByReplacingOccurrencesOfString:@"&"
                                                                        withString:@"&"]
                                  stringByReplacingOccurrencesOfString:@"<"
                                  withString:@"<"],
                                 [tweet.created formatRelativeTime]]
                                                lineBreaks:YES URLs:YES];
    // If this asserts, it's likely that the tweet.text contains an HTML character that caused
    // the XML parser to fail.
    TTDASSERT(nil != styledText);
    [items addObject:[TTTableStyledTextItem itemWithText:styledText]];
  }

  self.items = items;
  TT_RELEASE_SAFELY(items);
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)titleForLoading:(BOOL)reloading {
  if (reloading) {
    return NSLocalizedString(@"Updating Twitter feed...", @"Twitter feed updating text");
  } else {
    return NSLocalizedString(@"Loading Twitter feed...", @"Twitter feed loading text");
  }
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)titleForEmpty {
  return NSLocalizedString(@"No tweets found.", @"Twitter feed no results");
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)subtitleForError:(NSError*)error {
  return NSLocalizedString(@"Sorry, there was an error loading the Twitter stream.", @"");
}

@end


text:
<?php

use yii\bootstrap\Html;
?>

Stylish Portfolio is the perfect theme for your next project!

This theme features some wonderful photography courtesy of Death to the Stock Photo.


text:
<?xml version="1.0" encoding="UTF-8"?>
<credits>
    <member>
        <name>Devil7DK</name>
        <description>Developer of XenonOTA app</description>
        <avatar>https://avatars0.githubusercontent.com/u/3296620?s=460&v=4</avatar>
        <link>https://github.com/Devil7DK</link>
    </member>
    <member>
        <name>dadi11</name>
        <description>New design concept and maintenance</description>
        <avatar>https://avatars3.githubusercontent.com/u/7272087?s=400&v=4</avatar>
        <link>https://github.com/dadi11</link>
    </member>
    <member>
        <name>fusionjack</name>
        <description>Creator of the base SlimOTA app</description>
        <avatar>https://avatars1.githubusercontent.com/u/3637578?s=400&v=4</avatar>
        <link>https://github.com/fusionjack</link>
    </member>
    <member>
        <name>topjohnwu</name>
        <description>MagiskManager code used for Magisk downloader</description>
        <avatar>https://avatars3.githubusercontent.com/u/7337301?s=400&v=4</avatar>
        <link>https://github.com/topjohnwu</link>
    </member>
    <member>
        <name>hjthjthjt</name>
        <description>RnOpenGapps code used for GApps downloader</description>
        <avatar>https://avatars0.githubusercontent.com/u/3889846?s=400&v=4</avatar>
        <link>https://github.com/hjthjthjt</link>
    </member>
</credits>


text:
import {Component,ViewChild,ElementRef,ComponentFactoryResolver,ViewContainerRef,forwardRef,ContentChildren,QueryList} from '@angular/core';
import { base } from './base';
// Ext Class - Ext.ux.form.ItemSelector
export class itemselectorMetaData {
	public static XTYPE: string = 'itemselector';
	public static INPUTNAMES: string[] = [
		'actions',
		'activeChildTabIndex',
		'activeCounter',
		'activeError',
		'activeErrorsTpl',
		'activeItem',
		'afterBodyEl',
		'afterLabelTextTpl',
		'afterLabelTpl',
		'afterSubTpl',
		'alignOnScroll',
		'alignTarget',
		'allowBlank',
		'allowFocusingDisabledChildren',
		'alwaysOnTop',
		'anchor',
		'anchorSize',
		'animateShadow',
		'appendOnly',
		'ariaAttributes',
		'ariaDescribedBy',
		'ariaErrorText',
		'ariaHelp',
		'ariaLabel',
		'ariaLabelledBy',
		'autoDestroy',
		'autoEl',
		'autoFitErrors',
		'autoRender',
		'autoScroll',
		'autoShow',
		'baseBodyCls',
		'baseCls',
		'beforeBodyEl',
		'beforeLabelTextTpl',
		'beforeLabelTpl',
		'beforeSubTpl',
		'bind',
		'blankText',
		'border',
		'bubbleEvents',
		'buttons',
		'buttonsText',
		'childEls',
		'cls',
		'columnWidth',
		'combineErrors',
		'combineLabels',
		'componentCls',
		'componentLayout',
		'constrain',
		'constraintInsets',
		'constrainTo',
		'contentEl',
		'controller',
		'data',
		'ddReorder',
		'defaultAlign',
		'defaultFocus',
		'defaultListenerScope',
		'defaults',
		'defaultType',
		'delimiter',
		'detachOnRemove',
		'disabled',
		'disabledCls',
		'displayField',
		'dock',
		'draggable',
		'dragGroup',
		'dragText',
		'dropGroup',
		'errorMsgCls',
		'fieldBodyCls',
		'fieldDefaults',
		'fieldLabel',
		'fixed',
		'flex',
		'floating',
		'focusableContainer',
		'focusCls',
		'focusOnToFront',
		'formBind',
		'formItemCls',
		'frame',
		'height',
		'hidden',
		'hideEmptyLabel',
		'hideLabel',
		'hideMode',
		'hideNavIcons',
		'html',
		'id',
		'inactiveChildTabIndex',
		'invalidCls',
		'itemId',
		'items',
		'keyMap',
		'keyMapEnabled',
		'keyMapTarget',
		'labelableRenderTpl',
		'labelAlign',
		'labelAttrTpl',
		'labelCls',
		'labelClsExtra',
		'labelConnector',
		'labelPad',
		'labelSeparator',
		'labelStyle',
		'labelWidth',
		'layout',
		'liquidLayout',
		'listConfig',
		'listeners',
		'liveDrag',
		'loader',
		'margin',
		'maskDefaults',
		'maskElement',
		'maxHeight',
		'maxSelections',
		'maxSelectionsText',
		'maxWidth',
		'minHeight',
		'minSelections',
		'minSelectionsText',
		'minWidth',
		'modal',
		'modelValidation',
		'msgTarget',
		'name',
		'nameable',
		'nameHolder',
		'overCls',
		'overflowX',
		'overflowY',
		'padding',
		'pageSize',
		'plugins',
		'preventMark',
		'publishes',
		'reference',
		'referenceHolder',
		'region',
		'renderConfig',
		'renderData',
		'renderSelectors',
		'renderTo',
		'renderTpl',
		'resetFocusPosition',
		'resizable',
		'resizeHandles',
		'saveDelay',
		'scrollable',
		'session',
		'shadow',
		'shadowOffset',
		'shareableName',
		'shim',
		'shrinkWrap',
		'stateEvents',
		'stateful',
		'stateId',
		'store',
		'style',
		'submitValue',
		'suspendLayout',
		'tabGuard',
		'tabIndex',
		'tbar',
		'title',
		'toFrontOnShow',
		'touchAction',
		'tpl',
		'tplWriteMode',
		'twoWayBindable',
		'ui',
		'uiCls',
		'userCls',
		'validateOnChange',
		'validation',
		'validationField',
		'value',
		'valueField',
		'valuePublishEvent',
		'viewModel',
		'weight',
		'width',
		'xtype',
		'flex',
		'platformConfig',
		'responsiveConfig',
		'fitToParent',
		'config'
];
	public static OUTPUTS: any[] = [
		{name:'activate',parameters:'itemselectorfield'},
		{name:'add',parameters:'itemselectorfield,component,index'},
		{name:'added',parameters:'itemselectorfield,container,pos'},
		{name:'afterlayout',parameters:'itemselectorfield,layout'},
		{name:'afterlayoutanimation',parameters:'itemselectorfield'},
		{name:'afterrender',parameters:'itemselectorfield'},
		{name:'beforeactivate',parameters:'itemselectorfield'},
		{name:'beforeadd',parameters:'itemselectorfield,component,index'},
		{name:'beforedeactivate',parameters:'itemselectorfield'},
		{name:'beforedestroy',parameters:'itemselectorfield'},
		{name:'beforehide',parameters:'itemselectorfield'},
		{name:'beforeremove',parameters:'itemselectorfield,component'},
		{name:'beforerender',parameters:'itemselectorfield'},
		{name:'beforeshow',parameters:'itemselectorfield'},
		{name:'beforestaterestore',parameters:'itemselectorfield,state'},
		{name:'beforestatesave',parameters:'itemselectorfield,state'},
		{name:'blur',parameters:'itemselectorfield,event'},
		{name:'boxready',parameters:'itemselectorfield,width,height'},
		{name:'change',parameters:'itemselectorfield,newValue,oldValue'},
		{name:'childmove',parameters:'itemselectorfield,component,prevIndex,newIndex'},
		{name:'deactivate',parameters:'itemselectorfield'},
		{name:'destroy',parameters:'itemselectorfield'},
		{name:'dirtychange',parameters:'itemselectorfield,isDirty'},
		{name:'disable',parameters:'itemselectorfield'},
		{name:'enable',parameters:'itemselectorfield'},
		{name:'errorchange',parameters:'itemselectorfield,error'},
		{name:'fielderrorchange',parameters:'itemselectorfield,field,error'},
		{name:'fieldvaliditychange',parameters:'itemselectorfield,field,isValid'},
		{name:'focus',parameters:'itemselectorfield,event'},
		{name:'focusenter',parameters:'itemselectorfield,event'},
		{name:'focusleave',parameters:'itemselectorfield,event'},
		{name:'hide',parameters:'itemselectorfield'},
		{name:'move',parameters:'itemselectorfield,x,y'},
		{name:'remove',parameters:'itemselectorfield,component'},
		{name:'removed',parameters:'itemselectorfield,ownerCt'},
		{name:'render',parameters:'itemselectorfield'},
		{name:'resize',parameters:'itemselectorfield,width,height,oldWidth,oldHeight'},
		{name:'show',parameters:'itemselectorfield'},
		{name:'staterestore',parameters:'itemselectorfield,state'},
		{name:'statesave',parameters:'itemselectorfield,state'},
		{name:'validitychange',parameters:'itemselectorfield,isValid'},
		{name:'ready',parameters:''}
];
	public static OUTPUTNAMES: string[] = [
		'activate',
		'add',
		'added',
		'afterlayout',
		'afterlayoutanimation',
		'afterrender',
		'beforeactivate',
		'beforeadd',
		'beforedeactivate',
		'beforedestroy',
		'beforehide',
		'beforeremove',
		'beforerender',
		'beforeshow',
		'beforestaterestore',
		'beforestatesave',
		'blur',
		'boxready',
		'change',
		'childmove',
		'deactivate',
		'destroy',
		'dirtychange',
		'disable',
		'enable',
		'errorchange',
		'fielderrorchange',
		'fieldvaliditychange',
		'focus',
		'focusenter',
		'focusleave',
		'hide',
		'move',
		'remove',
		'removed',
		'render',
		'resize',
		'show',
		'staterestore',
		'statesave',
		'validitychange',
		'ready'
];
}
@Component({
  selector: itemselectorMetaData.XTYPE,
	inputs: itemselectorMetaData.INPUTNAMES,
	outputs: itemselectorMetaData.OUTPUTNAMES,
	providers: [{provide: base, useExisting: forwardRef(() => itemselector)}],
	template: '<ng-template #dynamic></ng-template>'
})
export class itemselector extends base {
	constructor(eRef:ElementRef,resolver:ComponentFactoryResolver,vcRef:ViewContainerRef) {
		super(eRef,resolver,vcRef,itemselectorMetaData);
	}
	//@ContentChildren(base,{read:ViewContainerRef}) extbaseRef:QueryList<ViewContainerRef>;
	@ContentChildren(base,{read: base}) extbaseRef: QueryList<base>;
	@ViewChild('dynamic',{read:ViewContainerRef}) dynamicRef:ViewContainerRef;
	ngAfterContentInit() {this.AfterContentInit(this.extbaseRef);}
	ngOnInit() {this.OnInit(this.dynamicRef,itemselectorMetaData);}
}


text:
import get from 'lodash/get';
import set from 'lodash/set';

/**
 * Manage configuration for an application by adding config objects.
 */
export default class Config {
    /**
     * Config store.
     *
     * @type {Object}
     *
     * @private
     */
    _config = {};

    /**
     * Register configuration object.
     *
     * @param {String} name - Configuration name.
     * @param {Object} config - Configuration object.
     */
    register(name, config) {
        this._config[name] = config;
    }

    /**
     * Get configuration object.
     *
     * @return {Object}
     *
     * @public
     */
    getAll() {
        return this._config;
    }

    /**
     * Get value for a given key from config store.
     *
     * @param {String} key - Configuration key to return value for.
     * @param {*} [defaultValue] - Default value to return when actual value is undefined.
     *
     * @return {*}
     *
     * @example
     * Config.get('database.connection');
     * Config.get('database.mysql.host', 'localhost');
     *
     * @public
     */
    get(key, defaultValue) {
        return get(this._config, key, defaultValue);
    }

    /**
     * Set or update value for a given key inside config store.
     *
     * @param {String} key - Key to set value for.
     * @param {*} value - Value to be saved next to defined key.
     *
     * @example
     * Config.set('database.connection', 'mysql');
     * Config.set('database.mysql.host', 'localhost');
     *
     * @public
     */
    set(key, value) {
        set(this._config, key, value);
    }
}


text:
<?php

namespace Reeser\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;

/**
 * Controlador del sitio raíz
 *
 * @author totote
 * @package \Reeser\Controller
 */
class IndexController extends AbstractActionController
{
	/**
	 * Muestra el mensaje de bienvenida
	 *
	 * @return \Zend\View\Model\ViewModel
	 */
	public function indexAction()
	{
//		$session = \Reeser\Util\Session::getInstance();

//		if ( $session->get('usuario_logueado') == false )
//		{
//			return $this->redirect()->toRoute('login');
//		}

		return new ViewModel();
	}

    /**
     * Muestra la selección de inscripciones disponibles
     *
     * @return \Zend\View\Model\ViewModel
     */
    public function altasAction()
    {
        return new ViewModel();
    }
}


text:
TitleWidget::TitleWidget(QWidget *parent)
	: QWidget(parent)
{
	version_title = new QLabel();
	skin_button = new PushButton();
	main_menu_button = new PushButton();
	min_button = new PushButton();
	max_button = new PushButton();
	close_button = new PushButton();
	medal_button = new QPushButton();

	version_title->setStyleSheet("color:white;");

	//ÉèÖÃͼƬ
	skin_button->loadPixmap(":/sysButton/skin_button");
	main_menu_button->loadPixmap(":/sysButton/main_menu");
	min_button->loadPixmap(":/sysButton/min_button");
	max_button->loadPixmap(":/sysButton/max_button");
	close_button->loadPixmap(":/sysButton/close_button");

	QIcon medal_icon(":/contentWidget/medal");
	medal_button->setIcon(medal_icon);
	medal_button->setFixedSize(25, 25);
	medal_button->setIconSize(QSize(25, 25));
	medal_button->setStyleSheet("background:transparent;");

	connect(skin_button, SIGNAL(clicked()), this, SIGNAL(showSkin()));
	connect(main_menu_button, SIGNAL(clicked()), this, SIGNAL(showMainMenu()));
	connect(min_button, SIGNAL(clicked()), this, SIGNAL(showMin()));
	connect(max_button, SIGNAL(clicked()), this, SIGNAL(showMax()));
	connect(close_button, SIGNAL(clicked()), this, SIGNAL(closeWidget()));

	QHBoxLayout *title_layout = new QHBoxLayout();
	title_layout->addWidget(version_title, 0, Qt::AlignVCenter);
	title_layout->addStretch();
	title_layout->addWidget(medal_button, 0, Qt::AlignTop);
	title_layout->addWidget(skin_button, 0, Qt::AlignTop);
	title_layout->addWidget(main_menu_button, 0, Qt::AlignTop);
	title_layout->addWidget(min_button, 0, Qt::AlignTop);
	title_layout->addWidget(max_button, 0, Qt::AlignTop);
	title_layout->addWidget(close_button, 0, Qt::AlignTop);
	title_layout->setSpacing(0);
	title_layout->setContentsMargins(0, 0, 5, 0);
	version_title->setContentsMargins(15, 0, 0, 0);
	skin_button->setContentsMargins(0, 0, 10, 0);

	QStringList string_list;
	string_list << ":/toolWidget/tiJian" << ":/toolWidget/muMa" << ":/toolWidget/louDong" << ":/toolWidget/xiTong"
		<< ":/toolWidget/qingLi" << ":/toolWidget/jiaSu" << ":/toolWidget/menZhen" << ":/toolWidget/ruanJian";

	QHBoxLayout *button_layout = new QHBoxLayout();

	QSignalMapper *signal_mapper = new QSignalMapper(this);
	for (int i = 0; i<string_list.size(); i++)
	{
		ToolButton *tool_button = new ToolButton(string_list.at(i));
		button_list.append(tool_button);
		connect(tool_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
		signal_mapper->setMapping(tool_button, QString::number(i, 10));

		button_layout->addWidget(tool_button, 0, Qt::AlignBottom);
	}
	connect(signal_mapper, SIGNAL(mapped(QString)), this, SLOT(turnPage(QString)));

	QLabel *logo_label = new QLabel();
	QPixmap pixmap(":/img/logo");
	logo_label->setPixmap(pixmap);
	logo_label->setFixedSize(pixmap.size());
	logo_label->setCursor(Qt::PointingHandCursor);

	button_layout->addStretch();
	button_layout->addWidget(logo_label);
	button_layout->setSpacing(8);
	button_layout->setContentsMargins(15, 0, 0, 0);

	QVBoxLayout *main_layout = new QVBoxLayout();
	main_layout->addLayout(title_layout);
	main_layout->addLayout(button_layout);
	main_layout->setSpacing(0);
	main_layout->setContentsMargins(0, 0, 0, 0);

	this->translateLanguage();

	setLayout(main_layout);
	setFixedHeight(100);
	is_move = false;
}

void TitleWidget::translateLanguage()
{
	version_title->setText(tr("title"));
	skin_button->setToolTip(tr("change skin"));
	main_menu_button->setToolTip(tr("main menu"));
	min_button->setToolTip(tr("minimize"));
	max_button->setToolTip(tr("maximize"));
	close_button->setToolTip(tr("close"));

	button_list.at(0)->setText(tr("power"));
	button_list.at(1)->setText(tr("mummy"));
	button_list.at(2)->setText(tr("hole"));
	button_list.at(3)->setText(tr("repair"));
	button_list.at(4)->setText(tr("clear"));
	button_list.at(5)->setText(tr("optimize"));
	button_list.at(6)->setText(tr("expert"));
	button_list.at(7)->setText(tr("software"));
}

void TitleWidget::mousePressEvent(QMouseEvent *e)
{
	press_point = e->pos();
	is_move = true;
}

void TitleWidget::mouseMoveEvent(QMouseEvent *e)
{
	if ((e->buttons() == Qt::LeftButton) && is_move)
	{
		static QWidget* parent_widget = this->parentWidget();
		QPoint parent_point = parent_widget->pos();
		parent_point.setX(parent_point.x() + e->x() - press_point.x());
		parent_point.setY(parent_point.y() + e->y() - press_point.y());
		parent_widget->move(parent_point);
	}
}

void TitleWidget::mouseReleaseEvent(QMouseEvent *)
{
	if (is_move)
	{
		is_move = false;
	}
}

void TitleWidget::mouseDoubleClickEvent(QMouseEvent *)
{
	emit showMax();
}

void TitleWidget::turnPage(QString current_page)
{
	bool ok;
	int current_index = current_page.toInt(&ok, 10);

	for (int i = 0; i<button_list.count(); i++)
	{
		ToolButton *tool_button = button_list.at(i);
		if (current_index == i)
		{
			tool_button->setMousePress(true);
		}
		else
		{
			tool_button->setMousePress(false);
		}
	}
}


text:
//
// SecCFTypes.cpp - CF runtime interface
//

#include <security_keychain/SecCFTypes.h>
#include <security_keychain/Globals.h>

namespace Security
{

namespace KeychainCore
{

SecCFTypes &
gTypes()
{
	static ModuleNexus<SecCFTypes> nexus;

	return nexus();
}

} // end namespace KeychainCore

} // end namespace Security

using namespace KeychainCore;

SecCFTypes::SecCFTypes() :
	Access("SecAccess"),
	ACL("SecACL"),
	Certificate("SecCertificate"),
	CertificateRequest("SecCertificateRequest"),
	Identity("SecIdentity"),
	IdentityCursor("SecIdentitySearch"),
	ItemImpl("SecKeychainItem"),
	KCCursorImpl("SecKeychainSearch"),
	KeychainImpl("SecKeychain"),
	KeyItem("SecKey"),
    PasswordImpl("SecPassword"),
	Policy("SecPolicy"),
	PolicyCursor("SecPolicySearch"),
	Trust("SecTrust"),
	TrustedApplication("SecTrustedApplication"),
	ExtendedAttribute("SecKeychainItemExtendedAttributes")
{
}


text:
%===================================================================================
\chapter{Generic Linear Solvers in SUNDIALS}\label{s:gen_linsolv}
%===================================================================================
In this section, we describe seven generic linear solver code modules that
are included in {\ida}, but which are of potential use as generic packages in
themselves, either in conjunction with the use of {\ida} or separately.

\input{linsolv}


text:
require 'test_stickler'
require 'digest/sha1'
require 'repository/test_api'

module Stickler
  module RepositoryApiBehaviorTests
    include RepositoryApiTests
    def setup
      super
      @foo_gem_local_path = File.join( gems_dir, "foo-1.0.0.gem" )
      @baz_gem_local_path = File.join( gems_dir, "baz-3.1.4-java.gem" )
      @foo_spec           = Stickler::SpecLite.new( 'foo', '1.0.0' )
      @baz_java_spec      = Stickler::SpecLite.new( 'baz', '3.1.4', 'java')
      assert File.readable?( @foo_gem_local_path ), "#{@foo_gem_local_path} is missing"
      assert File.readable?( @baz_gem_local_path ), "#{@baz_gem_local_path} is missing"
      @foo_digest         = Digest::SHA1.hexdigest( IO.read( @foo_gem_local_path ) )
      @missing_spec       = Stickler::SpecLite.new( "does_not_exist", "0.1.0" )
    end

    #####
    # URI
    #####

    def test_uri
      result = repo.uri
      assert_includes [ ::URI, ::Addressable::URI ], result.class
    end

    def test_gems_uri
      result = repo.gems_uri
      assert_includes [ ::URI, ::Addressable::URI ], result.class
    end

    def test_uri_for_gem
      repo.push( @foo_gem_local_path )
      result = repo.uri_for_gem( @foo_spec )
      assert_includes [ ::URI, ::Addressable::URI ], result.class
      assert_nil repo.uri_for_gem( @missing_spec )
    end

    #######
    # Push
    #######

    def test_pushes_a_gem_file
      repo.push( @foo_gem_local_path )
      result = repo.search_for( Stickler::SpecLite.new( "foo", "1.0.0" ) )
      assert_instance_of Array, result
      assert_equal 1, result.size
    end

    def test_raising_error_when_pushing_already_existing_gem
      repo.push( @foo_gem_local_path )
      assert_raises_kind_of( Stickler::Repository::Error ) do
        repo.push( @foo_gem_local_path )
      end
    end

    ########
    # Delete
    ########

    def test_delete_existing_gem
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )

      assert_equal 1, repo.search_for( @foo_spec ).size

      assert repo.delete( @foo_spec )
      assert_empty repo.search_for( @foo_spec )
    end

    def test_delete_non_existing_gem
      assert_empty repo.search_for( @foo_spec )
      refute repo.delete( @foo_spec )
    end

    ######
    # yank
    ######

    def test_yank_returns_the_uri_of_the_gem
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      @response_uri = repo.yank( @foo_spec )
      assert_includes [ ::URI, ::Addressable::URI ], @response_uri.class
    end

    def test_yank_works_with_nondefault_platform
      assert_empty repo.search_for( @baz_java_spec )
      repo.push( @baz_gem_local_path )
      @response_uri = repo.yank( @baz_java_spec )
      assert_includes [ ::URI, ::Addressable::URI ], @response_uri.class
    end

    def test_yank_returns_nil_for_non_existent_gem
      assert_nil repo.yank( @missing_spec )
    end

    def test_yanked_gem_does_not_appear_in_search
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      @response_uri = repo.yank( @foo_spec )
      assert_empty repo.search_for( @foo_spec )
    end

    def test_yanked_gem_does_still_have_a_uri
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      @response_uri = repo.yank( @foo_spec )
      assert_equal @response_uri, repo.uri_for_gem( @foo_spec )
    end

    def test_yanked_gem_may_still_be_retrieved
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      data = repo.get( @foo_spec )
      sha1 = Digest::SHA1.hexdigest( data )
      assert_equal @foo_digest, sha1
    end

    ########
    # unyank
    ########

    def test_unyank_returns_nil_for_non_existent_gem
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      non_existing_gem = @missing_spec
      assert_nil repo.unyank( non_existing_gem )
    end

    def test_unyank_works_with_nondefault_platform
      assert_empty repo.search_for( @baz_java_spec )
      repo.push( @baz_gem_local_path )
      repo.yank( @baz_java_spec )
      assert_empty repo.search_for( @baz_java_spec )
      repo.unyank( @baz_java_spec )
      assert_equal 1, repo.search_for( @baz_java_spec ).size
    end

    # Do we even care about this?
    def test_unyank_returns_nil_for_not_yet_yanked_gem
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      assert_equal 1, repo.search_for( @foo_spec ).size
      assert_nil repo.unyank( @foo_spec )
    end

    def test_unyank_returns_true_on_success
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      repo.yank( @foo_spec )
      assert repo.unyank( @foo_spec ), "Expected true"
    end

    def test_unyank_returns_gem_to_searchability
      assert_empty repo.search_for( @foo_spec )
      repo.push( @foo_gem_local_path )
      repo.yank( @foo_spec )
      repo.unyank( @foo_spec )
      assert_equal 1, repo.search_for( @foo_spec ).size
    end

    ############
    # Search For
    ############

    def test_search_for_returns_found_items
      repo.push( @foo_gem_local_path )
      refute_empty repo.search_for( @foo_spec )
    end

    def test_search_for_returns_empty_array_when_nothing_found
      assert_empty repo.search_for( @missing_spec )
    end

    #####
    # GET
    #####

    def test_get_returns_the_bytes_of_a_gem_that_exists
      repo.push( @foo_gem_local_path )
      data = repo.get( @foo_spec )
      sha1 = Digest::SHA1.hexdigest( data )
      assert_equal @foo_digest, sha1
    end

    def test_get_returns_nil_for_non_existent_gem
      assert_nil repo.get( @missing_spec )
    end

    ######
    # open
    ######

    def test_open_reads_a_gem_via_the_returned_output_stream
      repo.push( @foo_gem_local_path )
      io = repo.open( @foo_spec )
      sha1 = Digest::SHA1.hexdigest( io.read )
      assert_equal @foo_digest, sha1
    end

    def test_open_may_be_called_with_a_block
      repo.push( @foo_gem_local_path )
      sha1 = Digest::SHA1.new
      repo.open( @foo_spec ) do |io|
        sha1 << io.read
      end
      assert_equal @foo_digest, sha1.hexdigest
    end

    def test_open_returns_nil_for_non_existent_gem
      assert_nil repo.open( @missing_spec )
    end

    def test_open_does_not_call_block_for_non_existent_gem
      called = false
      repo.open( @missing_spec ) do |io|
        called = true
      end
      refute called
    end
  end
end


text:
package com.sequenceiq.cloudbreak.reactor.handler.cluster.upgrade.rds;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import com.sequenceiq.cloudbreak.common.database.TargetMajorVersion;
import com.sequenceiq.cloudbreak.common.event.Selectable;
import com.sequenceiq.cloudbreak.core.flow2.cluster.rds.upgrade.UpgradeRdsService;
import com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorException;
import com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException;
import com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.rds.UpgradeRdsDataRestoreRequest;
import com.sequenceiq.cloudbreak.reactor.api.event.cluster.upgrade.rds.UpgradeRdsFailedEvent;
import com.sequenceiq.flow.reactor.api.handler.HandlerEvent;

@ExtendWith(MockitoExtension.class)
class RestoreRdsDataHandlerTest {

    private static final Long STACK_ID = 12L;

    private static final TargetMajorVersion TARGET_MAJOR_VERSION = TargetMajorVersion.VERSION_11;

    @Mock
    private UpgradeRdsService upgradeRdsService;

    @Mock
    private HandlerEvent<UpgradeRdsDataRestoreRequest> event;

    @InjectMocks
    private RestoreRdsDataHandler underTest;

    @Test
    void selector() {
        assertThat(underTest.selector()).isEqualTo("UPGRADERDSDATARESTOREREQUEST");
    }

    @Test
    void doAccept() throws CloudbreakOrchestratorException {
        UpgradeRdsDataRestoreRequest request = new UpgradeRdsDataRestoreRequest(STACK_ID, TARGET_MAJOR_VERSION);
        when(event.getData()).thenReturn(request);

        Selectable result = underTest.doAccept(event);
        verify(upgradeRdsService).restoreRds(STACK_ID);
        assertThat(result.selector()).isEqualTo("UPGRADERDSDATARESTORERESULT");
    }

    @Test
    void orchestrationException() throws CloudbreakOrchestratorException {
        UpgradeRdsDataRestoreRequest request = new UpgradeRdsDataRestoreRequest(STACK_ID, TARGET_MAJOR_VERSION);
        when(event.getData()).thenReturn(request);
        doThrow(new CloudbreakOrchestratorFailedException("salt error")).when(upgradeRdsService).restoreRds(eq(STACK_ID));

        Selectable result = underTest.doAccept(event);
        verify(upgradeRdsService).restoreRds(STACK_ID);
        assertThat(result.selector()).isEqualTo("UPGRADERDSFAILEDEVENT");
        assertThat(result).isInstanceOf(UpgradeRdsFailedEvent.class);
        UpgradeRdsFailedEvent failedEvent = (UpgradeRdsFailedEvent) result;
        assertThat(failedEvent.getException().getMessage()).isEqualTo("salt error");
    }
}


text:
<?php

namespace Concrete\Core\Localization\Translator\Adapter\Zend\Translation\Loader\Gettext;

use Concrete\Core\Localization\Translator\Translation\Loader\AbstractTranslationLoader;
use Concrete\Core\Localization\Translator\TranslatorAdapterInterface;
use Concrete\Core\Package\PackageList;

/**
 * Translation loader that loads the package translations for the Zend translation
 * adapter.
 *
 * @author Antti Hukkanen <antti.hukkanen@mainiotech.fi>
 */
class PackagesTranslationLoader extends AbstractTranslationLoader
{

    /**
     * {@inheritDoc}
     */
    public function loadTranslations(TranslatorAdapterInterface $translatorAdapter)
    {
        $config = $this->app->make('config');
        if ($config->get('app.bootstrap.packages_loaded') === true) {
            $pkgList = PackageList::get();
            $translator = $translatorAdapter->getTranslator();
            $locale = $translatorAdapter->getLocale();
            foreach ($pkgList->getPackages() as $pkg) {
                $path = $pkg->getPackagePath() . '/' . DIRNAME_LANGUAGES;
                $languageFile = "$path/$locale/LC_MESSAGES/messages.mo";
                if (is_file($languageFile)) {
                    $translator->addTranslationFile('gettext', $languageFile);
                }
            }
        }
    }

}


text:
/*global describe, it */
'use strict';

(function () {

  describe('Morse', function () {

    it('should exist', function() {
      expect(morse).to.exist;
    });

    describe('Convert a String', function() {

      it('should have an "encode" method', function() {
        expect(morse.encode).to.be.a('function');
      });

      describe('encode', function () {
        before(function() {
          this.string = 'SOS';
          this.result = morse.encode(this.string);
        });

        it('should return a String', function() {
          expect(this.result).to.be.a('string');
        });

        it('should encode a Roman alphabet String into Morse Code', function() {
          expect(this.result).to.equal('... --- ...');
        });
      });

      it('should have an "decode" method', function() {
        expect(morse.encode).to.be.a('function');
      });

      describe('decode', function () {
        before(function() {
          this.string = '... --- ...';
          this.result = morse.decode(this.string);
        });

        it('should return a String', function() {
          expect(this.result).to.be.a('string');
        });

        it('should decode a Morse Code String into the Roman alphabet', function() {
          expect(this.result).to.equal('sos');
        });
      });

    });

  });

})();


text:
<?php

namespace common\models;

use backend\components\ManyToManyBehavior;
use backend\models\Currency;
use common\components\MultilingualBehavior;
use common\components\Number;
use common\modules\i18n\Module;
use Yii;
use yii\helpers\ArrayHelper;

/**
 * This is the model class for table "delivery".
 *
 * @property integer $id
 * @property integer $enabled
 * @property string $alias
 * @property double $price
 * @property integer $currency_id
 *
 * @property Currency $currency
 * @property PaymentType[] $paymentTypes
 */
class Delivery extends Bean
{

    const STATUS_ENABLED = 1;

    const TABLE_DELIVERY_PAYMENT_TYPE = 'delivery_payment_type';

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'delivery';
    }

    /**
     * @var string
     */
    protected $tableLang = 'deliverylang';

    /**
     * Init multilingual fields
     */
    public function init()
    {
        $this->multiLanguageFields = ['title', 'description'];
        parent::init();
    }

    /**
     * @return array
     */
    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'ml'           => [
                'class'           => MultilingualBehavior::className(),
                'defaultLanguage' => Lang::getDefaultLang()->url,
                'langForeignKey'  => 'delivery_id',
                'tableName'       => "{{%" . $this->tableLang . "}}",
                'attributes'      => $this->multiLanguageFields,
            ],
            'slug'         => [
                'class'        => 'common\\behaviors\\Alias',
                'inAttribute'  => 'title',
                'outAttribute' => 'alias',
            ],
            'payment_type' => [
                'class'     => ManyToManyBehavior::className(),
                'relations' => [
                    'payment_type_ids' => 'paymentTypes',
                ],
            ],
        ]);
    }

    /**
     * Method for getting the name of the bean
     * Is called for breadcrumb generation
     * @return array
     */
    public static function getLabels()
    {
        return [
            'singular' => 'Delivery type',
            'multiple' => 'Delivery types'
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        $multiLanguageNames = $this->formMultiLanguageFields();
        $safe = ArrayHelper::merge($multiLanguageNames['title'], $multiLanguageNames['description']);
        return [
            [['enabled', 'alias', 'price', 'currency_id'], 'required'],
            [['enabled', 'currency_id'], 'integer'],
            [['price'], 'number'],
            [['alias'], 'string', 'max' => 255],
            [['payment_type_ids'], 'each', 'rule' => ['integer']],
            [['currency_id'], 'exist', 'skipOnError' => true, 'targetClass' => Currency::className(), 'targetAttribute' => ['currency_id' => 'id']],
            [$safe, 'safe']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id'               => Module::t('Id'),
            'enabled'          => Module::t('Enabled'),
            'alias'            => Module::t('Alias'),
            'price'            => Module::t('Price'),
            'currency_id'      => Module::t('Currency'),
            'payment_type_ids' => Module::t('Payment types'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCurrency()
    {
        return $this->hasOne(Currency::className(), ['id' => 'currency_id']);
    }

    /**
     * @return float
     */
    public function getPrice()
    {
        $toCurrency = Currency::getCurrentCurrency();
        $fromCurrency = Currency::findOne($this->currency_id);
        $price = Currency::convertPrice($this->price, $fromCurrency, $toCurrency);
        return $price;
    }

    public function getPaymentTypes()
    {
        return $this->hasMany(PaymentType::className(), [
            'id' => 'payment_type_id'
        ])->viaTable(self::TABLE_DELIVERY_PAYMENT_TYPE, ['delivery_id' => 'id']);
    }

    /**
     * @param null $price
     * @return string
     */
    public function getPriceFormatted($price = null)
    {
        if (!isset($price)) {
            $price = $this->getPrice();
        }
        $toCurrency = Currency::getCurrentCurrency();
        $price = number_format($price, 0, Number::DECIMAL_SEPARATOR, Number::THOUSAND_SEPARATOR);
        return Currency::showFormattedPrice($price, $toCurrency);
    }
    /**
     * @param bool $format
     * @param bool $isDefaultCurrency
     * @return int|string
     */
    public function getFormattedPrice($format = true, $isDefaultCurrency = false)
    {
        $currency = Currency::findOne($this->currency_id);
        $price = Currency::convertToDefaultCurrency($this->price, $currency);
        $priceCurrent = Currency::convertFromDefault($price, Currency::getCurrentCurrency());
        if ($isDefaultCurrency) {
            return $price;
        }
        return $format ? Currency::showPrice($price) : $priceCurrent;
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
An. Jard. bot. Madr. 4: 152 (1944)

#### Original name
Leptosphaeria cynosuri Unamuno

### Remarks
null


text:
import logging

class InstrumentState(object):
    """
    The state of the MIDI instrument attached to the input
    port.
    """

    _log = logging.getLogger("keyzer:InstrumentState")
    _notes = 88 * [0]

    @staticmethod
    def getNote(noteIndex):
        return InstrumentState._notes[noteIndex]

    @staticmethod
    def setNote(noteIndex, velocity):
        InstrumentState._notes[noteIndex] = velocity

    @staticmethod
    def unsetNote(noteIndex):
        InstrumentState.setNote(noteIndex, 0)

    @staticmethod
    def onInstrumentEvent(note, velocity):
        InstrumentState._notes[note] = velocity
        InstrumentState._log.debug("{}, {}".format(note, velocity))


text:
require "execjs/runtime"

module ExecJS
  class JohnsonRuntime < Runtime
    class Context < Runtime::Context
      def initialize(runtime, source = "")
        source = encode(source)

        @runtime = Johnson::Runtime.new
        @runtime.evaluate(source)
      end

      def exec(source, options = {})
        source = encode(source)

        if /\S/ =~ source
          eval "(function(){#{source}})()", options
        end
      end

      def eval(source, options = {})
        source = encode(source)

        if /\S/ =~ source
          unbox @runtime.evaluate("(#{source})")
        end
      rescue Johnson::Error => e
        if syntax_error?(e)
          raise RuntimeError, e.message
        else
          raise ProgramError, e.message
        end
      end

      def call(properties, *args)
        unbox @runtime.evaluate(properties).call(*args)
      rescue Johnson::Error => e
        if syntax_error?(e)
          raise RuntimeError, e.message
        else
          raise ProgramError, e.message
        end
      end

      def unbox(value)
        case
        when function?(value)
          nil
        when string?(value)
          value.respond_to?(:force_encoding) ?
            value.force_encoding('UTF-8') :
            value
        when array?(value)
          value.map { |v| unbox(v) }
        when object?(value)
          value.inject({}) do |vs, (k, v)|
            vs[k] = unbox(v) unless function?(v)
            vs
          end
        else
          value
        end
      end

      private
        def syntax_error?(error)
          error.message =~ /^syntax error at /
        end

        def function?(value)
          value.respond_to?(:function?) && value.function?
        end

        def string?(value)
          value.is_a?(String)
        end

        def array?(value)
          array_test.call(value)
        end

        def object?(value)
          value.respond_to?(:inject)
        end

        def array_test
          @array_test ||= @runtime.evaluate("(function(a) {return a instanceof [].constructor})")
        end
    end

    def name
      "Johnson (SpiderMonkey)"
    end

    def available?
      require "johnson"
      true
    rescue LoadError
      false
    end

    def deprecated?
      true
    end
  end
end


text:
Citation: Wall, D.P., Fraser, H.B. and Hirsh, A.E. (2003) Detecting putative orthologs, Bioinformatics, 19, 1710-1711.

The reciprocal smallest distance (RSD) algorithm (Wall, et al., 2003.
http://bioinformatics.oxfordjournals.org/content/19/13/1710) accurately infers
orthologs between pairs of genomes by considering global sequence alignment and
maximum likelihood evolutionary distance between sequences.  Orthologs inferred
with RSD for many species are available at Roundup
(http://roundup.hms.harvard.edu/), which provides multi-species clusters of
orthologous genes, output in formats for other phylogenetics packages, and
sequence metadata such as Gene Ontology terms and database cross-references.

This package contains source code, scripts for running RSD, and example input
and output files.

- README.md:  the file you are reading now
- bin/rsd_search: a script that runs the reciprocal smallest distance (RSD)
  algorithm to search for orthologs.
- bin/rsd_blast: a script that computes and saves BLAST hits for use in
  multiple runs of RSD.
- bin/rsd_format: a script that turns FASTA-formatted genomes into
  BLAST-formatted indexes.
- rsd/: python package implementing the RSD algorithm.
- rsd/jones.dat, rsd/codeml.ctl:  used by codeml/paml to compute the
  evolutionary distance between two sequences.
- examples/:  a directory containing examples of inputs and outputs to rsd,
  including fasta-formatted genome protein sequence files, a query sequence id
  file (for --ids), and an orthologs output file.

## Installing RSD

### Prerequisites

RSD depends on Python, NCBI BLAST, PAML, and Kalign.  It has been tested to
work with the versions below.  It might work with other versions too.

Install:

- Python 2.7: http://www.python.org/download/
- NCBI BLAST 2.2.24: ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/
- PAML 4.4: http://abacus.gene.ucl.ac.uk/software/paml.html
- Kalign 2.04: http://msa.sbc.su.se/cgi-bin/msa.cgi

Add the executables for python (version 2.7), makeblastdb, blastp, codeml, and
kalign, to your PATH.

### Install Using Pip

Use pip ( http://www.pip-installer.org/ ) to easily install the
reciprocal\_smallest\_distance package:

    pip install reciprocal_smallest_distance

### Install From Github

Installing from github is an easy way to make the `examples/` directory
accessible for running the examples in this README file.

Clone the latest version from GitHub:

    cd ~  # Optional
    git clone https://github.com/todddeluca/reciprocal_smallest_distance

Install reciprocal\_smallest\_distance, making sure to use Python 2.7:

    cd reciprocal_smallest_distance
    python setup.py install

## Using RSD to Find Othologs

The following example commands demonstrate the main ways to run `rsd_search`.
Every invocation of `rsd_search` requires specifying the location of a
FASTA-formatted sequence file for two genomes, called the query and subject
genomes.  Their order is arbitrary, but if you use the `--ids` option, the ids
must come from the query genome.  You must also specify a file to write the
results of the orthologs found by the RSD algorithm.  The
[formats](#output_formats) of the output file are described in detail below.
You can optionally specify a file containing ids using the `--ids` option.
Then rsd will only search for orthologs for those ids.  Using `--de` gives you
the option of using different divergence and evalue thresholds from the
defaults.

Get help on how to run `rsd_search`, `rsd_blast`, or `rsd_format`:

    rsd_search -h
    rsd_blast -h
    rsd_format -h

Find orthologs between all the sequences in the query and subject genomes,
using the default divergence and evalue thresholds:

    rsd_search -q examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa \
    --subject-genome=examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa \
    -o Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa_0.8_1e-5.orthologs.txt

Find orthologs using several divergence and evalue threshold combinations:

    rsd_search -q examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa \
    --subject-genome=examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa \
    -o Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa.several.orthologs.txt \
    --de 0.2 1e-20 --de .5 0.00001 --de 0.8 0.1

It is not necessary to format a FASTA file for BLAST or compute BLAST hits
because `rsd_search` does it for you.  However if you plan on running
`rsd_search` multiple times for the same genomes, especially for large genomes,
you can save time by using `rsd_format` to preformatting the FASTA files and
`rsd_blast` to precomputing the BLAST hits.  When running `rsd_blast`, make
sure to use an --evalue as large as the largest evalue threshold you intend to
give to `rsd_search`.

Here is how to format a pair of FASTA files in place:

    rsd_format -g examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa
    rsd_format -g examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa

And here is how to format the FASTA files, putting the results in another
directory (the current directory in this case):

    rsd_format -g examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa -d .
    rsd_format -g examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa -d .

Here is how to compute forward and reverse blast hits (using the default
evalue):

    rsd_blast -v -q examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa \
    --subject-genome=examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa \
    --forward-hits q_s.hits --reverse-hits s_q.hits

Here is how to compute forward and reverse blast hits for `rsd_search`, using
genomes that have already been formatted for blast and a non-default evalue:

    rsd_blast -v -q Mycoplasma_genitalium.aa \
    --subject-genome=Mycobacterium_leprae.aa \
    --forward-hits q_s.hits --reverse-hits s_q.hits \
    --no-format --evalue 0.1

Find orthologs between all the sequences in the query and subject genomes using
genomes that have already been formatted for blast:

    rsd_search -q Mycoplasma_genitalium.aa \
    --subject-genome=Mycobacterium_leprae.aa \
    -o Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa_0.8_1e-5.orthologs.txt \
    --no-format

Find orthologs between all the sequences in the query and subject genomes using
hits that have already been computed.  Notice that --no-format is included,
because since the blast hits have already been computed the genomes do not need
to be formatted for blast:

    rsd_search -v --query-genome Mycoplasma_genitalium.aa \
    --subject-genome=Mycobacterium_leprae.aa \
    -o Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa.default.orthologs.txt \
    --forward-hits q_s.hits --reverse-hits s_q.hits --no-format

Find orthologs for specific sequences in the query genome.  For finding
orthologs for only a few sequences, using `--no-blast-cache` can speed up
computation.  YMMV.

    rsd_search -q examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa \
    --subject-genome=examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa \
    -o examples/Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa_0.8_1e-5.orthologs.txt \
    --ids examples/Mycoplasma_genitalium.aa.ids.txt --no-blast-cache

<a name="output_formats"/>
## Output Formats

Orthologs can be saved in several different formats using the `--outfmt` option
of `rsd_search`.  The default format, `--outfmt -1`, refers to `--outfmt 3`.
Inspired by Uniprot dat files, a set of orthologs starts with a parameters
line, then has 0 or more ortholog lines, then has an end line.  The parametes
are the query genome name, subject genome name, divergence threshold, and
evalue threshold.  Each ortholog is on a single line listing the query sequence
id, the subject sequence id, and the maximum likelihood distance estimate.
This format can represent orthologs for multiple sets of parameters in a single
file as well as sets of parameters with no orthologs.  Therefore it is suitable
for use with `rsd_search` when specifying multiple divergence and evalue
thresholds.

Here is an example containing 2 parameter combinations, one of which has no
orthologs:

    PA\tLACJO\tYEAS7\t0.2\t1e-15
    OR\tQ74IU0\tA6ZM40\t1.7016
    OR\tQ74K17\tA6ZKK5\t0.8215
    //
    PA\tMYCGE\tMYCHP\t0.2\t1e-30
    //

The original format of RSD, `--outfmt 1`, is provided for backward
compatibility.  Each line contains an ortholog, represented as subject sequence
id, query sequence id, and maximum likelihood distance estimate.  It can only
represent a single set of orthologs in a file.

Example:

    A6ZM40\tQ74IU0\t1.7016
    A6ZKK5\tQ74K17\t0.8215

Also provided for backward compatibility is a format used internally by Roundup
(http://roundup.hms.harvard.edu/) which is like the original RSD format, except
the query sequence id column is before the subject sequence id.

Example:

    Q74IU0\tA6ZM40\t1.7016
    Q74K17\tA6ZKK5\t0.8215

## Testing

This assumes you have cloned the repository.

For convenience, define some environment variables:

    export TMP=$HOME/tmp
    mkdir -p $TMP
    export REPO_PATH=<path/to/reciprocal_smallest_distance> # e.g. export REPO_PATH=~/git/reciprocal_smallest_distance

Create a virtualenv in which to install RSD:

    cd $TMP
    virtualenv venv

Install RSD into the virtualenv:

    venv/bin/pip install -e $REPO_PATH

Run an example command:

    venv/bin/rsd_search -q $REPO_PATH/examples/genomes/Mycoplasma_genitalium.aa/Mycoplasma_genitalium.aa \
    --subject-genome=$REPO_PATH/examples/genomes/Mycobacterium_leprae.aa/Mycobacterium_leprae.aa \
    -o Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa_0.8_1e-5.orthologs.txt

Examine the results:

    less Mycoplasma_genitalium.aa_Mycobacterium_leprae.aa_0.8_1e-5.orthologs.txt


text:
********
Log-PDFs
********

.. currentmodule:: pints

:class:`LogPDFs<pints.LogPDF>` are callable objects that represent
distributions, including likelihoods and Bayesian priors and posteriors.
They are unnormalised, i.e. their area does not necessarily sum up to 1, and
for efficiency reasons we always work with the logarithm e.g. a log-likelihood
instead of a likelihood.

Example::

    p = pints.GaussianLogPrior(mean=0, variance=1)
    x = p(0.1)

Overview:

- :class:`LogPDF`
- :class:`LogPrior`
- :class:`LogPosterior`
- :class:`PooledLogPDF`
- :class:`ProblemLogLikelihood`
- :class:`SumOfIndependentLogPDFs`

.. autoclass:: LogPDF

.. autoclass:: LogPrior

.. autoclass:: LogPosterior

.. autoclass:: PooledLogPDF

.. autoclass:: ProblemLogLikelihood

.. autoclass:: SumOfIndependentLogPDFs


text:
namespace password_manager {

class PasswordStore;

// The production code implementation of FormSaver.
class FormSaverImpl : public FormSaver {
 public:
  // |store| needs to outlive |this| and will be used for all PasswordStore
  // operations.
  explicit FormSaverImpl(PasswordStore* store);

  ~FormSaverImpl() override;

  // FormSaver:
  autofill::PasswordForm PermanentlyBlacklist(
      PasswordStore::FormDigest digest) override;
  void Unblacklist(const PasswordStore::FormDigest& digest) override;
  void Save(autofill::PasswordForm pending,
            const std::vector<const autofill::PasswordForm*>& matches,
            const base::string16& old_password) override;
  void Update(autofill::PasswordForm pending,
              const std::vector<const autofill::PasswordForm*>& matches,
              const base::string16& old_password) override;
  void UpdateReplace(autofill::PasswordForm pending,
                     const std::vector<const autofill::PasswordForm*>& matches,
                     const base::string16& old_password,
                     const autofill::PasswordForm& old_unique_key) override;
  void Remove(const autofill::PasswordForm& form) override;
  std::unique_ptr<FormSaver> Clone() override;

 private:
  // The class is stateless. Don't introduce it. The methods are utilities for
  // common tasks on the password store. The state should belong to either a
  // form handler or origin handler which could embed FormSaver.

  // Cached pointer to the PasswordStore.
  PasswordStore* const store_;

  DISALLOW_COPY_AND_ASSIGN(FormSaverImpl);
};

}  // namespace password_manager

#endif  // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_SAVER_IMPL_H_


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Lonicera thibetica Bureau & Franch.

### Remarks
null


text:
require_relative "textbringer/version"
require_relative "textbringer/config"
require_relative "textbringer/errors"
require_relative "textbringer/ring"
require_relative "textbringer/buffer"
require_relative "textbringer/window"
require_relative "textbringer/keymap"
require_relative "textbringer/utils"
require_relative "textbringer/color"
require_relative "textbringer/face"
require_relative "textbringer/commands"
require_relative "textbringer/commands/buffers"
require_relative "textbringer/commands/windows"
require_relative "textbringer/commands/files"
require_relative "textbringer/commands/misc"
require_relative "textbringer/commands/isearch"
require_relative "textbringer/commands/replace"
require_relative "textbringer/commands/dabbrev"
require_relative "textbringer/commands/ctags"
require_relative "textbringer/commands/clipboard"
require_relative "textbringer/commands/register"
require_relative "textbringer/commands/keyboard_macro"
require_relative "textbringer/commands/fill"
require_relative "textbringer/commands/server"
require_relative "textbringer/commands/input_method"
require_relative "textbringer/commands/help"
require_relative "textbringer/mode"
require_relative "textbringer/modes/fundamental_mode"
require_relative "textbringer/modes/programming_mode"
require_relative "textbringer/modes/ruby_mode"
require_relative "textbringer/modes/c_mode"
require_relative "textbringer/modes/backtrace_mode"
require_relative "textbringer/modes/completion_list_mode"
require_relative "textbringer/modes/buffer_list_mode"
require_relative "textbringer/modes/help_mode"
require_relative "textbringer/input_method"
require_relative "textbringer/input_methods/t_code_input_method"
require_relative "textbringer/input_methods/hiragana_input_method"
require_relative "textbringer/plugin"
require_relative "textbringer/controller"
require_relative "textbringer/default_output"