text:
package com.neustar.ultraservice.schema.v01;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for FTPTransaction complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="FTPTransaction">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="warningCriteria" type="{http://schema.ultraservice.neustar.com/v01/}FTPCriteria" minOccurs="0"/>
 *         <element name="criticalCriteria" type="{http://schema.ultraservice.neustar.com/v01/}FTPCriteria" minOccurs="0"/>
 *         <element name="failCriteria" type="{http://schema.ultraservice.neustar.com/v01/}FTPCriteria" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="port" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
 *       <attribute name="passive" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *       <attribute name="username" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="path" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FTPTransaction", propOrder = {
    "warningCriteria",
    "criticalCriteria",
    "failCriteria"
})
public class FTPTransaction {

    protected FTPCriteria warningCriteria;
    protected FTPCriteria criticalCriteria;
    protected FTPCriteria failCriteria;
    @XmlAttribute(name = "port", required = true)
    protected int port;
    @XmlAttribute(name = "passive", required = true)
    protected boolean passive;
    @XmlAttribute(name = "username")
    protected String username;
    @XmlAttribute(name = "password")
    protected String password;
    @XmlAttribute(name = "path", required = true)
    protected String path;

    /**
     * Gets the value of the warningCriteria property.
     *
     * @return
     *     possible object is
     *     {@link FTPCriteria }
     *
     */
    public FTPCriteria getWarningCriteria() {
        return warningCriteria;
    }

    /**
     * Sets the value of the warningCriteria property.
     *
     * @param value
     *     allowed object is
     *     {@link FTPCriteria }
     *
     */
    public void setWarningCriteria(FTPCriteria value) {
        this.warningCriteria = value;
    }

    /**
     * Gets the value of the criticalCriteria property.
     *
     * @return
     *     possible object is
     *     {@link FTPCriteria }
     *
     */
    public FTPCriteria getCriticalCriteria() {
        return criticalCriteria;
    }

    /**
     * Sets the value of the criticalCriteria property.
     *
     * @param value
     *     allowed object is
     *     {@link FTPCriteria }
     *
     */
    public void setCriticalCriteria(FTPCriteria value) {
        this.criticalCriteria = value;
    }

    /**
     * Gets the value of the failCriteria property.
     *
     * @return
     *     possible object is
     *     {@link FTPCriteria }
     *
     */
    public FTPCriteria getFailCriteria() {
        return failCriteria;
    }

    /**
     * Sets the value of the failCriteria property.
     *
     * @param value
     *     allowed object is
     *     {@link FTPCriteria }
     *
     */
    public void setFailCriteria(FTPCriteria value) {
        this.failCriteria = value;
    }

    /**
     * Gets the value of the port property.
     *
     */
    public int getPort() {
        return port;
    }

    /**
     * Sets the value of the port property.
     *
     */
    public void setPort(int value) {
        this.port = value;
    }

    /**
     * Gets the value of the passive property.
     *
     */
    public boolean isPassive() {
        return passive;
    }

    /**
     * Sets the value of the passive property.
     *
     */
    public void setPassive(boolean value) {
        this.passive = value;
    }

    /**
     * Gets the value of the username property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getUsername() {
        return username;
    }

    /**
     * Sets the value of the username property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setUsername(String value) {
        this.username = value;
    }

    /**
     * Gets the value of the password property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPassword() {
        return password;
    }

    /**
     * Sets the value of the password property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPassword(String value) {
        this.password = value;
    }

    /**
     * Gets the value of the path property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getPath() {
        return path;
    }

    /**
     * Sets the value of the path property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setPath(String value) {
        this.path = value;
    }

}


text:
var pluralize = require('pluralize');
var testing = require('./testing/testing');
var ANSI_GREEN = "\u001B[32m";
var ANSI_RESET = "\u001B[0m";
var ANSI_RED = "\u001B[0;31m";

var glob = require("glob")
glob("**/*.js", {ignore: ['node_modules/**', 'test.js']}, function (er, files) {
  var tests = 0;
  for (var file of files) {
    var obj = require('./' + file);
  }
  let testsRemaining = testing.getTests();
  let testCount = testsRemaining.length;
  function complete() {
    console.log("\n" + ANSI_GREEN + (testCount) + ' ' + pluralize('test', testCount) + ' passed' + ANSI_RESET + "\n");
  }
  function nextTest() {
    if (testsRemaining.length == 0) {
      complete();
      return;
    }
    process.stdout.write('.');
    let test = testsRemaining.pop();
    if (test.async) {
      // for async test - ensure the test finishes within 250ms
      let timeoutId = null;
      let callback = function() {
        if (timeoutId) {
          clearTimeout(timeoutId);
          timeoutId = null;
        }
        // clear stacktrace for next test
        setTimeout(nextTest, 0);
      }
      test.func(callback);
      timeoutId = setTimeout(function() {
        console.log(ANSI_RED + 'async test timed out!' + ANSI_RESET);
        // remove the callback, so if function finishes later, we don't continue running other tests
        callback = function() {};
      }, 250);
    } else {
      test.func();
      setTimeout(nextTest, 0);
    }
  }
  nextTest();
});

redpajama_set_name: RedPajamaGithub


text:
package socialite.parser;

import socialite.collection.SArrayList;

import java.util.ArrayList;
import java.util.List;
import socialite.parser.Param;

/* Private predicate (is mapped to PrivateTable) */
public class PrivPredicate extends Predicate {
    private static final long serialVersionUID = 1;

    @Override
	public PrivPredicate clone() {
		return new PrivPredicate(name, params);
	}

    public PrivPredicate() {};
    public PrivPredicate(String _name, List<Param> _params, boolean rename) {
		super(_name, renameVariables(_params));
		assert rename;
	}
	public PrivPredicate(String _name, List<Param> _params) {
		super(_name, _params);
	}

	static Param renameVar(Param param) {
		if (param instanceof Variable) {
			Variable v=(Variable)param;
			Variable newV = new Variable(v.name+"$priv", v.type);
			newV.dontCare = v.dontCare;
			return newV;
		}
		return param;
	}

	static List<Param> renameVariables(List<Param> _params) {
		List<Param> params = new SArrayList<Param>(_params.size());
		for (Param o:_params) {
			if (o instanceof Variable) {
				params.add((Variable)renameVar(o));
			} else {
				params.add(o);
			}
		}
		return params;
	}
}


text:
package com.microsoft.windowsazure.services.media.implementation.templates.widevine;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class WidevineMessage {
    /**
     * Controls which content keys should be included in a license. Only one of
     * allowed_track_types and content_key_specs can be specified.
     */
    @JsonProperty("allowed_track_types")
    private AllowedTrackTypes allowedTrackTypes;

    /**
     * A finer grained control on what content keys to return. Only one of
     * allowed_track_types and content_key_specs can be specified.
     */
    @JsonProperty("content_key_specs")
    private ContentKeySpecs[] contentKeySpecs;

    /**
     * Policy settings for this license. In the event this asset has a
     * pre-defined policy, these specified values will be used.
     */
    @JsonProperty("policy_overrides")
    private Object policyOverrides;

    @JsonProperty("allowed_track_types")
    public AllowedTrackTypes getAllowedTrackTypes() {
        return allowedTrackTypes;
    }

    @JsonProperty("allowed_track_types")
    public void setAllowedTrackTypes(AllowedTrackTypes allowedTrackTypes) {
        this.allowedTrackTypes = allowedTrackTypes;
    }

    @JsonProperty("content_key_specs")
    public ContentKeySpecs[] getContentKeySpecs() {
        return contentKeySpecs;
    }

    @JsonProperty("content_key_specs")
    public void setContentKeySpecs(ContentKeySpecs[] contentKeySpecs) {
        this.contentKeySpecs = contentKeySpecs;
    }

    @JsonProperty("policy_overrides")
    public Object getPolicyOverrides() {
        return policyOverrides;
    }

    @JsonProperty("policy_overrides")
    public void setPolicyOverrides(Object policyOverrides) {
        this.policyOverrides = policyOverrides;
    }
}


text:
<?php

namespace Google\Service\Apigee;

class GoogleCloudApigeeV1DeleteCustomReportResponse extends \Google\Model
{
  /**
   * @var string
   */
  public $message;

  /**
   * @param string
   */
  public function setMessage($message)
  {
    $this->message = $message;
  }
  /**
   * @return string
   */
  public function getMessage()
  {
    return $this->message;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GoogleCloudApigeeV1DeleteCustomReportResponse::class, 'Google_Service_Apigee_GoogleCloudApigeeV1DeleteCustomReportResponse');


text:
'use strict';
var $export = require('./_export');
var aFunction = require('./_a-function');
var toObject = require('./_to-object');
var fails = require('./_fails');
var $sort = [].sort;
var test = [1, 2, 3];

$export($export.P + $export.F * (fails(function () {
  // IE8-
  test.sort(undefined);
}) || !fails(function () {
  // V8 bug
  test.sort(null);
  // Old WebKit
}) || !require('./_strict-method')($sort)), 'Array', {
  // 22.1.3.25 Array.prototype.sort(comparefn)
  sort: function sort(comparefn) {
    return comparefn === undefined
      ? $sort.call(toObject(this))
      : $sort.call(toObject(this), aFunction(comparefn));
  }
});


text:
import os
import sys
import dbus
import time
import urllib2
import subprocess
import ConfigParser
from bs4 import BeautifulSoup
from os.path import expanduser

item              = "org.freedesktop.Notifications"
path              = "/org/freedesktop/Notifications"
interface         = "org.freedesktop.Notifications"
app_name          = "Gmail Plugin"
id_num_to_replace = 0
icon              = os.path.join(sys.path[0], 'gmail.png')
title             = "Gmail"
actions_list      = ''
hint              = ''
bus = dbus.SessionBus()
notif = bus.get_object(item, path)
notify = dbus.Interface(notif, interface)

FEED_URL = 'https://mail.google.com/mail/feed/atom'

def ConfigSectionMap(section):
    values = {}
    options = Config.options(section)
    for option in options:
        try:
            values[option] = Config.get(section, option)
            if values[option] == -1:
                DebugPrint("skip: %s" % option)
        except:
            print("exception on %s!" % option)
            values[option] = None
    return values

def internet_on():
    return subprocess.call(['/bin/ping', '-c1', 'google.com'])

def updatecredentials():
    home = expanduser("~")
    homefile = os.path.join(home, '.gmailnotf.ini')
    if os.path.exists(homefile):
        updateconfig = ConfigParser.RawConfigParser()
        updateconfig.read(homefile)
        username = updateconfig.get(updateconfig.sections()[0], updateconfig.options(updateconfig.sections()[0])[0])
        password = updateconfig.get(updateconfig.sections()[0], updateconfig.options(updateconfig.sections()[0])[1])
        changeconfig = ConfigParser.RawConfigParser()
        conpath = sys.path[0]
        configpath = os.path.join(conpath, 'config.ini')
        changeconfig.read(configpath)
        changeconfig.sections()
        changeconfig.set('SectionOne', 'username', username)
        changeconfig.set('SectionOne', 'password', password)
        with open(configpath, 'wb') as configfile:
            changeconfig.write(configfile)
    else:
        return

class Gmailnotification:

    def __init__(self, user, passwd, previousnumber):
        self.getnumberofmessage(user, passwd, previousnumber)

    def getnumberofmessage(self, user, passwd, previousnumber):
        auth_handler = urllib2.HTTPBasicAuthHandler()
        auth_handler.add_password(
            realm='New mail feed',
            uri='https://mail.google.com',
            user='{user}@gmail.com'.format(user=user),
            passwd=passwd
        )
        opener = urllib2.build_opener(auth_handler)
        urllib2.install_opener(opener)
        feed = urllib2.urlopen(FEED_URL)
        self.parsingfullcount(feed, previousnumber)

    def parsingfullcount(self, feed, previousnumber):
        soup = BeautifulSoup(feed.read())
        number = soup.fullcount.string
        number = int(number)
        unreadmessages = "You have %d unread mails" % int(number)
        self.sendmessage(unreadmessages, number, previousnumber)

    def sendmessage(self, message, number, previousnumber):
        diff = int(number) - int(previousnumber)
        if int(diff) == 0:
            self.dontshowpopup(message, number, previousnumber)
        else:
            self.showpopup(number, message)

    def dontshowpopup(self, message, number, previousnumber):
        self.value = number

    def showpopup(self, number, message):
        nomessage = "No unread mails"
        if number == 0:
            text = nomessage
            time = 5000
            notify.Notify(app_name, id_num_to_replace, icon, title, text, actions_list, hint, time)
            self.updateconfig(number)
        else:
            text = message
            time = 5000
            notify.Notify(app_name, id_num_to_replace, icon, title, text, actions_list, hint, time)
            self.updateconfig(number)

    def updateconfig(self, number):
        self.cwd = sys.path[0]
        self.basefile = os.path.join(self.cwd, 'config.ini')
        self.editconfig = ConfigParser.RawConfigParser()
        self.editconfig.read(self.basefile)
        self.editconfig.set('SectionOne', 'previousnumber', number)
        with open(self.basefile, 'wb') as configfile:
            self.editconfig.write(configfile)
        return

if __name__ == "__main__":
    updatecredentials()
    while True:
        if internet_on() == 0:
            cwd = sys.path[0]
            basefile = os.path.join(cwd, 'config.ini')
            Config = ConfigParser.ConfigParser()
            Config.read(basefile)
            user = ConfigSectionMap("SectionOne")['username']
            passwd = ConfigSectionMap("SectionOne")['password']
            previousnumber = ConfigSectionMap("SectionOne")['previousnumber']
            d = Gmailnotification(user, passwd, previousnumber)
            time.sleep(300)
        else:
            time.sleep(30)


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.DirectoryServices;
using System.Text;

using System.Runtime.InteropServices;

namespace System.DirectoryServices.AccountManagement
{
#pragma warning disable 618    // Have not migrated to v4 transparency yet
    [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
#pragma warning restore 618
    internal class SAMMembersSet : BookmarkableResultSet
    {
        internal SAMMembersSet(string groupPath, UnsafeNativeMethods.IADsGroup group, bool recursive, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info,
                                    "SAMMembersSet",
                                    "SAMMembersSet: groupPath={0}, recursive={1}, base={2}",
                                    groupPath,
                                    recursive,
                                    ctxBase.Path);

            _storeCtx = storeCtx;
            _ctxBase = ctxBase;

            _group = group;
            _originalGroup = group;
            _recursive = recursive;

            _groupsVisited.Add(groupPath);    // so we don't revisit it

            UnsafeNativeMethods.IADsMembers iADsMembers = group.Members();
            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();
        }

        // Return the principal we're positioned at as a Principal object.
        // Need to use our StoreCtx's GetAsPrincipal to convert the native object to a Principal
        override internal object CurrentAsPrincipal
        {
            get
            {
                if (_current != null)
                {
                    // Local principal --- handle it ourself
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "CurrentAsPrincipal: returning current");
                    return SAMUtils.DirectoryEntryAsPrincipal(_current, _storeCtx);
                }
                else if (_currentFakePrincipal != null)
                {
                    // Local fake principal --- handle it ourself
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "CurrentAsPrincipal: returning currentFakePrincipal");
                    return _currentFakePrincipal;
                }
                else if (_currentForeign != null)
                {
                    // Foreign, non-recursive principal.  Just return the principal.
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "CurrentAsPrincipal: returning currentForeign");
                    return _currentForeign;
                }
                else
                {
                    // Foreign recursive expansion.  Proxy the call to the foreign ResultSet.
                    Debug.Assert(_foreignResultSet != null);
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "CurrentAsPrincipal: returning foreignResultSet");
                    return _foreignResultSet.CurrentAsPrincipal;
                }
            }
        }

        // Advance the enumerator to the next principal in the result set, pulling in additional pages
        // of results (or ranges of attribute values) as needed.
        // Returns true if successful, false if no more results to return.
        override internal bool MoveNext()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Entering MoveNext");

            _atBeginning = false;

            bool f = MoveNextLocal();

            if (!f)
            {
                GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNext: trying foreign");

                f = MoveNextForeign();
            }

            return f;
        }

        private bool MoveNextLocal()
        {
            bool needToRetry;

            do
            {
                needToRetry = false;

                object[] nativeMembers = new object[1];

                bool f = _membersEnumerator.MoveNext();

                if (f) // got a value
                {
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: got a value from the enumerator");

                    UnsafeNativeMethods.IADs nativeMember = (UnsafeNativeMethods.IADs)_membersEnumerator.Current;

                    // If we encountered a group member corresponding to a fake principal such as
                    // NT AUTHORITY/NETWORK SERVICE, construct and prepare to return the fake principal.
                    byte[] sid = (byte[])nativeMember.Get("objectSid");
                    SidType sidType = Utils.ClassifySID(sid);
                    if (sidType == SidType.FakeObject)
                    {
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: fake principal, sid={0}", Utils.ByteArrayToString(sid));

                        _currentFakePrincipal = _storeCtx.ConstructFakePrincipalFromSID(sid);
                        _current = null;
                        _currentForeign = null;

                        if (_foreignResultSet != null)
                            _foreignResultSet.Dispose();
                        _foreignResultSet = null;
                        return true;
                    }

                    // We do this, rather than using the DirectoryEntry constructor that takes a native IADs object,
                    // is so the credentials get transferred to the new DirectoryEntry.  If we just use the native
                    // object constructor, the native object will have the right credentials, but the DirectoryEntry
                    // will have default (null) credentials, which it'll use anytime it needs to use credentials.
                    DirectoryEntry de = SDSUtils.BuildDirectoryEntry(
                                                        _storeCtx.Credentials,
                                                        _storeCtx.AuthTypes);

                    if (sidType == SidType.RealObjectFakeDomain)
                    {
                        // Transform the "WinNT://BUILTIN/foo" path to "WinNT://machineName/foo"
                        string builtinADsPath = nativeMember.ADsPath;

                        UnsafeNativeMethods.Pathname pathCracker = new UnsafeNativeMethods.Pathname();
                        UnsafeNativeMethods.IADsPathname pathName = (UnsafeNativeMethods.IADsPathname)pathCracker;

                        pathName.Set(builtinADsPath, 1 /* ADS_SETTYPE_FULL */);

                        // Build the "WinNT://" portion of the new path
                        StringBuilder adsPath = new StringBuilder();
                        adsPath.Append("WinNT://");
                        //adsPath.Append(pathName.Retrieve(9 /*ADS_FORMAT_SERVER */));

                        // Build the "WinNT://machineName/" portion of the new path
                        adsPath.Append(_storeCtx.MachineUserSuppliedName);
                        adsPath.Append("/");

                        // Build the "WinNT://machineName/foo" portion of the new path
                        int cElements = pathName.GetNumElements();

                        Debug.Assert(cElements >= 2);       // "WinNT://BUILTIN/foo" == 2 elements

                        // Note that the ADSI WinNT provider indexes them backwards, e.g., in
                        // "WinNT://BUILTIN/A/B", BUILTIN == 2, A == 1, B == 0.
                        for (int i = cElements - 2; i >= 0; i--)
                        {
                            adsPath.Append(pathName.GetElement(i));
                            adsPath.Append("/");
                        }

                        adsPath.Remove(adsPath.Length - 1, 1);  // remove the trailing "/"

                        de.Path = adsPath.ToString();

                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: fake domain: {0} --> {1}", builtinADsPath, adsPath);
                    }
                    else
                    {
                        Debug.Assert(sidType == SidType.RealObject);
                        de.Path = nativeMember.ADsPath;

                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: real domain {0}", de.Path);
                    }

                    //  Debug.Assert(Utils.AreBytesEqual(sid, (byte[]) de.Properties["objectSid"].Value));

                    if (IsLocalMember(sid))
                    {
                        // If we're processing recursively, and the member is a group,
                        // we don't return it but instead treat it as something to recursively
                        // visit (expand) later.
                        if (!_recursive || !SAMUtils.IsOfObjectClass(de, "Group"))
                        {
                            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: setting current to {0}", de.Path);

                            // Not recursive, or not a group.  Return the principal.
                            _current = de;
                            _currentFakePrincipal = null;
                            _currentForeign = null;

                            if (_foreignResultSet != null)
                                _foreignResultSet.Dispose();
                            _foreignResultSet = null;
                            return true;
                        }
                        else
                        {
                            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: adding {0} to groupsToVisit", de.Path);

                            // Save off for later, if we haven't done so already.
                            if (!_groupsVisited.Contains(de.Path) && !_groupsToVisit.Contains(de.Path))
                                _groupsToVisit.Add(de.Path);

                            needToRetry = true;
                            continue;
                        }
                    }
                    else
                    {
                        // It's a foreign principal (e..g, an AD user or group).
                        // Save it off for later.

                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: adding {0} to foreignMembers", de.Path);

                        _foreignMembers.Add(de);
                        needToRetry = true;
                        continue;
                    }
                }
                else
                {
                    // We reached the end of this group's membership.
                    // If we're supposed to be recursively expanding, we need to expand
                    // any remaining non-foreign groups we earlier visited.
                    if (_recursive)
                    {
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: recursive processing, groupsToVisit={0}", _groupsToVisit.Count);

                        if (_groupsToVisit.Count > 0)
                        {
                            // Pull off the next group to visit
                            string groupPath = _groupsToVisit[0];
                            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextLocal: recursively processing {0}", groupPath);

                            _groupsToVisit.RemoveAt(0);
                            _groupsVisited.Add(groupPath);

                            // Set up for the next round of enumeration
                            DirectoryEntry de = SDSUtils.BuildDirectoryEntry(
                                                                        groupPath,
                                                                        _storeCtx.Credentials,
                                                                        _storeCtx.AuthTypes);

                            _group = (UnsafeNativeMethods.IADsGroup)de.NativeObject;

                            UnsafeNativeMethods.IADsMembers iADsMembers = _group.Members();
                            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

                            // and go on to the first member of this new group
                            needToRetry = true;
                            continue;
                        }
                    }
                }
            }
            while (needToRetry);

            return false;
        }

        private bool MoveNextForeign()
        {
            bool needToRetry;

            do
            {
                needToRetry = false;

                GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: foreignMembers count={0}", _foreignMembers.Count);

                if (_foreignMembers.Count > 0)
                {
                    // foreignDE is a DirectoryEntry in _this_ store representing a principal in another store
                    DirectoryEntry foreignDE = _foreignMembers[0];
                    _foreignMembers.RemoveAt(0);

                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: foreignDE={0}", foreignDE.Path);

                    // foreignPrincipal is a principal from _another_ store (e.g., it's backed by an ADStoreCtx)
                    Principal foreignPrincipal = _storeCtx.ResolveCrossStoreRefToPrincipal(foreignDE);

                    // If we're not enumerating recursively, return the principal.
                    // If we are enumerating recursively, and it's a group, save it off for later.
                    if (!_recursive || !(foreignPrincipal is GroupPrincipal))
                    {
                        // Return the principal.
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: setting currentForeign to {0}", foreignDE.Path);

                        _current = null;
                        _currentFakePrincipal = null;
                        _currentForeign = foreignPrincipal;

                        if (_foreignResultSet != null)
                            _foreignResultSet.Dispose();
                        _foreignResultSet = null;
                        return true;
                    }
                    else
                    {
                        // Save off the group for recursive expansion, and go on to the next principal.
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: adding {0} to foreignGroups", foreignDE.Path);

                        _foreignGroups.Add((GroupPrincipal)foreignPrincipal);
                        needToRetry = true;
                        continue;
                    }
                }

                if (_foreignResultSet == null && _foreignGroups.Count > 0)
                {
                    GlobalDebug.WriteLineIf(GlobalDebug.Info,
                                            "SAMMembersSet",
                                            "MoveNextForeign: getting foreignResultSet (foreignGroups count={0})",
                                            _foreignGroups.Count);

                    // We're expanding recursively, and either (1) we're immediately before
                    // the recursive expansion of the first foreign group, or (2) we just completed
                    // the recursive expansion of a foreign group, and now are moving on to the next.
                    Debug.Assert(_recursive == true);

                    // Pull off a foreign group to expand.
                    GroupPrincipal foreignGroup = _foreignGroups[0];
                    _foreignGroups.RemoveAt(0);

                    // Since it's a foreign group, we don't know how to enumerate its members.  So we'll
                    // ask the group, through its StoreCtx, to do it for us.  Effectively, we'll end up acting
                    // as a proxy to the foreign group's ResultSet.
                    _foreignResultSet = foreignGroup.GetStoreCtxToUse().GetGroupMembership(foreignGroup, true);
                }

                // We're either just beginning the recursive expansion of a foreign group, or we're continuing the expansion
                // that we started on a previous call to MoveNext().
                if (_foreignResultSet != null)
                {
                    Debug.Assert(_recursive == true);

                    bool f = _foreignResultSet.MoveNext();

                    if (f)
                    {
                        // By setting current, currentFakePrincipal, and currentForeign to null,
                        // CurrentAsPrincipal/CurrentAsIdentityReference will know to proxy out to foreignResultSet.
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: using foreignResultSet");

                        _current = null;
                        _currentFakePrincipal = null;
                        _currentForeign = null;
                        return true;
                    }

                    // Ran out of members in the foreign group, is there another foreign group remaining that we need
                    // to expand?
                    if (_foreignGroups.Count > 0)
                    {
                        // Yes, there is.  Null out the foreignResultSet so we'll pull out the next foreign group
                        // the next time around the loop.
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: ran out of members, using next foreignResultSet");

                        _foreignResultSet.Dispose();
                        _foreignResultSet = null;
                        Debug.Assert(_foreignMembers.Count == 0);
                        needToRetry = true;
                    }
                    else
                    {
                        // No, there isn't.  Nothing left to do.  We set foreignResultSet to null here just
                        // to leave things in a clean state --- it shouldn't really be necessary.
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "MoveNextForeign: ran out of members, nothing more to do");

                        _foreignResultSet.Dispose();
                        _foreignResultSet = null;
                    }
                }
            }
            while (needToRetry);

            return false;
        }

        private bool IsLocalMember(byte[] sid)
        {
            // BUILTIN SIDs are local, but we can't determine that by looking at domainName
            SidType sidType = Utils.ClassifySID(sid);
            Debug.Assert(sidType != SidType.FakeObject);

            if (sidType == SidType.RealObjectFakeDomain)
            {
                GlobalDebug.WriteLineIf(GlobalDebug.Info,
                                        "SAMMembersSet",
                                        "IsLocalMember: fake domain, SID={0}",
                                        Utils.ByteArrayToString(sid));

                return true;
            }

            bool isLocal = false;

            // Ask the OS to resolve the SID to its target.
            int accountUsage = 0;
            string name;
            string domainName;

            int err = Utils.LookupSid(
                                _storeCtx.MachineUserSuppliedName,
                                _storeCtx.Credentials,
                                sid,
                                out name,
                                out domainName,
                                out accountUsage);

            if (err != 0)
            {
                GlobalDebug.WriteLineIf(GlobalDebug.Error,
                                        "SAMMembersSet",
                                        "IsLocalMember: LookupSid failed, sid={0}, server={1}, err={2}",
                                        Utils.ByteArrayToString(sid),
                                        _storeCtx.MachineUserSuppliedName,
                                        err);

                throw new PrincipalOperationException(
                            String.Format(CultureInfo.CurrentCulture,
                                          SR.SAMStoreCtxErrorEnumeratingGroup,
                                          err));
            }

            if (String.Compare(_storeCtx.MachineFlatName, domainName, StringComparison.OrdinalIgnoreCase) == 0)
                isLocal = true;

            GlobalDebug.WriteLineIf(GlobalDebug.Info,
                                    "SAMMembersSet",
                                    "IsLocalMember: sid={0}, isLocal={1}, domainName={2}",
                                    Utils.ByteArrayToString(sid),
                                    isLocal,
                                    domainName);

            return isLocal;
        }

        // Resets the enumerator to before the first result in the set.  This potentially can be an expensive
        // operation, e.g., if doing a paged search, may need to re-retrieve the first page of results.
        // As a special case, if the ResultSet is already at the very beginning, this is guaranteed to be
        // a no-op.
        override internal void Reset()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Reset");

            if (!_atBeginning)
            {
                _groupsToVisit.Clear();
                string originalGroupPath = _groupsVisited[0];
                _groupsVisited.Clear();
                _groupsVisited.Add(originalGroupPath);

                _group = _originalGroup;
                UnsafeNativeMethods.IADsMembers iADsMembers = _group.Members();
                _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

                _current = null;
                _currentFakePrincipal = null;
                _currentForeign = null;

                _foreignMembers.Clear();
                _foreignGroups.Clear();

                if (_foreignResultSet != null)
                {
                    _foreignResultSet.Dispose();
                    _foreignResultSet = null;
                }

                _atBeginning = true;
            }
        }

        override internal ResultSetBookmark BookmarkAndReset()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Bookmarking");

            SAMMembersSetBookmark bookmark = new SAMMembersSetBookmark();

            bookmark.groupsToVisit = _groupsToVisit;
            _groupsToVisit = new List<string>();

            string originalGroupPath = _groupsVisited[0];
            bookmark.groupsVisited = _groupsVisited;
            _groupsVisited = new List<string>();
            _groupsVisited.Add(originalGroupPath);

            bookmark.group = _group;
            bookmark.membersEnumerator = _membersEnumerator;
            _group = _originalGroup;
            UnsafeNativeMethods.IADsMembers iADsMembers = _group.Members();
            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

            bookmark.current = _current;
            bookmark.currentFakePrincipal = _currentFakePrincipal;
            bookmark.currentForeign = _currentForeign;
            _current = null;
            _currentFakePrincipal = null;
            _currentForeign = null;

            bookmark.foreignMembers = _foreignMembers;
            bookmark.foreignGroups = _foreignGroups;
            bookmark.foreignResultSet = _foreignResultSet;
            _foreignMembers = new List<DirectoryEntry>();
            _foreignGroups = new List<GroupPrincipal>();
            _foreignResultSet = null;

            bookmark.atBeginning = _atBeginning;
            _atBeginning = true;

            return bookmark;
        }

        override internal void RestoreBookmark(ResultSetBookmark bookmark)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Restoring from bookmark");

            Debug.Assert(bookmark is SAMMembersSetBookmark);
            SAMMembersSetBookmark samBookmark = (SAMMembersSetBookmark)bookmark;

            _groupsToVisit = samBookmark.groupsToVisit;
            _groupsVisited = samBookmark.groupsVisited;
            _group = samBookmark.group;
            _membersEnumerator = samBookmark.membersEnumerator;
            _current = samBookmark.current;
            _currentFakePrincipal = samBookmark.currentFakePrincipal;
            _currentForeign = samBookmark.currentForeign;
            _foreignMembers = samBookmark.foreignMembers;
            _foreignGroups = samBookmark.foreignGroups;

            if (_foreignResultSet != null)
                _foreignResultSet.Dispose();

            _foreignResultSet = samBookmark.foreignResultSet;
            _atBeginning = samBookmark.atBeginning;
        }

        override public void Dispose()
        {
            try
            {
                if (!_disposed)
                {
                    GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Dispose: disposing");

                    if (_foreignResultSet != null)
                    {
                        GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMMembersSet", "Dispose: disposing foreignResultSet");
                        _foreignResultSet.Dispose();
                    }

                    _disposed = true;
                }
            }
            finally
            {
                base.Dispose();
            }
        }

        //
        // Private fields
        //

        private bool _recursive;

        private bool _disposed = false;

        private SAMStoreCtx _storeCtx;
        private DirectoryEntry _ctxBase;

        private bool _atBeginning = true;

        // local

        // The 0th entry in this list is always the ADsPath of the original group whose membership we're querying
        private List<string> _groupsVisited = new List<string>();

        private List<string> _groupsToVisit = new List<string>();

        private DirectoryEntry _current = null; // current member of the group (if enumerating local group and found a real principal)
        private Principal _currentFakePrincipal = null;  // current member of the group (if enumerating local group and found a fake pricipal)

        private UnsafeNativeMethods.IADsGroup _group;            // the group whose membership we're currently enumerating over
        private UnsafeNativeMethods.IADsGroup _originalGroup;    // the group whose membership we started off with (before recursing)

        private IEnumerator _membersEnumerator;         // the current group's membership enumerator

        // foreign
        private List<DirectoryEntry> _foreignMembers = new List<DirectoryEntry>();
        private Principal _currentForeign = null; // current member of the group (if enumerating foreign principal)

        private List<GroupPrincipal> _foreignGroups = new List<GroupPrincipal>();
        private ResultSet _foreignResultSet = null; // current foreign group's ResultSet (if enumerating via proxy to foreign group)
    }

    internal class SAMMembersSetBookmark : ResultSetBookmark
    {
        public List<string> groupsToVisit;
        public List<string> groupsVisited;
        public UnsafeNativeMethods.IADsGroup group;
        public IEnumerator membersEnumerator;
        public DirectoryEntry current;
        public Principal currentFakePrincipal;
        public Principal currentForeign;
        public List<DirectoryEntry> foreignMembers;
        public List<GroupPrincipal> foreignGroups;
        public ResultSet foreignResultSet;
        public bool atBeginning;
    }
}
// #endif


text:
using System.ComponentModel.DataAnnotations;

namespace Weapsy.Web.Models.AccountViewModels
{
    public class LoginWithRecoveryCodeViewModel
    {
            [Required]
            [DataType(DataType.Text)]
            [Display(Name = "Recovery Code")]
            public string RecoveryCode { get; set; }
    }
}


text:
package ru.stqa.pft.mantis.appmanager;

import org.eclipse.jetty.websocket.api.Session;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.BrowserType;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

public class ApplicationManager {

    private final Properties properties;
    private WebDriver wd;
    private String browser;
    private RegistrationHelper registrationHelper;
    private FtpHelper ftp;
    private MailHelper mailHelper;
    private NavigationHelper navigationHelper;
    private ControlHelper controlHelper;
    private DbHelper dbHelper;
    private SoapHelper soapHelper;

    public ApplicationManager(String browser)  {
        this.browser = browser;
        properties = new Properties();
    }

    public void init() throws IOException{
        String target =System.getProperty("target","local");
        properties.load(new FileReader(new File(String.format("src/test/resources/%s.properties",target))));
    }

    public void stop() {
        if(wd!=null){
            wd.quit();
        }
    }

    public HttpSession newSession() {
        return new HttpSession(this);
    }

    public String getProperty(String key) {
        return properties.getProperty(key);
    }

    public RegistrationHelper registrarion() {
        if(registrationHelper==null){
            registrationHelper =new RegistrationHelper(this);
        }
        return registrationHelper;
    }

    public FtpHelper ftp(){
        if(ftp==null){
            ftp= new FtpHelper(this);
        }
       return ftp;
    }

    public MailHelper mail(){
        if(mailHelper==null){
            mailHelper = new MailHelper(this);
        }
        return mailHelper;
    }
    public NavigationHelper navigatiom(){
        if(navigationHelper==null){
            navigationHelper = new NavigationHelper(this);
        }
        return navigationHelper;
    }

    public ControlHelper control(){
        if(controlHelper==null){
            controlHelper = new ControlHelper(this);
        }
        return controlHelper;
    }

    public DbHelper db() {
        if(dbHelper==null){
            dbHelper = new DbHelper(this);
        }
        return dbHelper;
    }

    public SoapHelper soap(){
        if(soapHelper==null){
            soapHelper = new SoapHelper(this);
        }
        return soapHelper;
    }

    public WebDriver getDriver() {
       if(wd==null){
           if (browser.equals(BrowserType.FIREFOX)){
               wd = new FirefoxDriver(new FirefoxOptions().setLegacy(true));
           } else if (browser.equals(BrowserType.CHROME)){
               wd = new ChromeDriver();
           } else if (browser.equals(BrowserType.IE)){
               wd = new InternetExplorerDriver();
           }
           wd.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
           wd.get(properties.getProperty("web.urlBase"));
       }
       return wd;
    }

}


text:
function varargout = time_response_wfs(X,xs,src,conf)
%TIME_RESPONSE_WFS time response for WFS
%
%   Usage: [s,t] = time_response_wfs(X,xs,src,conf)
%
%   Input parameters:
%       X           - listener position / m
%       xs          - position of virtual source / m
%       src         - source type of the virtual source
%                         'pw' -plane wave
%                         'ps' - point source
%                         'fs' - focused source
%       conf        - configuration struct (see SFS_config)
%
%   Output parameters:
%       s           - simulated time response
%       t           - corresponding time axis / s
%
%   TIME_RESPONSE_WFS(X,xs,src,conf) simulates the impulse response of a the
%   source type src placed at xs and synthesized by WFS at the given virtual
%   microphone position X.
%   The length in samples of the impulse response is given by conf.N. The
%   actual calculation is done via sound_field_imp() and a loop over time t. A
%   similar result can be achieved by using ir_wfs() in combination with
%   dummy_irs().
%
%   See also: ir_wfs, sound_field_imp, freq_response_wfs, time_response_nfchoa

%*****************************************************************************
% The MIT License (MIT)                                                      *
%                                                                            *
% Copyright (c) 2010-2019 SFS Toolbox Developers                             *
%                                                                            *
% Permission is hereby granted,  free of charge,  to any person  obtaining a *
% copy of this software and associated documentation files (the "Software"), *
% to deal in the Software without  restriction, including without limitation *
% the rights  to use, copy, modify, merge,  publish, distribute, sublicense, *
% and/or  sell copies of  the Software,  and to permit  persons to whom  the *
% Software is furnished to do so, subject to the following conditions:       *
%                                                                            *
% The above copyright notice and this permission notice shall be included in *
% all copies or substantial portions of the Software.                        *
%                                                                            *
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
% IMPLIED, INCLUDING BUT  NOT LIMITED TO THE  WARRANTIES OF MERCHANTABILITY, *
% FITNESS  FOR A PARTICULAR  PURPOSE AND  NONINFRINGEMENT. IN NO EVENT SHALL *
% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
% LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT, TORT  OR OTHERWISE, ARISING *
% FROM,  OUT OF  OR IN  CONNECTION  WITH THE  SOFTWARE OR  THE USE  OR OTHER *
% DEALINGS IN THE SOFTWARE.                                                  *
%                                                                            *
% The SFS Toolbox  allows to simulate and  investigate sound field synthesis *
% methods like wave field synthesis or higher order ambisonics.              *
%                                                                            *
% https://sfs.readthedocs.io                            sfstoolbox@gmail.com *
%*****************************************************************************

%% ===== Checking of input  parameters ==================================
nargmin = 4;
nargmax = 4;
narginchk(nargmin,nargmax);
isargposition(X);
isargxs(xs);
isargchar(src);
isargstruct(conf);

%% ===== Configuration ==================================================
fs = conf.fs;
N = conf.N;
showprogress = conf.showprogress;
useplot = conf.plot.useplot;
% Select secondary source type
if strcmp('2D',conf.dimension)
    greens_function = 'ls';
else
    greens_function = 'ps';
end

%% ===== Computation ====================================================
% Disable progress bar and plotting for sound_field_imp()
conf.showprogress = false;
conf.plot.useplot = false;
% Get the position of the loudspeakers
x0 = secondary_source_positions(conf);
x0 = secondary_source_selection(x0,xs,src);
x0 = secondary_source_tapering(x0,conf);
% Generate time axis
t = (0:N-1)'/fs;
s = zeros(1,length(t));
% delay is the time offset added by the driving function
[d,~,~,delay] = driving_function_imp_wfs(x0,xs,src,conf);
for ii = 1:length(t)
    if showprogress, progress_bar(ii,length(t)); end
    % calculate sound field at the listener position
    p = sound_field_imp(X(1),X(2),X(3),x0,greens_function,d,t(ii)+delay,conf);
    s(ii) = real(p);
end

% Return parameter
if nargout>0, varargout{1}=s; end
if nargout>1, varargout{2}=t; end

%% ===== Plotting ========================================================
if nargout==0 || useplot
    figure;
    figsize(conf.plot.size(1),conf.plot.size(2),conf.plot.size_unit);
    plot(t*1000,s);
    ylabel('amplitude');
    xlabel('time / ms');
end


text:
<?xml version="1.0" encoding="utf-8"?>
<com.google.firebase.inappmessaging.display.internal.layout.FiamFrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/image_root"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:clickable="true"
    android:clipToPadding="false"
    android:focusable="true"
    android:padding="24dp">

    <FrameLayout
        android:id="@+id/image_content_root"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal">

        <com.google.firebase.inappmessaging.display.internal.ResizableImageView
            android:id="@+id/image_view"
            style="@style/FiamUI.ResizableImageView"
            android:clickable="true"
            android:focusable="true"
            android:adjustViewBounds="true"
            tools:src="@drawable/placeholder_850_850"
            tools:visibility="visible" />
    </FrameLayout>

    <Button
        android:id="@+id/collapse_button"
        style="@style/FiamUI.CollapseButton"
        android:layout_gravity="top|end" />

</com.google.firebase.inappmessaging.display.internal.layout.FiamFrameLayout>


text:
package config_finder

import (
	"fmt"
	"os"
	"strings"
)

func FindVitalsAddrs(addrs string) (map[string]string, error) {
	if addrs == "" {
		addrs = os.Getenv("VITALS_ADDRS")
	}

	if addrs == "" {
		return nil, fmt.Errorf("For now, you must either specify --vitalsAddrs or set VITALS_ADDRS")
	}

	components := strings.Split(addrs, ",")
	out := map[string]string{}
	for _, component := range components {
		subcomponents := strings.SplitN(component, ":", 2)
		out[subcomponents[0]] = subcomponents[1]
	}

	return out, nil
}


text:
$(document).ready(function(){
	mode = doCookie('nightmode');
	//alert(mode);
	if(mode==1)
		$('*').toggleClass('night-mode');
});

function uw_font_smaller(elem){
	$('.entry-content').each(function(){
		var k =  parseInt($(this).css('font-size'));
		var redSize = k*0.9 ; //here, you can give the percentage( now it is reduced to 90%)
		$(this).css('font-size',redSize);
	});
}
function uw_font_larger(elem){
	$('.entry-content').each(function(){
		var k =  parseInt($(this).css('font-size'));
		var redSize = k*1.19 ; //here, you can give the percentage( now it is reduced to 90%)
		$(this).css('font-size',redSize);
	});
}
function uw_font_reset(elem){
	$('.entry-content').css('font-size', '');
}
function uw_night_mode(elem){
	mode = doCookie('nightmode');
	if(mode==1)
		doCookie('nightmode',0);
	else
		doCookie('nightmode',1);
	$('*').toggleClass('night-mode');
}


text:
namespace v8 {
namespace internal {

TEST(ArrayList) {
  LocalContext context;
  Isolate* isolate = CcTest::i_isolate();
  HandleScope scope(isolate);
  Handle<ArrayList> array(
      ArrayList::cast(ReadOnlyRoots(isolate).empty_fixed_array()), isolate);
  CHECK_EQ(0, array->Length());
  array = ArrayList::Add(isolate, array, handle(Smi::FromInt(100), isolate));
  CHECK_EQ(1, array->Length());
  CHECK_EQ(100, Smi::ToInt(array->Get(0)));
  array = ArrayList::Add(isolate, array, handle(Smi::FromInt(200), isolate),
                         handle(Smi::FromInt(300), isolate));
  CHECK_EQ(3, array->Length());
  CHECK_EQ(100, Smi::ToInt(array->Get(0)));
  CHECK_EQ(200, Smi::ToInt(array->Get(1)));
  CHECK_EQ(300, Smi::ToInt(array->Get(2)));
  array->Set(2, Smi::FromInt(400));
  CHECK_EQ(400, Smi::ToInt(array->Get(2)));
  array->Clear(2, ReadOnlyRoots(isolate).undefined_value());
  array->SetLength(2);
  CHECK_EQ(2, array->Length());
  CHECK_EQ(100, Smi::ToInt(array->Get(0)));
  CHECK_EQ(200, Smi::ToInt(array->Get(1)));
}

}  // namespace internal
}  // namespace v8


text:
import { ILaya } from "./../../ILaya";
/**
	 * @private
	 * 对象缓存统一管理类
	 */
export class CacheManger {
    //TODO:
    /**
     * 单次清理检测允许执行的时间,单位ms。
     */
    static loopTimeLimit: number = 2;
    /**
     * @private
     */
    private static _cacheList: any[] = [];
    /**
     * @private
     * 当前检测的索引
     */
    private static _index: number = 0;

    constructor() {

    }

    /**
     * 注册cache管理函数
     * @param disposeFunction 释放函数 fun(force:Boolean)
     * @param getCacheListFunction 获取cache列表函数fun():Array
     *
     */
    static regCacheByFunction(disposeFunction: Function, getCacheListFunction: Function): void {
        CacheManger.unRegCacheByFunction(disposeFunction, getCacheListFunction);
        var cache: any;
        cache = { tryDispose: disposeFunction, getCacheList: getCacheListFunction };
        CacheManger._cacheList.push(cache);
    }

    /**
     * 移除cache管理函数
     * @param disposeFunction 释放函数 fun(force:Boolean)
     * @param getCacheListFunction 获取cache列表函数fun():Array
     *
     */
    static unRegCacheByFunction(disposeFunction: Function, getCacheListFunction: Function): void {
        var i: number, len: number;
        len = CacheManger._cacheList.length;
        for (i = 0; i < len; i++) {
            if (CacheManger._cacheList[i].tryDispose == disposeFunction && CacheManger._cacheList[i].getCacheList == getCacheListFunction) {
                CacheManger._cacheList.splice(i, 1);
                return;
            }
        }
    }

    /**
     * 强制清理所有管理器
     *
     */
    //TODO:coverage
    static forceDispose(): void {
        var i: number, len: number = CacheManger._cacheList.length;
        for (i = 0; i < len; i++) {
            CacheManger._cacheList[i].tryDispose(true);
        }
    }

    /**
     * 开始检测循环
     * @param waitTime 检测间隔时间
     *
     */
    static beginCheck(waitTime: number = 15000): void {
        ILaya.systemTimer.loop(waitTime, null, CacheManger._checkLoop);
    }

    /**
     * 停止检测循环
     *
     */
    //TODO:coverage
    static stopCheck(): void {
        ILaya.systemTimer.clear(null, CacheManger._checkLoop);
    }

    /**
     * @private
     * 检测函数
     */
    private static _checkLoop(): void {
        var cacheList: any[] = CacheManger._cacheList;
        if (cacheList.length < 1) return;
        var tTime: number = ILaya.Browser.now();
        var count: number;
        var len: number;
        len = count = cacheList.length;
        while (count > 0) {
            CacheManger._index++;
            CacheManger._index = CacheManger._index % len;
            cacheList[CacheManger._index].tryDispose(false);
            if (ILaya.Browser.now() - tTime > CacheManger.loopTimeLimit) break;
            count--;
        }
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<!-- =========================================== -->
	<!-- Project information -->
	<!-- =========================================== -->
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>edu.utah.further.ds</groupId>
		<artifactId>ds</artifactId>
		<version>1.4.2</version>
	</parent>
	<artifactId>ds-impl</artifactId>
	<packaging>bundle</packaging>
	<name>Data Source Implementation</name>
	<description>Data source Flow Implementation</description>
	<url>http://further.utah.edu</url>

	<!-- =========================================== -->
	<!-- Externalized properties -->
	<!-- =========================================== -->

	<properties>
		<shortName>impl</shortName>
		<further.osgi.export.pkg>
			!${project.groupId}.${shortName}.internal,
			${project.groupId}.${shortName}*,
			'=META-INF.ds.impl'
		</further.osgi.export.pkg>
		<further.osgi.import.pkg>
			org.hibernate,
			org.hibernate.annotations,
			org.hibernate.cfg,
			org.hibernate.proxy,
			org.hibernate.hql.ast,
			org.springframework.orm,
			org.springframework.orm.hibernate3.support,
			org.springframework.orm.hibernate3.annotation,
			org.springframework.orm.hibernate3,
			org.springframework.aop,
			org.springframework.aop.framework,
			org.springframework.aop.config,
			org.springframework.aop.aspectj.annotation,
			org.springframework.beans.factory.aspectj,
			org.springframework.beans.factory.config,
			org.springframework.aop.aspectj.autoproxy,
			org.springframework.transaction.aspectj,
			org.springframework.jdbc.support.lob,
			org.springframework.dao.support,
			org.springframework.context.weaving,
			org.springframework.oxm.jaxb,
			org.hsqldb,
			org.aopalliance.aop,
			org.aspectj.lang,
			org.aspectj.lang.reflect,
			org.aspectj.lang.annotation,
			javassist.util.proxy,
			net.sf.cglib.proxy,
			net.sf.cglib.core,
			net.sf.cglib.reflect,
			javax.xml.stream,
			javax.xml.bind,
			org.apache.xerces.parsers,
			com.mchange.v2.c3p0,
			oracle.jdbc,
			edu.utah.further.core.api.xml,
			edu.utah.further.core.api.context,
			edu.utah.further.core.api.io,
			edu.utah.further.core.util.io,
			edu.utah.further.core.metadata.to,
			edu.utah.further.core.xml.jaxb,
			edu.utah.further.core.xml.chain,
			edu.utah.further.core.xml.transform,
			edu.utah.further.core.xml.xquery,
			edu.utah.further.core.query.schema,
			edu.utah.further.core.query.domain,
			edu.utah.further.core.util.converter,
			edu.utah.further.core.ws,
			edu.utah.further.ds.api.annotation,
			edu.utah.further.ds.api.domain,
			edu.utah.further.ds.api.executor,
			edu.utah.further.ds.api.aspect,
			edu.utah.further.ds.api.advice,
			edu.utah.further.ds.api.service.query.logic,
			edu.utah.further.ds.data.domain,
			edu.utah.further.core.data.service,
			edu.utah.further.mdr.ws.impl.service.rest,
			org.jasypt.encryption.pbe;version="${jasypt.version}",
			org.jasypt.encryption.pbe.config;version="${jasypt.version}",
			org.jasypt.spring3.properties,
			'=META-INF.core.util',
			'=META-INF.core.xquery',
			edu.utah.further.security.api,
			edu.utah.further.core.api.security,
			edu.utah.further.core.api.discrete,
			*
		</further.osgi.import.pkg>
		<further.osgi.failok>true</further.osgi.failok>
	</properties>

	<dependencies>

		<!-- ########################## -->
		<!-- Compile-time -->
		<!-- ########################## -->

		<dependency>
			<groupId>edu.utah.further.ds</groupId>
			<artifactId>ds-api</artifactId>
		</dependency>

		<dependency>
			<groupId>edu.utah.further.core</groupId>
			<artifactId>core-util</artifactId>
		</dependency>

		<!-- XML utilities, for marshalling & unmarshalling -->
		<dependency>
			<groupId>edu.utah.further.core</groupId>
			<artifactId>core-xml</artifactId>
		</dependency>

		<!-- XQuery Service -->
		<dependency>
			<groupId>edu.utah.further.core</groupId>
			<artifactId>core-xquery</artifactId>
		</dependency>

		<dependency>
			<groupId>edu.utah.further.core</groupId>
			<artifactId>core-query</artifactId>
		</dependency>

		<!-- Data layer including Oracle connector and custom type libraries -->
		<dependency>
			<groupId>edu.utah.further.core</groupId>
			<artifactId>core-data-oracle</artifactId>
		</dependency>

		<!-- MDR web service API, for data source MDR resource retrieval -->
		<dependency>
			<groupId>edu.utah.further.mdr</groupId>
			<artifactId>mdr-ws-api</artifactId>
			<exclusions>
				<exclusion>
					<groupId>javax.ws.rs</groupId>
					<artifactId>jsr311-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- MDR is used to retrieve translation (and other types of) artifacts -->
		<dependency>
			<groupId>edu.utah.further.mdr</groupId>
			<artifactId>mdr-api</artifactId>
		</dependency>

		<!-- Marshalling & Unmarshalling -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-oxm</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<!-- I/O utilities -->
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons.io.version}</version>
		</dependency>

		<!-- FQE Data source API -->
		<dependency>
			<groupId>edu.utah.further.fqe</groupId>
			<artifactId>fqe-ds-api</artifactId>
		</dependency>

		<!-- Analytical Model -->
		<dependency>
			<groupId>edu.utah.further.ds</groupId>
			<artifactId>ds-further</artifactId>
		</dependency>

		<dependency>
			<groupId>edu.utah.further.ds</groupId>
			<artifactId>ds-data</artifactId>
		</dependency>

		<dependency>
			<groupId>edu.utah.further.security</groupId>
			<artifactId>security-api</artifactId>
		</dependency>

		<!-- Spring Security Libraries -->
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-core</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-expression</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- ########################## -->
		<!-- Runtime -->
		<!-- ########################## -->

		<!-- BaseX -->
		<dependency>
			<groupId>org.basex</groupId>
			<artifactId>basex</artifactId>
			<version>${basex.version}</version>
			<scope>runtime</scope>
		</dependency>

		<!-- BaseX API, includes basex-xqj dep -->
		<dependency>
			<groupId>org.basex</groupId>
			<artifactId>basex-api</artifactId>
			<version>${basex.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-nop</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.ettrema</groupId>
					<artifactId>milton-api</artifactId>
				</exclusion>
			</exclusions>
			<scope>runtime</scope>
		</dependency>

		<!-- Java Simplified Encryption -->
		<dependency>
			<groupId>org.jasypt</groupId>
			<artifactId>jasypt</artifactId>
			<version>${jasypt.version}</version>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupId>org.jasypt</groupId>
			<artifactId>jasypt-spring3</artifactId>
			<version>${jasypt.version}</version>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-math</artifactId>
			<version>${commons.math.version}</version>
			<scope>runtime</scope>
		</dependency>

		<!-- ########################## -->
		<!-- Testing -->
		<!-- ########################## -->
		<dependency>
			<groupId>edu.utah.further.security</groupId>
			<artifactId>security-impl</artifactId>
		</dependency>

		<dependency>
			<groupId>edu.utah.further.core</groupId>
			<artifactId>core-chain</artifactId>
		</dependency>

	</dependencies>

</project>


text:
/*
* <auto-generated>
*     This code was generated by a tool.
*
*     Changes to this file may cause incorrect behavior and will be lost if
*     the code is regenerated.
* </auto-generated>
*/

#import "MOZUExtendedPropertyClient.h"
#import "MOZUExtendedPropertyURLComponents.h"
#import "MozuExtendedProperty.h"

@implementation MOZUExtendedPropertyClient

//
#pragma mark -
#pragma mark Get Operations
#pragma mark -
//

+ (MOZUClient *)clientForGetExtendedPropertiesOperation {
	id url = [MOZUExtendedPropertyURLComponents URLComponentsForGetExtendedPropertiesOperation];
	id verb = @"GET";
	MOZUClient *client = [[MOZUClient alloc] initWithResourceURLComponents:url verb:verb];

	client.JSONParser = ^id(NSString *jsonResult) {
		NSArray *jsonAsArray = [NSJSONSerialization JSONObjectWithData:[jsonResult dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil];
		return [MOZUExtendedProperty arrayOfModelsFromDictionaries:jsonAsArray error:nil];
	};

	return client;
}

//
#pragma mark -
#pragma mark Post Operations
#pragma mark -
//

+ (MOZUClient *)clientForAddExtendedPropertiesOperationWithBody:(NSArray<MOZUExtendedProperty> *)body {
	id url = [MOZUExtendedPropertyURLComponents URLComponentsForAddExtendedPropertiesOperation];
	id verb = @"POST";
	MOZUClient *client = [[MOZUClient alloc] initWithResourceURLComponents:url verb:verb];

	client.body = body;

	client.JSONParser = ^id(NSString *jsonResult) {
		NSArray *jsonAsArray = [NSJSONSerialization JSONObjectWithData:[jsonResult dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil];
		return [MOZUExtendedProperty arrayOfModelsFromDictionaries:jsonAsArray error:nil];
	};

	return client;
}

//
#pragma mark -
#pragma mark Put Operations
#pragma mark -
//

+ (MOZUClient *)clientForUpdateExtendedPropertyOperationWithBody:(MOZUExtendedProperty *)body key:(NSString *)key upsert:(NSNumber *)upsert responseFields:(NSString *)responseFields {
	id url = [MOZUExtendedPropertyURLComponents URLComponentsForUpdateExtendedPropertyOperationWithKey:key upsert:upsert responseFields:responseFields];
	id verb = @"PUT";
	MOZUClient *client = [[MOZUClient alloc] initWithResourceURLComponents:url verb:verb];

	client.body = body;

	client.JSONParser = ^id(NSString *jsonResult) {
		return [[MOZUExtendedProperty alloc] initWithString:jsonResult error:nil];
	};

	return client;
}

+ (MOZUClient *)clientForUpdateExtendedPropertiesOperationWithBody:(NSArray<MOZUExtendedProperty> *)body upsert:(NSNumber *)upsert {
	id url = [MOZUExtendedPropertyURLComponents URLComponentsForUpdateExtendedPropertiesOperationWithUpsert:upsert];
	id verb = @"PUT";
	MOZUClient *client = [[MOZUClient alloc] initWithResourceURLComponents:url verb:verb];

	client.body = body;

	client.JSONParser = ^id(NSString *jsonResult) {
		NSArray *jsonAsArray = [NSJSONSerialization JSONObjectWithData:[jsonResult dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil];
		return [MOZUExtendedProperty arrayOfModelsFromDictionaries:jsonAsArray error:nil];
	};

	return client;
}

//
#pragma mark -
#pragma mark Delete Operations
#pragma mark -
//

+ (MOZUClient *)clientForDeleteExtendedPropertiesOperationWithBody:(NSArray *)body {
	id url = [MOZUExtendedPropertyURLComponents URLComponentsForDeleteExtendedPropertiesOperation];
	id verb = @"DELETE";
	MOZUClient *client = [[MOZUClient alloc] initWithResourceURLComponents:url verb:verb];

	client.body = body;
	return client;
}

+ (MOZUClient *)clientForDeleteExtendedPropertyOperationWithKey:(NSString *)key {
	id url = [MOZUExtendedPropertyURLComponents URLComponentsForDeleteExtendedPropertyOperationWithKey:key];
	id verb = @"DELETE";
	MOZUClient *client = [[MOZUClient alloc] initWithResourceURLComponents:url verb:verb];

	return client;
}

@end


text:
<?php
namespace MichaelDrennen\DebugHelper;

use League\CLImate\CLImate;

/**
 * Class DebugHelper
 * @package MichaelDrennen\DebugHelper
 */
class DebugHelper {

    /**
     * @param array $queryLog     A Laravel query log variable is a numerically indexed array of the queries that have been executed since
     *                            you enabled the DB query log with DB::enableQueryLog(). A line from a Laravel query log is an associative
     *                            array with three elements:
     *                            - query
     *                            - bindings
     *                            - time
     *                            This method prints out the query log in a CLImate table.
     * @param bool  $returnString Do you want to return the CLImate table as a string?
     *
     * @link http://climate.thephpleague.com/
     */
    public static function laravelPrintQueryLog ( array $queryLog, bool $returnString = false ) {

        $climate = new CLImate();

        $arrayForPrinting = self::laravelGetArrayForPrinting( $queryLog );

        /**
         * @link http://climate.thephpleague.com/terminal-objects/table/
         */
        if ( $returnString ):
            return $climate->to( 'buffer' )->table( $arrayForPrinting )->output->get( 'buffer' )->get();
        endif;
        $climate->table( $arrayForPrinting );
    }

    /**
     * A wrapper method around my 'getters' that accepts the Laravel query log array, and returns an associative array that is meant to be
     * passed direction into the CLImate table() function.
     *
     * @param array $queryLog A Laravel query log array.
     *
     * @return array An associative array meant to be passed to the CLImate table() function.
     * @link http://climate.thephpleague.com/terminal-objects/table/
     */
    protected static function laravelGetArrayForPrinting ( array $queryLog ): array {

        $arrayForPrinting = [];
        foreach ( $queryLog as $i => $log ):
            $arrayForPrinting[] = ['query' => self::laravelGetExecutableQueryFromLog( $log ),
                                   'time'  => self::laravelGetTimeFromLog( $log ),];

        endforeach;

        return $arrayForPrinting;
    }

    /**
     * A 'getter' method that accepts a line from the Laravel query log array, and returns the executed query from that line.
     * This method does a very basic string replace of the query values for the ? placeholders in the query string.
     * @todo This method could benefit from a more robust approach to the query binding substituion.
     *
     * @param array $log A line from a Laravel query log.
     *
     * @return string The executed query from that log line with the query bindings substituted in for the ? placeholders.
     */
    protected static function laravelGetExecutableQueryFromLog ( array $log ): string {

        $log['query'] = str_replace( '"', '', $log['query'] );
        foreach ( $log['bindings'] as $i => $binding ):
            $numReplacementsToPerform = 1;
            $log['query']             = preg_replace( '/\?/', "'" . (string) $binding . "'", $log['query'], $numReplacementsToPerform );
        endforeach;

        return $log['query'];
    }

    /**
     * A 'getter' method that accepts a line from the Laravel query log array, and returns the execution time of that query.
     *
     * @param array $log A line from a Laravel query log.
     *
     * @return float The execution time of the query as a float.
     */
    protected static function laravelGetTimeFromLog ( array $log ): float {

        return (float) $log['time'];
    }
}


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

namespace ToString
{
    class Program
    {
        static void Main()
        {
            GSM gsm = new GSM("Lumia", "Nokia");

            Console.WriteLine(gsm.ToString());
        }
    }
}


text:
#include "rtabmap/utilite/UThread.h"
#include "rtabmap/utilite/ULogger.h"
#ifdef __APPLE__
#include <mach/thread_policy.h>
#include <mach/mach.h>
#endif

#define PRINT_DEBUG 0

////////////////////////////
// public:
////////////////////////////

UThread::UThread(Priority priority) :
    state_(kSIdle),
    priority_(priority),
    handle_(0),
    threadId_(0),
    cpuAffinity_(-1)
{}

UThread::~UThread()
{
#if PRINT_DEBUG
	ULOGGER_DEBUG("");
#endif
}

void UThread::kill()
{
#if PRINT_DEBUG
	ULOGGER_DEBUG("");
#endif
    killSafelyMutex_.lock();
    {
    	if(this->isRunning())
    	{
    		// Thread is creating
    		while(state_ == kSCreating)
			{
				uSleep(1);
			}

			if(state_ == kSRunning)
			{
				state_ = kSKilled;

				// Call function to do something before wait
				mainLoopKill();
			}
			else
			{
				UERROR("thread (%d) is supposed to be running...", threadId_);
			}
    	}
    	else
    	{
#if PRINT_DEBUG
    		UDEBUG("thread (%d) is not running...", threadId_);
#endif
    	}
    }
    killSafelyMutex_.unlock();
}

void UThread::join(bool killFirst)
{
	//make sure the thread is created
	while(this->isCreating())
	{
		uSleep(1);
	}

#ifdef _WIN32
#if PRINT_DEBUG
	UDEBUG("Thread %d joining %d", UThreadC<void>::Self(), threadId_);
#endif
	if(UThreadC<void>::Self() == threadId_)
#else
#if PRINT_DEBUG
	UDEBUG("Thread %d joining %d", UThreadC<void>::Self(), handle_);
#endif
	if(UThreadC<void>::Self() == handle_)
#endif
	{
		UERROR("Thread cannot join itself");
		return;
	}

	if(killFirst)
	{
		this->kill();
	}

	runningMutex_.lock();
	runningMutex_.unlock();

#if PRINT_DEBUG
	UDEBUG("Join ended for %d", UThreadC<void>::Self());
#endif
}

void UThread::start()
{
#if PRINT_DEBUG
	ULOGGER_DEBUG("");
#endif

    if(state_ == kSIdle || state_ == kSKilled)
    {
    	if(state_ == kSKilled)
    	{
			// make sure it is finished
			runningMutex_.lock();
			runningMutex_.unlock();
    	}

        state_ = kSCreating;
        int r = UThreadC<void>::Create(threadId_, &handle_, true); // Create detached
        if(r)
        {
        	UERROR("Failed to create a thread! errno=%d", r);
        	threadId_=0;
        	handle_=0;
        	state_ = kSIdle;
        }
        else
        {
#if PRINT_DEBUG
        ULOGGER_DEBUG("StateThread::startThread() thread id=%d _handle=%d", threadId_, handle_);
#endif
        }
    }
}

//TODO : Support pThread
void UThread::setPriority(Priority priority)
{
	priority_ = priority;
}

//TODO : Support pThread
void UThread::applyPriority()
{
    if(handle_)
    {
#ifdef _WIN32
        int p = THREAD_PRIORITY_NORMAL;
        switch(priority_)
        {
            case kPLow:
                p = THREAD_PRIORITY_LOWEST;
                break;

            case kPBelowNormal:
                p = THREAD_PRIORITY_BELOW_NORMAL;
                break;

            case kPNormal:
                p = THREAD_PRIORITY_NORMAL;
                break;

            case kPAboveNormal:
                p = THREAD_PRIORITY_ABOVE_NORMAL;
                break;

            case kPRealTime:
                p = THREAD_PRIORITY_TIME_CRITICAL;
                break;

            default:
                break;
        }
        SetThreadPriority(handle_, p);
#endif
    }
}

void UThread::setAffinity(int cpu)
{
	cpuAffinity_ = cpu;
	if(cpuAffinity_<0)
	{
		cpuAffinity_ = 0;
	}
}

//TODO : Support Windows and linux
void UThread::applyAffinity()
{
	if(cpuAffinity_>0)
	{
#ifdef _WIN32
#elif __APPLE__
		thread_affinity_policy_data_t affPolicy;
		affPolicy.affinity_tag = cpuAffinity_;
		kern_return_t ret = thread_policy_set(
				mach_thread_self(),
				THREAD_AFFINITY_POLICY,
				(integer_t*) &affPolicy,
				THREAD_AFFINITY_POLICY_COUNT);
		if(ret != KERN_SUCCESS)
		{
			UERROR("thread_policy_set returned %d", ret);
		}
#else
		/*unsigned long mask = cpuAffinity_;

		if (pthread_setaffinity_np(
			pthread_self(),
			sizeof(mask),
			&mask) <0)
		{
			UERROR("pthread_setaffinity_np failed");
		}
		}*/
#endif
	}
}

bool UThread::isCreating() const
{
    return state_ == kSCreating;
}

bool UThread::isRunning() const
{
    return state_ == kSRunning || state_ == kSCreating;
}

bool UThread::isIdle() const
{
    return state_ == kSIdle;
}

bool UThread::isKilled() const
{
    return state_ == kSKilled;
}

////////////////////////////
// private:
////////////////////////////

void UThread::ThreadMain()
{
	runningMutex_.lock();
	applyPriority();
	applyAffinity();

#if PRINT_DEBUG
	ULOGGER_DEBUG("before mainLoopBegin()");
#endif

	state_ = kSRunning;
    mainLoopBegin();

#if PRINT_DEBUG
	ULOGGER_DEBUG("before mainLoop()");
#endif

	while(state_ == kSRunning)
	{
		mainLoop();
	}

#if PRINT_DEBUG
	ULOGGER_DEBUG("before mainLoopEnd()");
#endif

	mainLoopEnd();

    handle_ = 0;
    threadId_ = 0;
    state_ = kSIdle;

    runningMutex_.unlock();
#if PRINT_DEBUG
	ULOGGER_DEBUG("Exiting thread loop");
#endif
}


text:
#ifndef JNISETUP_H
#define JNISETUP_H

struct JNIEnv_;
typedef JNIEnv_ JNIEnv;

class _jobject;
typedef _jobject *jobject;

struct JavaVM_;
typedef JavaVM_ JavaVM;

typedef int jint;

class Settings;

/**
 * @brief Try to create and initialize a new JVM based on the settings passed in.
 * The settings are passed into the JVM as command line arguments.
 * The function also creates a factory for instantiating new HandlerProxies with
 * all dependencies satisfied.
 * If a JVM already exists then this function will fail.
 *
 * @param jvm Java VM that will be created and setup
 * @param options Settings for the Java VM (will be passed into the command line)
 * @param factory Factory that creates the HandlerProxy class (will be created)
 *
 * @return Was initialization successful?
 */
bool try_initialize_jvm(JavaVM** jvm, const Settings& options, jobject* factory);

/**
 * @brief Attach current thread to the JVM. Assign current environment to env. Keeps
 * track of how often the current thread has attached, and will not detach
 * until the number of calls to detach is the same as the number of calls to
 * attach.  If attach fails, does its best to log the error and aborts.  Not
 * being able to attach to the JNI is an unrecoverable error.
 *
 * @param jvm Java VM
 * @param env Java environment to attach the thread
 * @param location Who is calling the function
 */
void attach_thread(JavaVM *jvm, JNIEnv** env, const char* location = "unknown");

/**
 * @brief Detach thread from JVM. Will not detach unless the number of calls to
 * detach is the same as the number of calls to attach.
 *
 * @param jvm Java VM
 *
 * @return JNI_OK if successful, or a negative number on failure.
 */
jint detach_thread(JavaVM *jvm);

#endif


text:
pubsubsuperfeedr
================

A simple library designed to make it easy to add and remove feeds from
Superfeedr's PubSubHubbub API.  Includes support for hub.secret.

Credits
-------

Developed and used at `Urban Airship <http://urbanairship.com/>`_ and
released under the MIT License.

`Harper Reed's gae-superfeedr-shell
<http://github.com/harperreed/gae-superfeedr-shell/>`_ provided inspiration
for part of this code. Thanks Harper!

Example Usage
-------------

Setting up pubsubsuperfeedr:

    >>> import pubsubsuperfeedr
    >>> sf = pubsubsuperfeedr.Superfeedr(settings.SUPERFEEDR_USERNAME, settings.SUPERFEEDR_PASSWORD)

Validating a feed to make sure that it has at least one readable entry:

    >>> sf.verify_feed_url("http://blog.urbanairship.com/feed/")
    True

Note that this is just a really simple wrapper around feedparser and sometimes
feedparser can read things that Superfeedr can't.

Adding a feed:

    >>> sf.add_feed("http://blog.urbanairship.com/feed/", "http://example.com/your_callback_url", "some_verify_token", "some_secret")

add_feed expects the feed you're wanting to watch, then the callback URL, and
optionally a verify token and feed secret.

Removing a feed:

    >>> sf.remove_feed("http://blog.urbanairship.com/feed/", "http://example.com/your_callback_url", "some_secret")

Removing a feed is basically the same as adding a feed.

Verifying a secret (in Django):

    >>> sf.verify_secret("some_secret", request.raw_post_data, request.META.get("HTTP_X_HUB_SIGNATURE", ""))
    True

Testing
-------

To run the tests, first make sure that `nose
<http://code.google.com/p/python-nose/>`_ and
`mox <http://code.google.com/p/pymox/>`_ are installed. Then:

    $ nosetests

And you're off an running.


text:
from flask import Flask,json,make_response
app=Flask(__name__)

users=['Linda','Marion5','Race8']

@app.route('/')
def v_index():
	#response对象返回:
    rsp=make_response(json.dumps(users))
    rsp.mimetype='application/json'
    rsp.charset='utf-8'
    rsp.status_code=200
    rsp.headers['x-tag']='str,magic'
    return rsp

	#直接返回:
	# return json.dumps(users),200,[('Content-type','application/json;charset=utf-8')]

if __name__ == '__main__':
	app.run()


text:
#ifndef EXCEPTIONS_CSE473_H
#define EXCEPTIONS_CSE473_H

#include "StandardFiles.h"

/*============================================================================//
    Exceptions.h: header file for Exception<int> UDT

    Purpose is to allow user to quickly define new exceptions within a
     hierarchy, with some built-in functionality (e.g.; GetError()).
     Exception<> is located within the Exc:: namespace.

    Implementation: Shane J. Neph, June 2004, University of Washington
//============================================================================*/

namespace Exc {

// Forward Declarations
template <int ID>
struct Exception;

// Explicit Specializations
template <>
struct Exception<0> {
    Exception() : info_("Unknown Exception") { /* */ }
    explicit Exception(const std::string info) : info_(info) { /* */ }
    Exception(const std::string& info1, const std::string& info2)
        : info_(info1 + "\n" + info2) { /* */ }

    std::string GetMessage() const { return(info_); }

private:
    std::string info_;
};

// Typedefs
typedef Exception<0> BaseException;

// Definitions
template <int ID>
struct Exception : BaseException {
    Exception() : BaseException("Unknown Exception") { /* */ }
    explicit Exception(const std::string info) : BaseException(info) { /* */ }
    Exception(const std::string& info1, const std::string& info2)
        : BaseException(info1, info2) { /* */ }
};

} // namespace Exc

#endif // EXCEPTIONS_CSE473_H


text:
namespace BitFunnel
{
    namespace SimpleHashPolicy
    {
        //*********************************************************************
        //
        // The Threadsafe policy configures the SimpleHashTable template to
        // perform threadsafe find and update operations. Note that the
        // Threadsafe policy does not support hash table resizing. Also note
        // the Threadsafe policy is less performant than the SingleThreaded
        // policy.
        //
        //*********************************************************************
        class Threadsafe
        {
        public:
            // Constructs a Threadsafe policy. Since Threadsafe does not
            // hash table resizing, the allowResize parameter must be set to
            // false. A value of true will result in an exception throw from
            // the constructor.
            Threadsafe(bool allowResize);

            // Uses interlocked compare exchange to atomically update a key in
            // a hash table slot from an existing expected value to a new desired
            // value if the value of the existing key is not changed before the
            // update operation performs. Returns false if slot of the key is
            // already updated.
            bool UpdateKeyIfUnchanged(volatile uint64_t* keys,
                                      size_t slot,
                                      uint64_t expectedCurrentKey,
                                      uint64_t desiredKey);

            // Returns true if this instance allows hash table resizing. Since
            // the Threadsafe policy does not allow hash table resizing, this
            // method will always return false.
            bool AllowsResize() const;

        private:
            bool m_allowsResize;
        };

        //*********************************************************************
        //
        // The SingleThreaded policy configures the SimpleHashTable template to
        // perform single threaded find and update operations. This policy does
        // support hash table resizing. Note that SingleThreaded is more
        // performant than ThreadSafe.
        //
        //*********************************************************************
        class SingleThreaded
        {
        public:
            // Constructs a SingleThreaded policy. The allowResize parameter
            // configures the hash table's resize policy.
            SingleThreaded(bool allowResize);

            // Non-atomic method to update a key from an existing value to a
            // desired new value in a hash table slot. Returns true if the key
            // was successfully written. Returns false if the slot doesn't have
            // the expected existing key.
            bool UpdateKeyIfUnchanged(volatile uint64_t* keys,
                                      size_t slot,
                                      uint64_t expectedCurrentKey,
                                      uint64_t desiredKey);

            // Returns true if the hash table is configured to allow resizing.
            bool AllowsResize() const;

        private:
            bool m_allowsResize;
        };
    }
}


text:
using System.Collections.Generic;
using Azure.Core;

namespace Azure.ResourceManager.ProviderHub.Models
{
    /// <summary> The ExtendedErrorInfo. </summary>
    public partial class ExtendedErrorInfo
    {
        /// <summary> Initializes a new instance of ExtendedErrorInfo. </summary>
        public ExtendedErrorInfo()
        {
            Details = new ChangeTrackingList<ExtendedErrorInfo>();
            AdditionalInfo = new ChangeTrackingList<TypedErrorInfo>();
        }

        /// <summary> Initializes a new instance of ExtendedErrorInfo. </summary>
        /// <param name="code"></param>
        /// <param name="target"></param>
        /// <param name="message"></param>
        /// <param name="details"></param>
        /// <param name="additionalInfo"></param>
        internal ExtendedErrorInfo(string code, string target, string message, IList<ExtendedErrorInfo> details, IList<TypedErrorInfo> additionalInfo)
        {
            Code = code;
            Target = target;
            Message = message;
            Details = details;
            AdditionalInfo = additionalInfo;
        }

        /// <summary> Gets or sets the code. </summary>
        public string Code { get; set; }
        /// <summary> Gets or sets the target. </summary>
        public string Target { get; set; }
        /// <summary> Gets or sets the message. </summary>
        public string Message { get; set; }
        /// <summary> Gets the details. </summary>
        public IList<ExtendedErrorInfo> Details { get; }
        /// <summary> Gets the additional info. </summary>
        public IList<TypedErrorInfo> AdditionalInfo { get; }
    }
}


text:
function TraceFilter(data, options) {
  this.data = data;
  this.options = options;
}

TraceFilter.prototype.filter = function() {
  var output = {traceEvents: []};
  for (var i = 0; i < this.data.traceEvents.length; i++) {
    var name = this.data.traceEvents[i].name;
    var cats = this.data.traceEvents[i].cat.split(',');
    var whitelisted = false;
    for (var j = 0; j < cats.length; j++)
      if (this.options.traceCategories.indexOf(cats[j]) !== -1)
        whitelisted = true;
    if ((this.options.traceEvents.indexOf(name) !== -1) || whitelisted) {
      output.traceEvents.push(this.data.traceEvents[i]);
    }
  }
  return output;
}

/*
{"name":"Document::updateRenderTree","tts":160519,"args":{},"pid":34835,"ts":41621046290,"cat":"blink","tid":1299,"ph":"B"},
{"tdur":672,"name":"Document::updateStyle","tts":160524,"args":{},"pid":34835,"ts":41621046306,"cat":"blink","tid":1299,"ph":"X","dur":739}
{"name":"Document::updateRenderTree","tts":161198,"args":{"elementCount":122},"pid":34835,"ts":41621047046,"cat":"blink","tid":1299,"ph":"E"}

name                       tts          dur  tdur  ts                       ph
Document::updateRenderTree 160519                  41621046290 ( 919)       B
Document::updateStyle      160524       739  672   41621046306 ( 935)       X
Document::updateRenderTree 161198 +679             41621047046 (1675) +756  E

dur = wall duration (us)
tdur = CPU duration (us)
ts = start (us from .. something)

if (159788 == 0) then 160519 == 731
if (41621045371 == 0) then 41621046290 == 919

*/
module.exports = TraceFilter;
module.exports.defaults = {
  traceEvents: ["HTMLDocumentParser::processParsedChunkFromBackgroundParser", "Document::updateRenderTree", "Document::updateStyle", "FrameView::layout"],
  traceCategories: []
};


text:
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

describe "Singleton.instance" do
  it "returns an instance of the singleton class" do
    SingletonSpecs::MyClass.instance.should be_kind_of(SingletonSpecs::MyClass)
  end

  it "returns the same instance for multiple calls to instance" do
    SingletonSpecs::MyClass.instance.should equal(SingletonSpecs::MyClass.instance)
  end

  it "returns an instance of the singleton's subclasses" do
    SingletonSpecs::MyClassChild.instance.should be_kind_of(SingletonSpecs::MyClassChild)
  end

  it "returns the same instance for multiple class to instance on subclasses" do
    SingletonSpecs::MyClassChild.instance.should equal(SingletonSpecs::MyClassChild.instance)
  end

  it "returns an instance of the singleton's clone" do
    klone = SingletonSpecs::MyClassChild.clone
    klone.instance.should be_kind_of(klone)
  end

  it "returns the same instance for multiple class to instance on clones" do
    klone = SingletonSpecs::MyClassChild.clone
    klone.instance.should equal(klone.instance)
  end
end


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/hwpf/hwp/utility_procedures/proc_cpu_special_wakeup.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2014                             */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
// $Id: proc_cpu_special_wakeup.H,v 1.8 2012/08/21 11:39:37 pchatnah Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_cpu_special_wakeup.H,v $
//------------------------------------------------------------------------------
// *|
// *! (C) Copyright International Business Machines Corp. 2011
// *! All Rights Reserved -- Property of IBM
// *! ***  ***
// *|
// *! TITLE       : proc_cpu_special_wakeup.H
// *! DESCRIPTION : Set the EX chiplet into Special Wake-up via one of the
// *!               entity bits provided
// *!
// *! OWNER NAME  : Greg Still    Email: stillgs@us.ibm.com
// *! BACKUP NAME : Pradeep CN    Email: padeepcn@in.ibm.com
// *!
//------------------------------------------------------------------------------

#ifndef _PROC_CPUSPECWKUP_H_
#define _PROC_CPUSPECWKUP_H_

//------------------------------------------------------------------------------
// Constant definitions
//------------------------------------------------------------------------------

#ifndef _PROC_SPCWKUP_ENTITY
#define _PROC_SPCWKUP_ENTITY
enum PROC_SPCWKUP_ENTITY
{
    HOST   = 0X1,
    FSP    = 0x2,
    OCC    = 0x3,
    PHYP   = HOST

};

enum PROC_SPCWKUP_OPS
{
    SPCWKUP_ENABLE   = 0x1,
    SPCWKUP_DISABLE  = 0x2
};

#endif  // _PROC_SPCWKUP_TGTS

//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------

// function pointer typedef definition for HWP call support
typedef fapi::ReturnCode (*proc_cpu_special_wakeup_FP_t) (const fapi::Target&, PROC_SPCWKUP_OPS , PROC_SPCWKUP_ENTITY  );

extern "C" {

//------------------------------------------------------------------------------
// Parameter structure definitions
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Function prototype
//------------------------------------------------------------------------------
/// \param[in] i_target EX target
/// \param[in] i_entity   Entity bit to use (OCC, PHYP, FSP)
/// \param[in] i_operation   operation to use (SPCWKUP_ENABLE, SPCWKUP_DISABLE)

/// \retval ECMD_SUCCESS if something good happens,
/// \retval BAD_RETURN_CODE otherwise
fapi::ReturnCode
proc_cpu_special_wakeup(const fapi::Target& i_target, PROC_SPCWKUP_OPS i_operation , PROC_SPCWKUP_ENTITY i_entity );

} // extern "C"

#endif // _PROC_CPUSPECWKUP_H_


text:
package main

import (
	"github.com/reddec/gopack/pack"
	"log"
	"flag"
	"path"
)

func main() {
	dir := flag.String("d", ".", "Directory with package.json")
	create := flag.Bool("c", false, "Create package instead of build")
	service := flag.Bool("s", false, "Create a service stub (for -c)")
	output := flag.String("o", ".", "Output directory")
	flag.Parse()

	if *create && flag.NArg() == 0 {
		panic("Requires package name")
	}

	if *create {
		if *service {
			pack.SaveNewService(*dir, flag.Arg(0))
		}else {
			pack.SaveNewApp(*dir, flag.Arg(0))
		}
		return
	}

	log.Println("Building")
	p, err := pack.ReadPackage(path.Join(*dir, pack.ProjectPackageFile))
	if err != nil {
		panic(err)
	}
	err = p.Make(*output)
	if err != nil {
		panic(err)
	}
	log.Println("Done")
}