text:
using jQueryApi;
using jQueryApi.UI.Widgets;
using KnockoutApi;
using System;

namespace SparkleXrm.CustomBinding
{
    public class ProgressBarBinding : BindingHandler
    {
        static ProgressBarBinding()
        {
            if ((string)Script.Literal("typeof(ko)") != "undefined")
            {
                Knockout.BindingHandlers["progressBar"] = new ProgressBarBinding();
            }

        }

        public override void Init(System.Html.Element element, Func<object> valueAccessor, Func<System.Collections.Dictionary> allBindingsAccessor, object viewModel, object context)
        {

            jQuery.FromElement(element).Plugin<ProgressBarObject>().ProgressBar();
        }

        public override void Update(System.Html.Element element, Func<object> valueAccessor, Func<System.Collections.Dictionary> allBindingsAccessor, object viewModel, object context)
        {
            Observable<float> observable = (Observable<float>)valueAccessor();
            float value = KnockoutUtils.UnwrapObservable(observable);
            jQuery.FromElement(element).Plugin<ProgressBarObject>().ProgressBar(ProgressBarMethod.Value, value);

        }
    }
}


text:
"""
@file plot_caffe_ensemble_logloss.py
@brief plot caffe ensemble logloss (single vs ensemble)
@author ChenglongChen
"""

import sys
import numpy as np
from matplotlib import pyplot as plt

def main():

    # collect argvs
    log_file_single = sys.argv[1]
    log_file_ensemble = sys.argv[2]

    if len(sys.argv) > 3:
        pdf_file = sys.argv[3]
    else:
        pdf_file = sys.argv[1].split("caffemodel")[0] + "caffemodel_valid_logloss.pdf"

    lines_single = open(log_file_single, "r").readlines()
    logloss_single = [float(l[:-4]) for l in lines_single[1::2]]
    logloss_single_mean = np.mean(logloss_single)
    logloss_single_std = np.std(logloss_single)

    lines_ensemble = open(log_file_ensemble, "r").readlines()
    logloss_ensemble = [float(l[:-4]) for l in lines_ensemble[1::2]]
    logloss_ensemble_min = np.min(logloss_ensemble)

    # logloss
    plt.plot(range(len(logloss_single)), logloss_single)
    plt.plot(range(len(logloss_ensemble)), logloss_ensemble)
    plt.plot(range(len(logloss_ensemble)), logloss_ensemble_min * np.ones((len(logloss_ensemble))))
    plt.title("LogLoss vs Number of predictions")
    plt.xlabel("Number of predictions")
    plt.ylabel("LogLoss")
    ls = "Single (Mean = %s, Std = %s)" % (np.round(logloss_single_mean,5), np.round(logloss_single_std,5))
    le = "Ensemble (Min = %s)" % np.round(logloss_ensemble_min,5)
    plt.legend([ls, le], loc="best")

    plt.savefig(pdf_file)
    print( "Save pdf figure to %s" % pdf_file )

if __name__ == "__main__":
    main()

redpajama_set_name: RedPajamaGithub


text:
package org.teamstbf.yats.logic.parser;

import java.io.File;

import org.teamstbf.yats.logic.commands.ChangeSaveLocationCommand;
import org.teamstbf.yats.logic.commands.Command;
import org.teamstbf.yats.logic.commands.IncorrectCommand;

// @@author A0139448U
public class ChangeSaveLocationCommandParser {

    public static final String INPUT_DEFAULT = "default";
    public static final String INVALID_SAVE_LOCATION = "Invalid save location.";
    public static final String NO_LOCATION_SPECIFIED = "Please specify a save location";

    /**
     * Parses the given {@code String} of arguments in the context of the
     * ChangeSaveLocationCommand and returns an ChangeSaveLocationCommand object
     * for execution.
     */
    public Command parse(String arguments) {
        assert arguments != null;

        arguments = arguments.trim();

        if (arguments.equals("")) {
            return new IncorrectCommand(NO_LOCATION_SPECIFIED);
        }

        if (arguments.equals(INPUT_DEFAULT)) { // Convenient for users to change
                                               // to default save location
            return new ChangeSaveLocationCommand(new File("data/YATS.xml"));
        }

        File saveLocation = new File(arguments.trim());

        if (!saveLocation.exists()) {
            return new IncorrectCommand(INVALID_SAVE_LOCATION);
        } else {
            if (!arguments.endsWith("/")) {
                arguments += "/";
            }
            File newSaveLocation = new File(arguments + "YATS.xml");
            return new ChangeSaveLocationCommand(newSaveLocation);
        }

    }

}


text:
package org.tinymediamanager.scraper.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.Properties;
import java.util.jar.Attributes;
import java.util.jar.Manifest;

public class JarUtils {

  /**
   * gets manifest from JAR containing 'class'

   * If found as 'file://' try to get from execution root

   * returns null if not found.
   *
   * @param c
   *          the class file
   * @return value of manifest entry
   */
  @SuppressWarnings("rawtypes")
  public static Manifest getManifest(Class c) {
    Manifest mf = null;
    try {
      String classname = "/" + c.getName().replaceAll("\\.", "/") + ".class";
      URL jarURL = c.getResource(classname);
      if (jarURL.getProtocol().equals("jar")) {
        JarURLConnection jurlConn = (JarURLConnection) jarURL.openConnection();
        mf = jurlConn.getManifest();
      }
      else if (jarURL.getProtocol().equals("file")) {
        // started from within eclipse or somehow as exploded
        // DO NOT get from classpath as we get the manifest of the first loaded JAR

        // base path is the filesystem root of the "classpath" (classes | test-classes)
        String basepath = jarURL.getPath().substring(0, jarURL.getPath().indexOf(classname));

        // assume there is already some generated manifest on filesystem
        InputStream is = new FileInputStream(basepath + "/META-INF/MANIFEST.MF");

        if (is != null) {
          mf = new Manifest(is);
        }
      }
    }
    catch (Exception e) {
      // do nothing
      mf = null;
    }
    return mf;
  }

  /**
   *
   * gets specified manifest entry from JAR containing 'class'
   *
   * @param c
   *          the class file
   * @param entry
   *          the menifest entry
   * @return value of manifest entry
   */
  @SuppressWarnings("rawtypes")
  public static String getManifestEntry(Class c, String entry) {
    String s = "";
    try {
      Manifest mf = getManifest(c);
      if (mf != null) {
        Attributes attr = mf.getMainAttributes();
        s = attr.getValue(entry);
      }
      else {
        // no jar/manifest found, but since it's a version call, try maven props
        if (Attributes.Name.IMPLEMENTATION_VERSION.toString().equals(entry)) {
          s = getVersionFromProject(c);
        }
      }
    }
    catch (Exception e) {
      // NPE if no manifest found
    }
    return s;
  }

  /**
   * tries to read version out of a built maven project
   *
   * @param c
   *          the classfile (we need to find the correct project)
   * @return version or empty
   */
  @SuppressWarnings("rawtypes")
  public static String getVersionFromProject(Class c) {

    // TODO: further improvement:
    // XML parse pom.xml, since it's always there

    String v = "";
    try {
      String classname = "/" + c.getName().replaceAll("\\.", "/") + ".class";
      URL jarURL = c.getResource(classname);
      if (jarURL.getProtocol().equals("file")) {
        // base path is the filesystem root of the "classpath" (classes | test-classes)
        String basepath = jarURL.getPath().substring(0, jarURL.getPath().indexOf(classname));
        File projectRoot = new File(basepath).getParentFile(); // go one level up
        // assume there is already some generated manifest on filesystem
        InputStream is = new FileInputStream(projectRoot + "/maven-archiver/pom.properties");
        Properties p = new Properties();
        p.load(is);
        v = p.getProperty("version");
      }
    }
    catch (Exception e) {
      // do nothing
    }
    return v;
  }

}


text:
require 'helper'

class TestRegressionCondFormat14 < Minitest::Test
  def setup
    setup_dir_var
  end

  def teardown
    @tempfile.close(true)
  end

  def test_cond_format14
    @xlsx = 'cond_format14.xlsx'
    workbook  = WriteXLSX.new(@io)
    worksheet = workbook.add_worksheet

    format = workbook.add_format(:bg_color => 'red')

    worksheet.write('A1', 10)
    worksheet.write('A2', 20)
    worksheet.write('A3', 30)
    worksheet.write('A4', 40)

    worksheet.conditional_formatting(
      'A1',
      {
        :type         => 'cell',
        :format       => format,
        :criteria     => 'greater than',
        :value        => 5,
        :stop_if_true => 1
      }
    )

    workbook.close
    compare_for_regression(
      nil,
      { 'xl/workbook.xml' => ['<workbookView'] }
    )
  end
end


text:
package org.assertj.core.internal.dates;

import static org.assertj.core.error.ShouldHaveDateField.shouldHaveDateField;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown;
import static org.assertj.core.util.FailureMessages.actualIsNull;

import static org.mockito.Mockito.verify;

import java.util.Date;

import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.Dates;
import org.assertj.core.internal.DatesBaseTest;
import org.junit.Test;

/**
 * Tests for <code>{@link Dates#assertHasHourOfDay(AssertionInfo, Date, int)}</code>.
 *
 * @author Joel Costigliola
 */
public class Dates_assertHasHourOfDay_Test extends DatesBaseTest {

  @Override
  protected void initActualDate() {
    actual = parseDatetime("2011-01-01T03:01:02");
  }

  @Test
  public void should_fail_if_actual_has_not_given_hour_of_day() {
    AssertionInfo info = someInfo();
    int hour_of_day = 5;
    try {
      dates.assertHasHourOfDay(info, actual, hour_of_day);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldHaveDateField(actual, "hour", hour_of_day));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_actual_is_null() {
    thrown.expectAssertionError(actualIsNull());
    dates.assertHasHourOfDay(someInfo(), null, 3);
  }

  @Test
  public void should_pass_if_actual_has_given_hour_of_day() {
    dates.assertHasHourOfDay(someInfo(), actual, 3);
  }

  @Test
  public void should_fail_if_actual_has_not_given_hour_of_day_whatever_custom_comparison_strategy_is() {
    AssertionInfo info = someInfo();
    int hour_of_day = 5;
    try {
      datesWithCustomComparisonStrategy.assertHasHourOfDay(info, actual, hour_of_day);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldHaveDateField(actual, "hour", hour_of_day));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
    thrown.expectAssertionError(actualIsNull());
    datesWithCustomComparisonStrategy.assertHasHourOfDay(someInfo(), null, 3);
  }

  @Test
  public void should_pass_if_actual_has_given_hour_of_day_whatever_custom_comparison_strategy_is() {
    datesWithCustomComparisonStrategy.assertHasHourOfDay(someInfo(), actual, 3);
  }

}


text: module.exports = require('../__common__');


text:
package ru.tflow.mapping.resolvers;

import com.datastax.driver.core.DataType;
import ru.tflow.mapping.ExtendedDataType;
import ru.tflow.mapping.utils.Tuple3;

import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;

import static java.nio.ByteBuffer.allocate;
import static java.nio.ByteBuffer.wrap;

/**
 * Node capable of resolving and mapping primitives
 *
 * Created by nagakhl on 5/26/2014.
 */
public class PrimitiveResolverNode implements ChainNode, ClassResolver {

    private static final Map<Class<?>, Tuple3<DataType, Function<Object, ByteBuffer>, Function<ByteBuffer, Object>>> primitivesMap = new HashMap<>();

    static {
        primitivesMap.put(Boolean.TYPE, new Tuple3<>(DataType.cboolean(), (b) -> (ByteBuffer) wrap(new byte[]{1}).flip(), (buf) -> buf.get(0) != 0));
        primitivesMap.put(Byte.TYPE, new Tuple3<>(DataType.cint(), (b) -> (ByteBuffer) allocate(4).put((byte) b).flip(), (b) -> b.get(0)));
        primitivesMap.put(Character.TYPE, new Tuple3<>(DataType.cint(), (b) -> (ByteBuffer) allocate(4).putChar((char) b).flip(), ByteBuffer::getChar));
        primitivesMap.put(Short.TYPE, new Tuple3<>(DataType.cint(), (b) -> (ByteBuffer) allocate(4).putShort((short) b).flip(), ByteBuffer::getShort));
        primitivesMap.put(Integer.TYPE, new Tuple3<>(DataType.cint(), (b) -> (ByteBuffer) allocate(4).putInt((int) b).flip(), ByteBuffer::getInt));
        primitivesMap.put(Long.TYPE, new Tuple3<>(DataType.bigint(), (b) -> (ByteBuffer) allocate(8).putLong((long) b).flip(), ByteBuffer::getLong));
        primitivesMap.put(Double.TYPE, new Tuple3<>(DataType.cdouble(), (b) -> (ByteBuffer) allocate(8).putDouble((double) b).flip(), ByteBuffer::getDouble));
        primitivesMap.put(Float.TYPE, new Tuple3<>(DataType.cfloat(), (b) -> (ByteBuffer) allocate(4).putFloat((float) b).flip(), ByteBuffer::getFloat));
    }

    @Override
    public Optional<ExtendedDataType> resolve(Field f) {
        return resolve(f.getType());
    }

    @Override
    public Optional<ExtendedDataType> resolve(Class<?> cls) {
        //If field is not primitive just return
        if (!cls.isPrimitive()) return Optional.empty();

        if (primitivesMap.containsKey(cls)) {
            Tuple3<DataType, Function<Object, ByteBuffer>, Function<ByteBuffer, Object>> mapping = primitivesMap.get(cls);
            return Optional.of(new ExtendedDataType(cls, mapping.getElement1(), mapping.getElement2(), mapping.getElement3()));
        }

        return Optional.empty();
    }
}


text:
namespace PdfSharp.Drawing.BarCodes
{
  /// <summary>
  /// Specifies whether and how the text is displayed at the code area.
  /// </summary>
  public enum AnchorType
  {
    /// <summary>
    /// The anchor is located top left.
    /// </summary>
    TopLeft,

    /// <summary>
    /// The anchor is located top center.
    /// </summary>
    TopCenter,

    /// <summary>
    /// The anchor is located top right.
    /// </summary>
    TopRight,

    /// <summary>
    /// The anchor is located middle left.
    /// </summary>
    MiddleLeft,

    /// <summary>
    /// The anchor is located middle center.
    /// </summary>
    MiddleCenter,

    /// <summary>
    /// The anchor is located middle right.
    /// </summary>
    MiddleRight,

    /// <summary>
    /// The anchor is located bottom left.
    /// </summary>
    BottomLeft,

    /// <summary>
    /// The anchor is located bottom center.
    /// </summary>
    BottomCenter,

    /// <summary>
    /// The anchor is located bottom right.
    /// </summary>
    BottomRight,
  }
}


text:
import awstruct from 'awstruct';
import Bluebird from 'bluebird';

let handleEventually = awstruct.util.handleEventually;

function methods(attributes) {
  let federationName = attributes.fullyQualifiedName;
  let params = { region: awstruct.region };
  let ec2Ex = awstruct.ex.ec2(params);
  let ec2 = awstruct.sdk.ec2(params);

  function deleteFederation(exists) {
    if (!exists) {
      return;
    }

    return ec2.deleteSecurityGroupPromised({ GroupName: federationName });
  }

  function createFederation(exists) {
    if (exists) {
      return;
    }

    return ec2
      .createSecurityGroupPromised({
        Description: 'Federated security group access for SenseiApply',
        GroupName: federationName
      })
      .then(addIngressRules);
  }

  function addIngressRules(data) {
    return Bluebird.resolve([
      addFederatedIngress(data.GroupId),
      addHttpIngress(data.GroupId)
    ]).all();
  }

  function addFederatedIngress(groupId) {
    return ec2
      .authorizeSecurityGroupIngressPromised({
        GroupId: groupId,
        SourceSecurityGroupName: federationName
      });
  }

  function addHttpIngress(groupId) {
    return ec2
      .authorizeSecurityGroupIngressPromised({
        CidrIp: '0.0.0.0/0',
        FromPort: 80,
        GroupId: groupId,
        IpProtocol: 'tcp',
        ToPort: 80
      });
  }

  return {
    /**
     * If the federation security group is present it is deleted.
     *
     * @returns {Promise}
     */
    down() {
      return ec2Ex
        .doesSecurityGroupExist(federationName)
        .then(handleEventually(deleteFederation, { ms: 3000 }));
    },

    /**
     * If the federation security group is not present it is created and
     * has ingress rules assigned to it.
     *
     * @returns {Promise}
     */
    up() {
      return ec2Ex
        .doesSecurityGroupExist(federationName)
        .then(createFederation);
    }
  };
}

export default awstruct.resource({
  name: 'sgFederation',
  type: 'SecurityGroup'
}, methods);


text:
(function($) {
    "use strict";

    $.fn.csvTable = function(cfg) {
        $(this).each(function() {
            var $self       = $(this),
                $table      = $self.find('table'),
                $thead      = $self.find('thead'),
                $paginator  = $self.find('.paginator'),
                pageSize    = 14,
                pages       = {},
                metric      = $('.primary').attr('data-report'),
                currentPage;

            $(document).ready(init);
            function init() {
                gotoPage(0);
                $paginator.on('click', '.next', _pd(function() {
                    if ($(this).hasClass('disabled')) return;
                    gotoPage(currentPage+1);
                }));
                $paginator.on('click', '.prev', _pd(function() {
                    if ($(this).hasClass('disabled')) return;
                    gotoPage(currentPage-1);
                }));
            }

            function gotoPage(page) {
                if (page < 0) {
                    page = 0;
                }
                $paginator.find('.prev').toggleClass('disabled', page==0);
                if (pages[page]) {
                    showPage(page);
                } else {
                    $self.parent().addClass('loading');
                    $.when(getPage(page))
                     .then(function() {
                         showPage(page);
                         $self.parent().removeClass('loading');
                         getPage(page+1);
                         getPage(page-1);
                     });
                }
            }

            function showPage(page) {
                var p = pages[page];
                if (p) {
                    $table.find('tbody').hide();
                    p.el.show();
                    $thead.empty().html(p.head);
                }
                currentPage = page;
            }

            function getPage(page) {
                if (pages[page] || page < 0) return;
                var $def = $.Deferred(),
                    range = {
                        end     : Date.ago(pageSize * page + 'days'),
                        start   : Date.ago(pageSize * page + pageSize + 'days')
                    },
                    view = {
                        metric  : metric,
                        group   : 'day',
                        range   : range
                    };
                $.when(z.StatsManager.getDataRange(view))
                 .then(function(data) {
                     var fields     = z.StatsManager.getAvailableFields(view),
                         newBody    = '
',
                         newPage    = {},
                         newHead    = '
' + gettext('Date') + '	',
                         row;

                     _.each(fields, function(f) {
                         var id = f.split('|').pop(),
                             prettyName = _.escape(z.StatsManager.getPrettyName(metric, id)),
                             trimmedPrettyName = (prettyName.length > 32) ? (prettyName.substr(0, 32) + '...') : prettyName;
                         newHead += format('', prettyName);
                         newHead += trimmedPrettyName;
                         newHead += '	';
                     });

                     var d = range.end.clone().backward('1 day'),
                         lastRowDate = range.start.clone().backward('1 day');
                     for (; lastRowDate.isBefore(d); d.backward('1 day')) {
                         row = data[d.iso()] || {};
                         newBody += '
';
                         newBody += '' + Highcharts.dateFormat('%a, %b %e, %Y', Date.iso(d)) + "	";
                         _.each(fields, function(f) {
                             newBody += '';
                             if (metric == 'contributions' && f != 'count') {
                                 newBody += '$' + Highcharts.numberFormat(z.StatsManager.getField(row, f), 2);
                             } else {
                                 newBody += Highcharts.numberFormat(z.StatsManager.getField(row, f),0);
                             }
                             newBody += '	';
                         });
                        newBody += '
';
                     }
                     newBody += '
';

                     newPage.el = $(newBody);
                     newPage.head = newHead;

                     $table.append(newPage.el);
                     pages[page] = newPage;

                     $def.resolve();
                 });
                 return $def;
            }
        });
    };
})(jQuery);


text:
<img src="https://raw.githubusercontent.com/geerlingguy/Imap/1.x/Resources/Imap-Logo.png" alt="IMAP for PHP Logo" />

# Imap

A PHP wrapper class for PHP's IMAP-related email handling functions.

This class includes many convenience methods to help take the headache out of
dealing with emails in PHP. For example, email handling method names make more
sense (e.g. `getMessage`, `deleteMessage`, and `moveMessage` along with a
message id, rather than passing around IMAP streams, using many
difficult-to-remember `imap_*` functions).

Also, this class adds some convenient helpful information to emails, like the
full message header (in `raw_header`), and whether or not the email was sent by
an autoresponder (see `detectAutoresponder` for details).

If you have any issues or feature suggestions, please post a new issue on
GitHub.

## Usage

Connect to an IMAP account by creating a new Imap object with the required
parameters:

```php
$host = 'imap.example.com';
$user = 'johndoe';
$pass = '12345';
$port = 993;
$ssl = true;
$folder = 'INBOX';
$mailbox = new Imap($host, $user, $pass, $port, $ssl, $folder);
```

Get a list of all mailboxes:

```php
$mailbox->getMailboxInfo();
```

Get an array of message counts (recent, unread, and total):

```php
$mailbox->getCurrentMailboxInfo();
```

Get an associative array of message ids and subjects:

```php
$mailbox->getMessageIds();
```

Load details for a message by id.

```php
$id = 2;
$mailbox->getMessage($id);
```

Delete a message by id.

```php
$id = 2;
$mailbox->deleteMessage($id);
```

Disconnect from the server (necessary after deleting or moving messages):

```php
$mailbox->disconnect();
```

More methods and documentation can be found in the Imap.php class file.

## License

Imap is licensed under the MIT (Expat) license. See included LICENSE.md.


text:
"use strict";

var buildComprehension = require("../helpers/build-comprehension");
var t                  = require("../../types");

exports.experimental = true;

exports.ComprehensionExpression = function (node) {
  if (!node.generator) return;

  var body = [];
  var container = t.functionExpression(null, [], t.blockStatement(body), true);
  container._aliasFunction = true;

  body.push(buildComprehension(node, function () {
    return t.expressionStatement(t.yieldExpression(node.body));
  }));

  return t.callExpression(container, []);
};


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.parallax.client.cloudsession;

import com.github.kevinsawicki.http.HttpRequest;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import com.parallax.client.cloudsession.exceptions.EmailNotConfirmedException;
import com.parallax.client.cloudsession.exceptions.InsufficientBucketTokensException;
import com.parallax.client.cloudsession.exceptions.ServerException;
import com.parallax.client.cloudsession.exceptions.UnknownUserException;
import com.parallax.client.cloudsession.exceptions.UserBlockedException;
import com.parallax.client.cloudsession.exceptions.WrongAuthenticationSourceException;
import com.parallax.client.cloudsession.objects.User;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Authenticate user login
 * <p>
 * Provides an interface to the Could-Session server for user authentication
 * services. The methods in this class use custom exceptions to indicate
 * a situation where a program fault has been detected.
 *
 * @author Michel
 *
 */
public class CloudSessionAuthenticateService {

    /**
     * Handle for any logging activity
     */
    private final Logger LOG = LoggerFactory.getLogger(CloudSessionAuthenticateService.class);

    /**
     * Base URL use to obtain authentication service.
     */
    private final String BASE_URL;

    /**
     * Host name
     */
    private final String SERVER;

    /**
     * Class constructor
     *
     * @param server The cloud session host name
     * @param baseUrl The cloud session URL as defined in the
     * blocklyprop.properties file
     */
    public CloudSessionAuthenticateService(String server, String baseUrl) {
        this.SERVER = server;
        this.BASE_URL = baseUrl;

    }

    /**
     * Authenticate user from local authentication database
     *
     * @param login
     * @param password
     * @return
     * @throws UnknownUserException
     * @throws UserBlockedException
     * @throws EmailNotConfirmedException
     * @throws InsufficientBucketTokensException
     * @throws WrongAuthenticationSourceException
     * @throws ServerException
     */
    public User authenticateLocalUser(String login, String password)
            throws
                UnknownUserException,
                UserBlockedException,
                EmailNotConfirmedException,
                InsufficientBucketTokensException,
                WrongAuthenticationSourceException,
                ServerException {

        try {
            Map<String, String> data = new HashMap<>();
            data.put("email", login);
            data.put("password", password);

            LOG.debug("Contacting endpoint '/authenticate/local");

            // Issue POST request to attempt login
            HttpRequest request = HttpRequest
                    .post(getUrl("/authenticate/local"))
                    .header("server", SERVER)
                    .form(data);

            LOG.debug("Return from endpoint call");

            if (request.ok()) {

                LOG.debug("Request returned OK");

                String response = request.body();
                JsonElement jelement = new JsonParser().parse(response);
                JsonObject responseObject = jelement.getAsJsonObject();

                if (responseObject.get("success").getAsBoolean()) {

                    LOG.debug("Request was successful. Decoding user object");
                    // Create and return a user object
                    JsonObject userJson = responseObject.get("user").getAsJsonObject();

                    User user = new User();
                    user.setId(userJson.get("id").getAsLong());
                    user.setEmail(userJson.get("email").getAsString());
                    user.setLocale(userJson.get("locale").getAsString());
                    user.setScreenname(userJson.get("screenname").getAsString());
                    user.setAuthenticationSource(userJson.get("authentication-source").getAsString());

                    // These dates might be zero for grandfathered accounts
                    user.setBirthMonth(userJson.get("bdmonth").getAsInt());
                    user.setBirthYear(userJson.get("bdyear").getAsInt());

                    // This gets stored as a Null if the sponsor address is not supplied
                    if (userJson.get("parent-email").isJsonNull()) {
                        user.setCoachEmail("");
                    }
                    else {
                        user.setCoachEmail(userJson.get("parent-email").getAsString());
                    }

                    user.setCoachEmailSource(userJson.get("parent-email-source").getAsInt());

                    return user;
                } else {
                    // Authentication failed. Obtain result code
                    String message = responseObject.get("message").getAsString();
                    switch (responseObject.get("code").getAsInt()) {
                        case 400:
                            throw new UnknownUserException(login, message);
                        case 410:
                            // Wrong password, but we should report it as an
                            // unknow username OR password to increase ambiguity
                            LOG.info("Wrong password");
                            throw new UnknownUserException(login, message);
                        case 420:
                            throw new UserBlockedException(message);
                        case 430:
                            throw new EmailNotConfirmedException(message);
                        case 470:
                            throw new InsufficientBucketTokensException();
                        case 480:
                            String authenticationSource = responseObject.get("data").getAsString();
                            throw new WrongAuthenticationSourceException(authenticationSource);
                    }

                    LOG.warn("Unexpected error: {}", response);
                    return null;
                }
            }
            else {
                LOG.error("Server returned error code {}", request.code());
                // Encountered a server error
                throw new ServerException(request.message());
            }
        } catch (HttpRequest.HttpRequestException hre) {
            LOG.error("Inter service error", hre);
            throw new ServerException(hre);
        } catch (JsonSyntaxException jse) {
            LOG.error("Json syntax error", jse);
            throw new ServerException(jse);
        }
    }

    /**
     * Prepend the base url to the action url
     *
     * @param actionUrl
     * @return
     */
    private String getUrl(String actionUrl) {
        return BASE_URL + actionUrl;
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>QUnit - sap.ui.fl.core.FlexVisualizer</title>

    <link rel="stylesheet" href="../../../../../../resources/sap/ui/thirdparty/qunit.css" type="text/css" media="screen" />

QUnit Page for sap.ui.fl.core.FlexVisualizer


text:
{-# LANGUAGE DataKinds             #-}
{-# LANGUAGE DeriveDataTypeable    #-}
{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE KindSignatures        #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables   #-}

{-
Modular arithmetic based on Data.SBV.Examples.Misc.Word4
-}

module Mod
       ( Mod
       , SMod
       ) where

import Data.Generics (Data, Typeable)
import Data.Proxy
import GHC.Enum      (boundedEnumFrom, boundedEnumFromThen, predError,
                      succError)
import GHC.TypeLits
import System.Random (Random (..))

import Data.SBV
import Data.SBV.Dynamic
import Data.SBV.Internals

-- | Mod as a newtype. Invariant: @Mod x@ should satisfy @x < mm@.
newtype Mod (m :: Nat) = Mod { unMod :: Word8 }
  deriving (Eq, Ord, Data, Typeable)

mm :: forall m. KnownNat m => Mod m
mm = Mod . fromInteger . natVal $ (Proxy :: Proxy m)

-- | Smart constructor; simplifies conversion from Word8
modm :: forall m. KnownNat m => Word8 -> Mod m
modm x = Mod (x `sMod` unMod (mm :: Mod m))

-- | Show instance
instance Show (Mod m) where
  show (Mod x) = show x

-- | Read instance. We read as an 8-bit word, and coerce
instance KnownNat m => Read (Mod m) where
  readsPrec p s = [ (modm x, s') | (x, s') <- readsPrec p s ]

-- | Bounded instance; from 0 to mm-1
instance KnownNat m => Bounded (Mod m) where
  minBound = Mod 0
  maxBound = mm - 1

-- | Enum instance, trivial definitions.
instance KnownNat m => Enum (Mod m) where
  succ m@(Mod x) = if m < mm-1 then Mod (succ x) else succError "Mod"
  pred m@(Mod x) = if m > 0    then Mod (pred x) else predError "Mod"
  toEnum = fromInteger . toInteger
  fromEnum = fromInteger . toInteger . unMod
  -- Comprehensions
  enumFrom                                     = boundedEnumFrom
  enumFromThen                                 = boundedEnumFromThen
  enumFromTo     (Mod x) (Mod y)           = map Mod (enumFromTo x y)
  enumFromThenTo (Mod x) (Mod y) (Mod z) = map Mod (enumFromThenTo x y z)

-- | Num instance, merely lifts underlying 8-bit operation and casts back
instance KnownNat m => Num (Mod m) where
  Mod x + Mod y = modm (x + y)
  Mod x * Mod y = modm (x * y)
  Mod x - Mod y = modm (x - y)
  negate (Mod x)  = modm (negate x)
  abs (Mod x)     = Mod x
  signum (Mod x)  = Mod (if x == 0 then 0 else 1)
  fromInteger n     = modm (fromInteger n)

-- | Real instance simply uses the Word8 instance
instance KnownNat m => Real (Mod m) where
  toRational (Mod x) = toRational x

-- | Integral instance, again using Word8 instance and casting. NB. we do
-- not need to use the smart constructor here as neither the quotient nor
-- the remainder can overflow a Mod.
instance KnownNat m => Integral (Mod m) where
  quotRem (Mod x) (Mod y) = (Mod q, Mod r)
    where (q, r) = quotRem x y
  toInteger (Mod x) = toInteger x

-- | Random instance, used in quick-check
instance KnownNat m => Random (Mod m) where
  randomR (Mod lo, Mod hi) gen = (Mod x, gen')
    where (x, gen') = randomR (lo, hi) gen
  random gen = (Mod x, gen')
    where (x, gen') = randomR (0, unMod (mm :: Mod m) - 1) gen

-- | SMod type synonym
type SMod m = SBV (Mod m)

svMM :: KnownNat m => SMod m
svMM = literal mm

-- | Size enough for result of multiplication
modBits :: Int
modBits = 8

modKind :: Kind
modKind = KBounded False modBits

-- | SymWord instance, allowing this type to be used in proofs/sat etc.
instance KnownNat m => SymWord (Mod m) where
  mkSymWord q n = do
    x <- genMkSymVar modKind q n
    constrain $ x .<= literal (modm (unMod (mm :: Mod m) - 1))
    return x
  literal    = genLiteral modKind
  fromCW     = genFromCW

-- | HasKind instance; simply returning the underlying kind for the type
instance HasKind (Mod m) where
  kindOf _ = modKind

-- | SatModel instance, merely uses the generic parsing method.
instance KnownNat m => SatModel (Mod m) where
  parseCWs = genParse modKind

-- | SDvisible instance, using 0-extension
instance KnownNat m => SDivisible (Mod m) where
  sQuotRem x 0 = (0, x)
  sQuotRem x y = x `quotRem` y
  sDivMod  x 0 = (0, x)
  sDivMod  x y = x `divMod` y

instance {-# OVERLAPPING #-} KnownNat m => Num (SMod m) where
  fromInteger = literal . fromInteger
  SBV x + SBV y = SBV (svPlus x y) `sMod` svMM
  SBV x * SBV y = SBV (svTimes x y) `sMod` svMM
  abs = id  -- donothing since the value is always non-negative
  signum x = ite (x .== 0) (literal 0) (literal 1)
  negate _ = error "Num.SMod.negate: not supported"

-- | SDvisible instance, using default methods
instance KnownNat m => SDivisible (SMod m) where
  sQuotRem = liftQRem
  sDivMod  = liftDMod


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

Table4.2.0.19

  <title>Physical atmospheric Properties</title>
  <source>http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_table4-2-0-19.shtml</source>
  <parameter code="0">
    <shortName>VIS</shortName>
    <description>Visibility</description>
    <units>m</units>
  </parameter>
  <parameter code="1">
    <shortName>ALBDO</shortName>
    <description>Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="2">
    <shortName>TSTM</shortName>
    <description>Thunderstorm Probability</description>
    <units>%</units>
  </parameter>
  <parameter code="3">
    <shortName>MIXHT</shortName>
    <description>Mixed Layer Depth</description>
    <units>m</units>
  </parameter>
  <parameter code="4">
    <shortName>VOLASH</shortName>
    <description>Volcanic Ash</description>
    <units>See Table 4.206</units>
  </parameter>
  <parameter code="5">
    <shortName>ICIT</shortName>
    <description>Icing Top</description>
    <units>m</units>
  </parameter>
  <parameter code="6">
    <shortName>ICIB</shortName>
    <description>Icing Base</description>
    <units>m</units>
  </parameter>
  <parameter code="7">
    <shortName>ICI</shortName>
    <description>Icing</description>
    <units>See Table 4.207</units>
  </parameter>
  <parameter code="8">
    <shortName>TURBT</shortName>
    <description>Turbulence Top</description>
    <units>m</units>
  </parameter>
  <parameter code="9">
    <shortName>TURBB</shortName>
    <description>Turbulence Base</description>
    <units>m</units>
  </parameter>
  <parameter code="10">
    <shortName>TURB</shortName>
    <description>Turbulence</description>
    <units>See Table 4.208</units>
  </parameter>
  <parameter code="11">
    <shortName>TKE</shortName>
    <description>Turbulent Kinetic Energy</description>
    <units>J kg-1</units>
  </parameter>
  <parameter code="12">
    <shortName>PBLREG</shortName>
    <description>Planetary Boundary Layer Regime</description>
    <units>See Table 4.209</units>
  </parameter>
  <parameter code="13">
    <shortName>CONTI</shortName>
    <description>Contrail Intensity</description>
    <units>See Table 4.210</units>
  </parameter>
  <parameter code="14">
    <shortName>CONTET</shortName>
    <description>Contrail Engine Type</description>
    <units>See Table 4.211</units>
  </parameter>
  <parameter code="15">
    <shortName>CONTT</shortName>
    <description>Contrail Top</description>
    <units>m</units>
  </parameter>
  <parameter code="16">
    <shortName>CONTB</shortName>
    <description>Contrail Base</description>
    <units>m</units>
  </parameter>
  <parameter code="17">
    <shortName>MXSALB</shortName>
    <description>Maximum Snow Albedosee Note 1</description>
    <units>%</units>
  </parameter>
  <parameter code="18">
    <shortName>SNFALB</shortName>
    <description>Snow-Free Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="19">
    <shortName>SALBD</shortName>
    <description>Snow Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="20">
    <shortName>ICIP</shortName>
    <description>Icing</description>
    <units>%</units>
  </parameter>
  <parameter code="21">
    <shortName>CTP</shortName>
    <description>In-Cloud Turbulence</description>
    <units>%</units>
  </parameter>
  <parameter code="22">
    <shortName>CAT</shortName>
    <description>Clear Air Turbulence (CAT)</description>
    <units>%</units>
  </parameter>
  <parameter code="23">
    <shortName>SLDP</shortName>
    <description>Supercooled Large Droplet Probabilitysee Note 2</description>
    <units>%</units>
  </parameter>
  <parameter code="24">
    <shortName>CONTKE</shortName>
    <description>Convective Turbulent Kinetic Energy</description>
    <units>J kg-1</units>
  </parameter>
  <parameter code="25">
    <shortName>WIWW</shortName>
    <description>Weather</description>
    <units>See Table 4.225</units>
  </parameter>
  <parameter code="26">
    <shortName>CONVO</shortName>
    <description>Convective Outlook</description>
    <units>See Table 4.224</units>
  </parameter>
  <parameter code="27">
    <shortName>ICESC</shortName>
    <description>Icing Scenario</description>
    <units>See Table 4.227</units>
  </parameter>
  <parameter code="192">
    <shortName>MXSALB</shortName>
    <description>Maximum Snow Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="193">
    <shortName>SNFALB</shortName>
    <description>Snow-Free Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="194">
    <shortName>SRCONO</shortName>
    <description>Slight risk convective outlook</description>
    <units>categorical</units>
  </parameter>
  <parameter code="195">
    <shortName>MRCONO</shortName>
    <description>Moderate risk convective outlook</description>
    <units>categorical</units>
  </parameter>
  <parameter code="196">
    <shortName>HRCONO</shortName>
    <description>High risk convective outlook</description>
    <units>categorical</units>
  </parameter>
  <parameter code="197">
    <shortName>TORPROB</shortName>
    <description>Tornado probability</description>
    <units>%</units>
  </parameter>
  <parameter code="198">
    <shortName>HAILPROB</shortName>
    <description>Hail probability</description>
    <units>%</units>
  </parameter>
  <parameter code="199">
    <shortName>WINDPROB</shortName>
    <description>Wind probability</description>
    <units>%</units>
  </parameter>
  <parameter code="200">
    <shortName>STORPROB</shortName>
    <description>Significant Tornado probability</description>
    <units>%</units>
  </parameter>
  <parameter code="201">
    <shortName>SHAILPRO</shortName>
    <description>Significant Hail probability</description>
    <units>%</units>
  </parameter>
  <parameter code="202">
    <shortName>SWINDPRO</shortName>
    <description>Significant Wind probability</description>
    <units>%</units>
  </parameter>
  <parameter code="203">
    <shortName>TSTMC</shortName>
    <description>Categorical Thunderstorm</description>
    <units>Code table 4.222</units>
  </parameter>
  <parameter code="204">
    <shortName>MIXLY</shortName>
    <description>Number of mixed layers next to surface</description>
    <units>integer</units>
  </parameter>
  <parameter code="205">
    <shortName>FLGHT</shortName>
    <description>Flight Category</description>
    <units />
  </parameter>
  <parameter code="206">
    <shortName>CICEL</shortName>
    <description>Confidence - Ceiling</description>
    <units />
  </parameter>
  <parameter code="207">
    <shortName>CIVIS</shortName>
    <description>Confidence - Visibility</description>
    <units />
  </parameter>
  <parameter code="208">
    <shortName>CIFLT</shortName>
    <description>Confidence - Flight Category</description>
    <units />
  </parameter>
  <parameter code="209">
    <shortName>LAVNI</shortName>
    <description>Low-Level aviation interest</description>
    <units />
  </parameter>
  <parameter code="210">
    <shortName>HAVNI</shortName>
    <description>High-Level aviation interest</description>
    <units />
  </parameter>
  <parameter code="211">
    <shortName>SBSALB</shortName>
    <description>Visible, Black Sky Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="212">
    <shortName>SWSALB</shortName>
    <description>Visible, White Sky Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="213">
    <shortName>NBSALB</shortName>
    <description>Near IR, Black Sky Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="214">
    <shortName>NWSALB</shortName>
    <description>Near IR, White Sky Albedo</description>
    <units>%</units>
  </parameter>
  <parameter code="215">
    <shortName>PRSVR</shortName>
    <description>Total Probability of Severe Thunderstorms (Days 2,3)</description>
    <units>%</units>
  </parameter>
  <parameter code="216">
    <shortName>PRSIGSVR</shortName>
    <description>Total Probability of Extreme Severe Thunderstorms (Days 2,3)</description>
    <units>%</units>
  </parameter>
  <parameter code="217">
    <shortName>SIPD</shortName>
    <description>Supercooled Large Droplet (SLD) Icingsee Note 2</description>
    <units>See Table 4.207</units>
  </parameter>
  <parameter code="218">
    <shortName>EPSR</shortName>
    <description>Radiative emissivity</description>
    <units />
  </parameter>
  <parameter code="219">
    <shortName>TPFI</shortName>
    <description>Turbulence Potential Forecast Index</description>
    <units />
  </parameter>
  <parameter code="220">
    <shortName>SVRTS</shortName>
    <description>Categorical Severe Thunderstorm</description>
    <units>Code table 4.222</units>
  </parameter>
  <parameter code="221">
    <shortName>PROCON</shortName>
    <description>Probability of Convection</description>
    <units>%</units>
  </parameter>
  <parameter code="222">
    <shortName>CONVP</shortName>
    <description>Convection Potential</description>
    <units>Code table 4.222</units>
  </parameter>
  <parameter code="232">
    <shortName>VAFTD</shortName>
    <description>Volcanic Ash Forecast Transport and Dispersion</description>
    <units>log10 (kg m-3)</units>
  </parameter>
  <parameter code="233">
    <shortName>ICPRB</shortName>
    <description>Icing probability</description>
    <units>non-dim</units>
  </parameter>
  <parameter code="234">
    <shortName>ICSEV</shortName>
    <description>Icing severity</description>
    <units>non-dim</units>
  </parameter>
</parameterMap>


text:
package com.nibdev.otrtav2.widgets;

public class SingleWidgetConfiguration {

	public static final int TYPE_CODE = 100;
	public static final int TYPE_SCRIPT = 101;
	public static final int TYPE_ALLOFF = 102;
	public static final int TYPE_LAYOUTSTART = 103;

	private int mType;
	private int mWidgetID;
	private int mAllocationID;

	private String mTopText;
	private String mBottomText;

	private String mConfigText;

	public SingleWidgetConfiguration(){
		mTopText = "";
		mBottomText = "";
	}

	public int getWidgetID() {
		return mWidgetID;
	}
	public void setWidgetID(int widgetID) {
		mWidgetID = widgetID;
	}
	public int getAllocationID() {
		return mAllocationID;
	}
	public void setAllocationID(int allocationID) {
		mAllocationID = allocationID;
	}
	public int getType() {
		return mType;
	}
	public void setType(int type) {
		mType = type;
	}
	public String getTopText() {
		return mTopText;
	}
	public void setTopText(String topText) {
		mTopText = topText;
	}
	public String getBottomText() {
		return mBottomText;
	}
	public void setBottomText(String bottomText) {
		mBottomText = bottomText;
	}

	public String getConfigText() {
		return mConfigText;
	}

	public void setConfigText(String configText) {
		mConfigText = configText;
	}

}


text:
Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. The definition of a celebrity is that all the other n - 1 people know him/her but he/she does not know any of them.

Now you want to find out who the celebrity is or verify that there is not one. The only thing you are allowed to do is to ask questions like: "Hi, A. Do you know B?" to get information of whether A knows B. You need to find out the celebrity (or verify there is not one) by asking as few questions as possible (in the asymptotic sense).

You are given a helper function `bool knows(a, b)` which tells you whether A knows B. Implement a function `int findCelebrity(n)`, your function should minimize the number of calls to knows.

Note: There will be exactly one celebrity if he/she is in the party. Return the celebrity's label if there is a celebrity in the party. If there is no celebrity, return -1.

### Example 1:
```
Input: graph = [
  [1,1,0],
  [0,1,0],
  [1,1,1]
]
Output: 1
Explanation: There are three persons labeled with 0, 1 and 2. graph[i][j] = 1 means person i knows person j, otherwise graph[i][j] = 0 means person i does not know person j. The celebrity is the person labeled as 1 because both 0 and 2 know him but 1 does not know anybody.
```
### Example 2:
```
Input: graph = [
  [1,0,1],
  [1,1,0],
  [0,1,1]
]
Output: -1
Explanation: There is no celebrity.
```
### Note:
1. The directed graph is represented as an adjacency matrix, which is an n x n matrix where a[i][j] = 1 means person i knows person j while a[i][j] = 0 means the contrary.
2. Remember that you won't have direct access to the adjacency matrix.

## Solution
The first loop is to find the candidate by following, if candidate knows i, then switch candidate. In detail, suppose the candidate after the first for loop is person k, it means 0 to k-1 cannot be the celebrity, because they know a previous or current candidate, or they are unknown to a previous candidate. Also, since k knows no one between k+1 and n-1, k+1 to n-1 can not be the celebrity either. Therefore, k is the only possible celebrity, if there exists one.

The remaining job is to check if k indeed does not know any other persons and all other persons know k.

To this point, I actually realize that we can further shrink the calling of knows method. For example, we don't need to check if k knows k+1 to n-1 in the second loop, because the first loop has already done that.

#Pinterest #LNKD #FB #MSFT #AMZN #GOOGL

#Array

#Similar questions [#277](../p277m/README.md) [#997](../p997e/README.md)


text:
@class SWAccount;
@interface UIViewController (SWEndpoint)

- (BOOL)sw_shouldObserveAccountStateChanges;
- (void)sw_accountStateChanged:(SWAccount*)account;

@end


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.Media.Models
{
    public partial class VideoTrack : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("@odata.type");
            writer.WriteStringValue(OdataType);
            writer.WriteEndObject();
        }

        internal static VideoTrack DeserializeVideoTrack(JsonElement element)
        {
            string odataType = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("@odata.type"))
                {
                    odataType = property.Value.GetString();
                    continue;
                }
            }
            return new VideoTrack(odataType);
        }
    }
}


text:
package com.microsoft.azure.management.apimanagement.v2018_06_01_preview.implementation;

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.apimanagement.v2018_06_01_preview.QuotaByCounterKeys;
import rx.Completable;
import rx.functions.Func1;
import rx.Observable;
import com.microsoft.azure.management.apimanagement.v2018_06_01_preview.QuotaCounterCollection;
import com.microsoft.azure.management.apimanagement.v2018_06_01_preview.QuotaCounterValueContractProperties;

class QuotaByCounterKeysImpl extends WrapperImpl<QuotaByCounterKeysInner> implements QuotaByCounterKeys {
    private final ApiManagementManager manager;

    QuotaByCounterKeysImpl(ApiManagementManager manager) {
        super(manager.inner().quotaByCounterKeys());
        this.manager = manager;
    }

    public ApiManagementManager manager() {
        return this.manager;
    }

    @Override
    public Observable<QuotaCounterCollection> listByServiceAsync(String resourceGroupName, String serviceName, String quotaCounterKey) {
        QuotaByCounterKeysInner client = this.inner();
        return client.listByServiceAsync(resourceGroupName, serviceName, quotaCounterKey)
        .map(new Func1<QuotaCounterCollectionInner, QuotaCounterCollection>() {
            @Override
            public QuotaCounterCollection call(QuotaCounterCollectionInner inner) {
                return new QuotaCounterCollectionImpl(inner, manager());
            }
        });
    }

    @Override
    public Completable updateAsync(String resourceGroupName, String serviceName, String quotaCounterKey, QuotaCounterValueContractProperties parameters) {
        QuotaByCounterKeysInner client = this.inner();
        return client.updateAsync(resourceGroupName, serviceName, quotaCounterKey, parameters).toCompletable();
    }

}


text:
using SpecialFunctions
function  poisson(theta, y, x)
    lambda = exp.(x*theta)
    n = size(y,1)
    logdensity = y .* (x*theta) .- lambda .- loggamma.(y .+ 1.)
end


text:
package com.oxandon.mvp.arch.protocol;

import com.oxandon.mvp.parcel.IParcelFormat;

/**
 * Created by peng on 2017/5/23.
 */

public interface IMvpRepository extends IMvp {
    IParcelFormat getParcel();
}


text:
package org.apache.metron.common.utils;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

import java.io.*;
import java.util.Map;

public enum JSONUtils {
  INSTANCE;

  private static ThreadLocal<JSONParser> _parser = ThreadLocal.withInitial(() ->
          new JSONParser());

  private static ThreadLocal<ObjectMapper> _mapper = ThreadLocal.withInitial(() ->
          new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL));

  public <T> T convert(Object original, Class<T> targetClass) {
    return _mapper.get().convertValue(original, targetClass);
  }

  public ObjectMapper getMapper() {
    return _mapper.get();
  }

  public <T> T load(InputStream is, TypeReference<T> ref) throws IOException {
    return _mapper.get().readValue(is, ref);
  }

  public <T> T load(String is, TypeReference<T> ref) throws IOException {
    return _mapper.get().readValue(is, ref);
  }

  public <T> T load(File f, TypeReference<T> ref) throws IOException {
    try (InputStream is = new BufferedInputStream(new FileInputStream(f))) {
      return _mapper.get().readValue(is, ref);
    }
  }

  public <T> T load(InputStream is, Class<T> clazz) throws IOException {
    return _mapper.get().readValue(is, clazz);
  }

  public <T> T load(File f, Class<T> clazz) throws IOException {
    try (InputStream is = new BufferedInputStream(new FileInputStream(f))) {
      return _mapper.get().readValue(is, clazz);
    }
  }

  public <T> T load(String is, Class<T> clazz) throws IOException {
    return _mapper.get().readValue(is, clazz);
  }

  public String toJSON(Object o, boolean pretty) throws JsonProcessingException {
    if (pretty) {
      return _mapper.get().writerWithDefaultPrettyPrinter().writeValueAsString(o);
    } else {
      return _mapper.get().writeValueAsString(o);
    }
  }

  public byte[] toJSON(Object config) throws JsonProcessingException {
    return _mapper.get().writeValueAsBytes(config);
  }

  /**
   * Transforms a bean (aka POJO) to a JSONObject.
   */
  public JSONObject toJSONObject(Object o) throws JsonProcessingException, ParseException {
    return (JSONObject) _parser.get().parse(toJSON(o, false));
  }
}


text:
typedef union _XEvent XEvent;

namespace chromeos {

// XInputHierarchyChangedEventListener listens for an XI_HierarchyChanged event,
// which is sent to Chrome when X detects a system or USB keyboard (or mouse),
// then tells X to change the current XKB keyboard layout. Start by just calling
// instance() to get it going.
class XInputHierarchyChangedEventListener : public ui::PlatformEventObserver {
 public:
  static XInputHierarchyChangedEventListener* GetInstance();

  void Stop();

 private:
  // Defines the delete on exit Singleton traits we like.  Best to have this
  // and const/dest private as recommended for Singletons.
  friend struct base::DefaultSingletonTraits<
      XInputHierarchyChangedEventListener>;

  XInputHierarchyChangedEventListener();
  ~XInputHierarchyChangedEventListener() override;

  // ui::PlatformEventObserver:
  void WillProcessEvent(const ui::PlatformEvent& event) override;
  void DidProcessEvent(const ui::PlatformEvent& event) override;

  // Returns true if the event was processed, false otherwise.
  void ProcessedXEvent(XEvent* xevent);

  bool stopped_;

  DISALLOW_COPY_AND_ASSIGN(XInputHierarchyChangedEventListener);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_EVENTS_XINPUT_HIERARCHY_CHANGED_EVENT_LISTENER_H_


text:
package com.hslg.controller.mobile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ezcloud.framework.common.Setting;
import com.ezcloud.framework.util.AesUtil;
import com.ezcloud.framework.util.HtmlUtils;
import com.ezcloud.framework.util.SettingUtils;
import com.ezcloud.framework.util.StringUtils;
import com.ezcloud.framework.vo.DataSet;
import com.ezcloud.framework.vo.OVO;
import com.ezcloud.framework.vo.Row;
import com.ezcloud.framework.vo.VOConvert;
import com.hslg.service.MailboxSysBroadcastService;

/**
 * 广播
 * @author Administrator
 *
 */
@Controller("mobileMailboxSysBroadcastController")
@RequestMapping("/api/mailbox/sysbroadcast")
public class MailboxSysBroadcastController extends BaseController {

	@Resource(name = "hslgMailboxSysBroadcastService")
	private MailboxSysBroadcastService mailboxSysBroadcastService;

	/**
	 * 根据用户编号分页查询反馈记录
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value ="/list")
	public @ResponseBody
	String page(HttpServletRequest request) throws Exception
	{
		parseRequest(request);
		OVO ovo =null;
		String page =ivo.getString("page","1");
		String page_size =ivo.getString("page_size","10");
		DataSet ds =mailboxSysBroadcastService.list(page,page_size);
		if(ds != null && ds.size() > 0 )
		{
			Setting setting =SettingUtils.get();
			String site_url =setting.getSiteUrl();
			for(int i=0;i<ds.size(); i++ )
			{
				Row temp =(Row)ds.get(i);
				String icon_url =temp.getString("icon_url","");
				if(! StringUtils.isEmptyOrNull(icon_url))
				{
					icon_url =icon_url.replace("/hslg", "");
					icon_url =site_url+icon_url;
					temp.put("icon_url", icon_url);
					ds.set(i, temp);
				}
			}
		}
		ovo =new OVO(0,"","");
		ovo.set("list", ds);
		return AesUtil.encode(VOConvert.ovoToJson(ovo));
	}

	@RequestMapping(value ="/top-page-broadcast")
	public @ResponseBody
	String indexPageBroadcast(HttpServletRequest request) throws Exception
	{
		parseRequest(request);
		OVO ovo =null;
		DataSet ds =mailboxSysBroadcastService.indexPageBroadcast();
		ovo =new OVO(0,"","");
		ovo.set("list", ds);
		return AesUtil.encode(VOConvert.ovoToJson(ovo));
	}

	/**
	 * 详情
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value ="/detail")
	public @ResponseBody
	String add(HttpServletRequest request) throws Exception
	{
		parseRequest(request);
		String id=ivo.getString("id",null);
		if(StringUtils.isEmptyOrNull(id))
		{
			ovo =new OVO(-11000,"id不能为空","id不能为空");
			return AesUtil.encode(VOConvert.ovoToJson(ovo));
		}
		Row row =mailboxSysBroadcastService.findById(id);
		String content =row.getString("content","");
		Setting setting =SettingUtils.get();
		String siteUrl =setting.getSiteUrl();
		String domain =siteUrl;
		int iPos =siteUrl.lastIndexOf("/");
		if(iPos != -1)
		{
			domain =siteUrl.substring(0,iPos);
		}
		//替换图片标签的url为http全路径
		content =HtmlUtils.fillImgSrcWithDomain(domain, content);
		// 转义字符串中的换行,不然在转成json对象时会报错
		content =StringUtils.string2Json(content);
		ovo =new OVO(0,"操作成功","操作成功");
		ovo.set("content", content);
		return AesUtil.encode(VOConvert.ovoToJson(ovo));
	}

}


text:
Utility to push to multiple remotes of a git repo in one command.

## Getting Started
Install the module with: `npm install -g gitpushall`

## Documentation
_(Coming soon)_

## Release History

 * v0.2.0 : gitpushall works inside any subdirectory of a working copy.
 * v0.1.0 : First version published on npm

## License
Copyright (c) 2013 Clément Bourgeois
Licensed under the MIT license.


text:
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Riverback;

namespace Riverback_UnitTests
{
    [TestClass]
    public class TileIndexTests
    {
        private static TileIndex _tileIndex;
        private const int Size = 8;

        [ClassInitialize()]
        public static void Initialize(TestContext tc)
        {
            _tileIndex = new TileIndex(Size);
        }

        [TestMethod()]
        public void setTileIndexArray_ValidParameters_ContainsDataFromArray()
        {
            bool[] input = { false, false, true, false, false, false, true, false };
            int expected = 2;

            _tileIndex.SetTileIndexArray(input);

            Assert.AreEqual(expected, _tileIndex.GetBankTileIndexSize());
            Assert.AreEqual(2, _tileIndex.GetBankIndexTile(0));
            Assert.AreEqual(-1, _tileIndex.GetBankIndex(4));
            Assert.AreEqual(6, _tileIndex.GetBankIndexTile(1));
            Assert.AreEqual(1, _tileIndex.GetBankIndex(6));
            for (int i = 0; i < Size; i++) {
                Assert.AreEqual(input[i], _tileIndex[i]);
            }
        }

        [TestMethod()]
        public void setTileIndexList_ValidParameters_ContainsDataFromList()
        {
            bool[] inputData = { false, false, true, false, false, false, true, false };
            List<bool> input = new List<bool>();
            input.AddRange(inputData);
            int expected = 2;

            _tileIndex.SetTileIndexList(input);

            Assert.AreEqual(expected, _tileIndex.GetBankTileIndexSize());
            Assert.AreEqual(2, _tileIndex.GetBankIndexTile(0));
            Assert.AreEqual(-1, _tileIndex.GetBankIndex(4));
            Assert.AreEqual(6, _tileIndex.GetBankIndexTile(1));
            Assert.AreEqual(1, _tileIndex.GetBankIndex(6));
            for (int i = 0; i < Size; i++) {
                Assert.AreEqual(input[i], _tileIndex[i]);
            }
        }
    }
}


text:
require 'faker'

FactoryGirl.define do
  factory :list do
    name Faker::Company.name
    association :user
  end
end


text:
namespace {

// Max visual tooltip width. If a tooltip is greater than this width, it will
// be wrapped.
constexpr int kTooltipMaxWidthPixels = 800;

// Paddings
constexpr int kHorizontalPadding = 8;
constexpr int kVerticalPaddingTop = 4;
constexpr int kVerticalPaddingBottom = 5;

// TODO(varkha): Update if native widget can be transparent on Linux.
bool CanUseTranslucentTooltipWidget() {
// TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
// of lacros-chrome is complete.
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) || BUILDFLAG(IS_WIN)
  return false;
#else
  return true;
#endif
}

// TODO(oshima): Consider to use views::Label.
class TooltipView : public views::View {
 public:
  METADATA_HEADER(TooltipView);
  TooltipView() : render_text_(gfx::RenderText::CreateRenderText()) {
    SetBorder(views::CreateEmptyBorder(kVerticalPaddingTop, kHorizontalPadding,
                                       kVerticalPaddingBottom,
                                       kHorizontalPadding));

    render_text_->SetWordWrapBehavior(gfx::WRAP_LONG_WORDS);
    render_text_->SetMultiline(true);

    ResetDisplayRect();
  }

  TooltipView(const TooltipView&) = delete;
  TooltipView& operator=(const TooltipView&) = delete;
  ~TooltipView() override = default;

  // views:View:
  void OnPaint(gfx::Canvas* canvas) override {
    OnPaintBackground(canvas);
    gfx::Size text_size = size();
    gfx::Insets insets = GetInsets();
    text_size.Enlarge(-insets.width(), -insets.height());
    render_text_->SetDisplayRect(gfx::Rect(text_size));
    canvas->Save();
    canvas->Translate(gfx::Vector2d(insets.left(), insets.top()));
    render_text_->Draw(canvas);
    canvas->Restore();
    OnPaintBorder(canvas);
  }

  gfx::Size CalculatePreferredSize() const override {
    gfx::Size view_size = render_text_->GetStringSize();
    gfx::Insets insets = GetInsets();
    view_size.Enlarge(insets.width(), insets.height());
    return view_size;
  }

  void SetText(const std::u16string& text) {
    render_text_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);

    // Replace tabs with whitespace to avoid placeholder character rendering
    // where previously it did not. crbug.com/993100
    std::u16string newText(text);
    base::ReplaceChars(newText, u"\t", u"        ", &newText);
    render_text_->SetText(newText);
    SchedulePaint();
  }

  void SetForegroundColor(SkColor color) { render_text_->SetColor(color); }

  void SetBackgroundColor(SkColor background_color, SkColor border_color) {
    if (CanUseTranslucentTooltipWidget()) {
      // Corner radius of tooltip background.
      const float kTooltipCornerRadius = 2.f;
      SetBackground(views::CreateBackgroundFromPainter(
          views::Painter::CreateRoundRectWith1PxBorderPainter(
              background_color, border_color, kTooltipCornerRadius)));
    } else {
      SetBackground(views::CreateSolidBackground(background_color));

      SetBorder(views::CreatePaddedBorder(
          views::CreateSolidBorder(1, border_color),
          gfx::Insets(kVerticalPaddingTop - 1, kHorizontalPadding - 1,
                      kVerticalPaddingBottom - 1, kHorizontalPadding - 1)));
    }

    // Force the text color to be readable when |background_color| is not
    // opaque.
    render_text_->set_subpixel_rendering_suppressed(
        SkColorGetA(background_color) != 0xFF);
  }

  void SetMaxWidth(int width) {
    max_width_ = width;
    ResetDisplayRect();
  }

  gfx::RenderText* render_text_for_test() { return render_text_.get(); }

  void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
    node_data->SetName(render_text_->GetDisplayText());
    node_data->role = ax::mojom::Role::kTooltip;
  }

 private:
  void ResetDisplayRect() {
    render_text_->SetDisplayRect(gfx::Rect(0, 0, max_width_, 100000));
  }

  std::unique_ptr<gfx::RenderText> render_text_;
  int max_width_ = 0;
};

BEGIN_METADATA(TooltipView, views::View)
END_METADATA

}  // namespace

namespace views {
namespace corewm {

// static
const char TooltipAura::kWidgetName[] = "TooltipAura";

TooltipAura::~TooltipAura() {
  DestroyWidget();
  CHECK(!IsInObserverList());
}

class TooltipAura::TooltipWidget : public Widget {
 public:
  TooltipWidget() = default;
  ~TooltipWidget() override = default;

  TooltipView* GetTooltipView() { return tooltip_view_; }

  void SetTooltipView(std::unique_ptr<TooltipView> tooltip_view) {
    tooltip_view_ = SetContentsView(std::move(tooltip_view));
  }

 private:
  raw_ptr<TooltipView> tooltip_view_ = nullptr;
};

gfx::RenderText* TooltipAura::GetRenderTextForTest() {
  DCHECK(widget_);
  return widget_->GetTooltipView()->render_text_for_test();
}

void TooltipAura::GetAccessibleNodeDataForTest(ui::AXNodeData* node_data) {
  DCHECK(widget_);
  widget_->GetTooltipView()->GetAccessibleNodeData(node_data);
}

gfx::Rect TooltipAura::GetTooltipBounds(const gfx::Size& tooltip_size,
                                        const TooltipPosition& position,
                                        ui::OwnedWindowAnchor* anchor) {
  gfx::Rect tooltip_rect(position.anchor_point, tooltip_size);
  // When the tooltip is showing up as a result of a cursor event, the tooltip
  // needs to show up at the bottom-right corner of the cursor. When it's not,
  // it has to be centered with the anchor point with pass it.
  switch (position.behavior) {
    case TooltipPositionBehavior::kCentered:
      tooltip_rect.Offset(-tooltip_size.width() / 2, 0);
      break;
    case TooltipPositionBehavior::kRelativeToCursor: {
      const int x_offset =
          base::i18n::IsRTL() ? -tooltip_size.width() : kCursorOffsetX;
      tooltip_rect.Offset(x_offset, kCursorOffsetY);
      break;
    }
  }

  anchor->anchor_gravity = ui::OwnedWindowAnchorGravity::kBottomRight;
  anchor->anchor_position =
      position.behavior == TooltipPositionBehavior::kRelativeToCursor
          ? ui::OwnedWindowAnchorPosition::kBottomRight
          : ui::OwnedWindowAnchorPosition::kTop;
  anchor->constraint_adjustment =
      ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideX |
      ui::OwnedWindowConstraintAdjustment::kAdjustmentSlideY |
      ui::OwnedWindowConstraintAdjustment::kAdjustmentFlipY;
  // TODO(msisov): handle RTL.
  anchor->anchor_rect =
      gfx::Rect(position.anchor_point, {kCursorOffsetX, kCursorOffsetY});

  display::Screen* screen = display::Screen::GetScreen();
  gfx::Rect display_bounds(
      screen->GetDisplayNearestPoint(position.anchor_point).bounds());

  // If tooltip is out of bounds on the x axis, we simply shift it
  // horizontally by the offset variation.
  if (tooltip_rect.x() < display_bounds.x()) {
    int delta = tooltip_rect.x() - display_bounds.x();
    tooltip_rect.Offset(delta, 0);
  }
  if (tooltip_rect.right() > display_bounds.right()) {
    int delta = tooltip_rect.right() - display_bounds.right();
    tooltip_rect.Offset(-delta, 0);
  }

  // If tooltip is out of bounds on the y axis, we flip it to appear above the
  // mouse cursor instead of below.
  if (tooltip_rect.bottom() > display_bounds.bottom())
    tooltip_rect.set_y(position.anchor_point.y() - tooltip_size.height());

  tooltip_rect.AdjustToFit(display_bounds);
  return tooltip_rect;
}

void TooltipAura::CreateTooltipWidget(const gfx::Rect& bounds,
                                      const ui::OwnedWindowAnchor& anchor) {
  DCHECK(!widget_);
  DCHECK(tooltip_window_);
  widget_ = new TooltipWidget;
  views::Widget::InitParams params;
  // For aura, since we set the type to TYPE_TOOLTIP, the widget will get
  // auto-parented to the right container.
  params.type = views::Widget::InitParams::TYPE_TOOLTIP;
  params.context = tooltip_window_;
  DCHECK(params.context);
  params.z_order = ui::ZOrderLevel::kFloatingUIElement;
  params.accept_events = false;
  params.bounds = bounds;
  if (CanUseTranslucentTooltipWidget())
    params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent;
  params.shadow_type = views::Widget::InitParams::ShadowType::kNone;
  // Use software compositing to avoid using unnecessary hardware resources
  // which just amount to overkill for this UI.
  params.force_software_compositing = true;
  params.name = kWidgetName;

  params.init_properties_container.SetProperty(aura::client::kOwnedWindowAnchor,
                                               anchor);

  widget_->Init(std::move(params));
}

void TooltipAura::DestroyWidget() {
  if (widget_) {
    widget_->RemoveObserver(this);
    widget_->Close();
    widget_ = nullptr;
  }
}

int TooltipAura::GetMaxWidth(const gfx::Point& location) const {
  display::Screen* screen = display::Screen::GetScreen();
  gfx::Rect display_bounds(screen->GetDisplayNearestPoint(location).bounds());
  return std::min(kTooltipMaxWidthPixels, (display_bounds.width() + 1) / 2);
}

void TooltipAura::Update(aura::Window* window,
                         const std::u16string& tooltip_text,
                         const TooltipPosition& position) {
  // Hide() must be called before showing the next tooltip.  See also the
  // comment in Hide().
  DCHECK(!widget_);

  tooltip_window_ = window;

  auto new_tooltip_view = std::make_unique<TooltipView>();
  new_tooltip_view->SetMaxWidth(GetMaxWidth(position.anchor_point));
  new_tooltip_view->SetText(tooltip_text);
  ui::OwnedWindowAnchor anchor;
  auto bounds =
      GetTooltipBounds(new_tooltip_view->GetPreferredSize(), position, &anchor);
  CreateTooltipWidget(bounds, anchor);
  widget_->SetTooltipView(std::move(new_tooltip_view));
  widget_->AddObserver(this);

  const ui::ColorProvider* color_provider = widget_->GetColorProvider();
  auto background_color = color_provider->GetColor(ui::kColorTooltipBackground);
  if (!CanUseTranslucentTooltipWidget()) {
    background_color = color_utils::GetResultingPaintColor(
        background_color, color_provider->GetColor(ui::kColorWindowBackground));
  }
  auto foreground_color = color_provider->GetColor(ui::kColorTooltipForeground);
  if (!CanUseTranslucentTooltipWidget())
    foreground_color =
        color_utils::GetResultingPaintColor(foreground_color, background_color);
  TooltipView* tooltip_view = widget_->GetTooltipView();
  tooltip_view->SetBackgroundColor(background_color, foreground_color);
  tooltip_view->SetForegroundColor(foreground_color);
}

void TooltipAura::Show() {
  if (widget_) {
    widget_->Show();
    widget_->StackAtTop();
    widget_->GetTooltipView()->NotifyAccessibilityEvent(
        ax::mojom::Event::kTooltipOpened, true);
  }
}

void TooltipAura::Hide() {
  tooltip_window_ = nullptr;
  if (widget_) {
    // If we simply hide the widget there's a chance to briefly show outdated
    // information on the next Show() because the text isn't updated until
    // OnPaint() which happens asynchronously after the Show(). As a result,
    // we can just destroy the widget and create a new one each time which
    // guarantees we never show outdated information.
    // TODO(http://crbug.com/998280): Figure out why the old content is
    // displayed despite the size change.
    widget_->GetTooltipView()->NotifyAccessibilityEvent(
        ax::mojom::Event::kTooltipClosed, true);
    DestroyWidget();
  }
}

bool TooltipAura::IsVisible() {
  return widget_ && widget_->IsVisible();
}

void TooltipAura::OnWidgetDestroying(views::Widget* widget) {
  DCHECK_EQ(widget_, widget);
  if (widget_)
    widget_->RemoveObserver(this);
  widget_ = nullptr;
  tooltip_window_ = nullptr;
}

}  // namespace corewm
}  // namespace views


text:
package org.eligosource.eventsourced.journal.leveldb

import java.io.File

import scala.concurrent.duration._

import akka.actor.Actor

import org.apache.hadoop.fs.{FileSystem, Path}

import org.eligosource.eventsourced.journal.common.JournalProps
import org.eligosource.eventsourced.journal.common.serialization.SnapshotSerializer
import org.eligosource.eventsourced.journal.common.snapshot.HadoopFilesystemSnapshottingProps
import org.eligosource.eventsourced.journal.common.snapshot.HadoopFilesystemSnapshotting.defaultLocalFilesystem

/**
 * Configuration object for a [[http://code.google.com/p/leveldb/ LevelDB]] based journal.
 * Applications may also choose to use a [[https://github.com/dain/leveldb Java port]] of
 * LevelDB that doesn't run native code (see `native` field). This journal comes with
 * different optimizations to choose from, as described at the methods
 *
 *  - `withProcessorStructure`
 *  - `withSequenceStructure`
 *
 * Journal actors can be created from a configuration object as follows:
 *
 * {{{
 *  import java.io.File
 *
 *  import akka.actor._
 *
 *  import org.eligosource.eventsourced.core.Journal
 *  import org.eligosource.eventsourced.journal.leveldb.LeveldbJournalProps
 *
 *  implicit val system: ActorSystem = ...
 *
 *  val journalDir: File = ...
 *  val journal: ActorRef = Journal(LeveldbJournalProps(journalDir))
 * }}}
 *
 * @param dir Journal directory.
 * @param name Optional journal actor name.
 * @param dispatcherName Optional journal actor dispatcher name.
 * @param fsync `true` if every write is physically synced. Default is `false`.
 * @param checksum `true` if checksums are verified on read. Default is `false`.
 * @param native `true` if the [[http://code.google.com/p/leveldb/ native LevelDB]]
 *        should be used (default), `false` for using a
 *        [[https://github.com/dain/leveldb Java port]].
 * @param processorStructured `true` if entries are primarily ordered by processor
 *        id, `false` if entries are ordered by sequence number.  Default is `true`.
 */
case class LeveldbJournalProps(
  dir: File,
  name: Option[String] = None,
  dispatcherName: Option[String] = None,
  fsync: Boolean = false,
  checksum: Boolean = false,
  native: Boolean = true,
  processorStructured: Boolean = true,
  snapshotDir: Path = new Path("snapshots"),
  snapshotSerializer: SnapshotSerializer = SnapshotSerializer.java,
  snapshotLoadTimeout: FiniteDuration = 1 hour,
  snapshotSaveTimeout: FiniteDuration = 1 hour,
  snapshotFilesystem: FileSystem = defaultLocalFilesystem,
  readOnly: Boolean=false)
  extends JournalProps with HadoopFilesystemSnapshottingProps[LeveldbJournalProps] {

  val snapshotPath =
    if (!snapshotDir.isAbsolute && snapshotFilesystem == defaultLocalFilesystem) {
      // default local file system and relative snapshot dir:
      // store snapshots relative to journal dir
      new Path(new Path(dir.toURI), snapshotDir)
    } else snapshotDir

  /**
   *  Returns `false` if entries are primarily ordered by processor id,
   *  `true` if entries are ordered by sequence number. Default is `false`.
   */
  def sequenceStructured: Boolean =
    !processorStructured

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified journal actor name.
   */
  def withName(name: String) =
    copy(name = Some(name))

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified journal actor dispatcher name.
   */
  def withDispatcherName(dispatcherName: String) =
    copy(dispatcherName = Some(dispatcherName))

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified physical sync setting.
   */
  def withFsync(fsync: Boolean) =
    copy(fsync = fsync)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified checksum verification setting.
   */
  def withChecksum(checksum: Boolean) =
    copy(checksum = checksum)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified native setting.
   */
  def withNative(native: Boolean) =
    copy(native = native)

  /**
   * Returns a new `LeveldbJournalProps` with `processorStructured` set to `true` and
   * `sequenceStructured` set to `false`. With this setting, entries will be primarily
   * ordered by processor id.
   *
   * Pros:
   *
   *  - efficient replay of input messages for all processors (batch replay)
   *  - efficient replay of input messages for a single processor
   *  - efficient replay of output messages
   *
   * Cons:
   *
   *  - deletion of old entries requires full scan
   */
  def withProcessorStructure =
    copy(processorStructured = true)

  /**
   * Returns a new `LeveldbJournalProps` with `processorStructured` set to `false` and
   * `sequenceStructured` set to `true`. With this setting, entries will be ordered by
   * sequence number.
   *
   * Pros:
   *
   *  - efficient replay of input messages for all processors (batch replay with optional lower bound)
   *  - efficient replay of output messages
   *  - efficient deletion of old entries
   *
   * Cons:
   *
   *  - replay of input messages for a single processor requires full scan (with optional lower bound)
   */
  def withSequenceStructure =
    copy(processorStructured = false)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified snapshot directory.
   */
  def withSnapshotDir(snapshotDir: Path) =
    copy(snapshotDir = snapshotDir)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified snapshot serializer.
   */
  def withSnapshotSerializer(snapshotSerializer: SnapshotSerializer) =
    copy(snapshotSerializer = snapshotSerializer)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified snapshot load timeout.
   */
  def withSnapshotLoadTimeout(snapshotLoadTimeout: FiniteDuration) =
    copy(snapshotLoadTimeout = snapshotLoadTimeout)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified snapshot save timeout.
   */
  def withSnapshotSaveTimeout(snapshotSaveTimeout: FiniteDuration) =
    copy(snapshotSaveTimeout = snapshotSaveTimeout)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified snapshot filesystem.
   */
  def withSnapshotFilesystem(snapshotFilesystem: FileSystem) =
    copy(snapshotFilesystem = snapshotFilesystem)

  /**
   * Java API.
   *
   * Returns a new `LeveldbJournalProps` with specified read only property
   */
  def withReadOnly(ro:Boolean) =
    copy(readOnly = ro)

  def createJournalActor: Actor = {
    if (processorStructured) {
      new LeveldbJournalPS(this)
    } else {
      new LeveldbJournalSS(this)
    }
  }
}

object LeveldbJournalProps {
  /**
   * Java API.
   */
  def create(dir: File): LeveldbJournalProps =
    LeveldbJournalProps(dir)
}


text:
#include "MotionManager.h"
#include "MotionImplCoreMotion.h"
#include "cinder/CinderMath.h"

namespace cinder {

std::mutex MotionManager::sMutex;

void MotionManager::enable( float updateFrequency, SensorMode mode, bool showsCalibrationDisplay )
{
	auto impl = get()->mImpl;
	impl->setSensorMode( mode );
	impl->setUpdateFrequency( updateFrequency );
	impl->setShowsCalibrationView( showsCalibrationDisplay );
    impl->startMotionUpdates();
}

void MotionManager::disable()
{
    get()->mImpl->stopMotionUpdates();
}

bool MotionManager::isEnabled()
{
	return get()->mImpl->isMotionUpdatesActive();
}

MotionManager::SensorMode MotionManager::getSensorMode()
{
	return get()->mImpl->getSensorMode();
}

bool MotionManager::isDataAvailable()
{
	return get()->mImpl->isMotionDataAvailable();
}

bool MotionManager::isGyroAvailable()
{
	return get()->mImpl->isGyroAvailable();
}

bool MotionManager::isNorthReliable()
{
	return get()->mImpl->isNorthReliable();
}

void MotionManager::setShowsCalibrationView( bool shouldShow )
{
	get()->mImpl->setShowsCalibrationView( shouldShow );
}

vec3 MotionManager::getGravityDirection( app::InterfaceOrientation orientation )
{
	return get()->mImpl->getGravityDirection( orientation );
}

quat MotionManager::getRotation( app::InterfaceOrientation orientation )
{
    return get()->mImpl->getRotation( orientation );
}

vec3 MotionManager::getRotationRate( app::InterfaceOrientation orientation )
{
    return get()->mImpl->getRotationRate( orientation );
}

vec3 MotionManager::getAcceleration( app::InterfaceOrientation orientation)
{
    return get()->mImpl->getAcceleration( orientation );
}

bool MotionManager::isShaking( float minShakeDeltaThreshold )
{
    return get()->isShakingImpl( minShakeDeltaThreshold );
}

MotionManager* MotionManager::get()
{
	static MotionManager *sInst = 0;
	std::unique_lock<std::mutex> lock( sMutex );
	if( ! sInst ) {
		sInst = new MotionManager;
        sInst->mImpl = std::make_shared<MotionImplCoreMotion>();
	}
	return sInst;
}

bool MotionManager::isShakingImpl( float minShakeDeltaThreshold )
{
    const vec3& accel = getAcceleration();
	std::unique_lock<std::mutex> lock( sMutex ); // lock after we get the acceleration so there is no deadlock
    bool isShaking = false;
    if( mPrevAcceleration != vec3( 0 ) ) {
        mShakeDelta = length2(accel - mPrevAcceleration);
        if( length2(accel - mPrevAcceleration) > (minShakeDeltaThreshold * minShakeDeltaThreshold) )
            isShaking = true;
    }
    mPrevAcceleration = accel;
    return isShaking;
}

float MotionManager::getAccelerometerFilterImpl()
{
	return mImpl->getAccelFilter();
}

void MotionManager::setAccelerometerFilterImpl( float filtering )
{
	mImpl->setAccelFilter( math<float>::clamp( filtering, 0, 0.999f ) );
}

} // namespace cinder


text:
package io.opentelemetry.context;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;

enum ThreadLocalContextStorage implements ContextStorage {
  INSTANCE;

  private static final Logger logger = Logger.getLogger(ThreadLocalContextStorage.class.getName());

  private static final ThreadLocal<Context> THREAD_LOCAL_STORAGE = new ThreadLocal<>();

  @Override
  public Scope attach(Context toAttach) {
    if (toAttach == null) {
      // Null context not allowed so ignore it.
      return NoopScope.INSTANCE;
    }

    Context beforeAttach = current();
    if (toAttach == beforeAttach) {
      return NoopScope.INSTANCE;
    }

    THREAD_LOCAL_STORAGE.set(toAttach);

    return () -> {
      if (current() != toAttach) {
        logger.log(
            Level.FINE,
            "Context in storage not the expected context, Scope.close was not called correctly");
      }
      THREAD_LOCAL_STORAGE.set(beforeAttach);
    };
  }

  @Override
  @Nullable
  public Context current() {
    return THREAD_LOCAL_STORAGE.get();
  }

  enum NoopScope implements Scope {
    INSTANCE;

    @Override
    public void close() {}
  }
}


text:
using namespace std;
using namespace TagLib;

class TestMPC : public CppUnit::TestFixture
{
  CPPUNIT_TEST_SUITE(TestMPC);
  CPPUNIT_TEST(testPropertiesSV8);
  CPPUNIT_TEST(testPropertiesSV7);
  CPPUNIT_TEST(testPropertiesSV5);
  CPPUNIT_TEST(testPropertiesSV4);
  CPPUNIT_TEST_SUITE_END();

public:

  void testPropertiesSV8()
  {
    MPC::File f(TEST_FILE_PATH_C("sv8_header.mpc"));
    CPPUNIT_ASSERT_EQUAL(8, f.audioProperties()->mpcVersion());
    CPPUNIT_ASSERT_EQUAL(1, f.audioProperties()->length());
    CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
    CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
  }

  void testPropertiesSV7()
  {
    MPC::File f(TEST_FILE_PATH_C("click.mpc"));
    CPPUNIT_ASSERT_EQUAL(7, f.audioProperties()->mpcVersion());
    CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->length());
    CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
    CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
  }

  void testPropertiesSV5()
  {
    MPC::File f(TEST_FILE_PATH_C("sv5_header.mpc"));
    CPPUNIT_ASSERT_EQUAL(5, f.audioProperties()->mpcVersion());
    CPPUNIT_ASSERT_EQUAL(26, f.audioProperties()->length());
    CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
    CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
  }

  void testPropertiesSV4()
  {
    MPC::File f(TEST_FILE_PATH_C("sv4_header.mpc"));
    CPPUNIT_ASSERT_EQUAL(4, f.audioProperties()->mpcVersion());
    CPPUNIT_ASSERT_EQUAL(26, f.audioProperties()->length());
    CPPUNIT_ASSERT_EQUAL(0, f.audioProperties()->bitrate());
    CPPUNIT_ASSERT_EQUAL(2, f.audioProperties()->channels());
    CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
  }

};

CPPUNIT_TEST_SUITE_REGISTRATION(TestMPC);


text:
<?php
/* Prototype  : int array_unshift(array $array, mixed $var [, mixed ...])
 * Description: Pushes elements onto the beginning of the array
 * Source code: ext/standard/array.c
*/

/*
 * Testing the functionality of array_unshift() by passing different
 * single quoted strings for $var argument that is prepended to the array
 * passed through $array argument
*/

echo "*** Testing array_unshift() : single quoted strings for \$var argument ***\n";

// array to be passed to $array argument
$array = array('f' => "first", "s" => 'second', 1, 2.222);

// different variations of single quoted strings to be passed to $var argument
$vars = array (
  '\$ -> This represents the dollar sign. hello dollar!!!',
  '\t\r\v The quick brown fo\fx jumped over the lazy dog',
  'This is a text with special chars: \!\@\#\$\%\^\&\*\(\)\\',
  'hello world\\t',
  'This is \ta text in bold letters\r\s\malong with slashes\n : HELLO WORLD\t'
);

// loop through the various elements of $arrays to test array_unshift()
$iterator = 1;
foreach($vars as $var) {
  echo "-- Iteration $iterator --\n";
  $temp_array = $array;  // assign $array to another temporary $temp_array

  /* with default argument */
  // returns element count in the resulting array after arguments are pushed to
  // beginning of the given array
  var_dump( array_unshift($temp_array, $var) );

  // dump the resulting array
  var_dump($temp_array);

  /* with optional arguments */
  // returns element count in the resulting array after arguments are pushed to
  // beginning of the given array
  $temp_array = $array;
  var_dump( array_unshift($temp_array, $var, "hello", 'world') );

  // dump the resulting array
  var_dump($temp_array);
  $iterator++;
}

echo "Done";
?>


text:
package org.joda.time.contrib.jsptag;

import javax.servlet.jsp.JspTagException;

/**
 * A handler for <dateTimeZone&gt.
 *
 * @author Jan Luehe
 * @author Jim Newsham
 */
public class DateTimeZoneTag extends DateTimeZoneSupport {

    // for tag attribute
    public void setValue(Object value) throws JspTagException {
        this.value = value;
    }

}


text:
package genetics

import (
	"fmt"
	"github.com/yaricom/goNEAT/v3/neat/network"
)

// MIMOControlGene The Multiple-Input Multiple-Output (MIMO) control Gene allows creating modular genomes, in which several groups of genes
// connected through single MIMO Gene and corresponding control function is applied to all inputs in order to produce
// outputs. This allows to build modular hierarchical genomes which can be considered as sum of constituent components
// and evolved as a whole and as a concrete parts simultaneously.
type MIMOControlGene struct {
	// The current innovation number for this gene
	InnovationNum int64
	// Used to see how much mutation has changed the link
	MutationNum float64
	// If true the gene is enabled
	IsEnabled bool

	// The control node with control/activation function
	ControlNode *network.NNode

	// The list of associated IO nodes for fast traversal
	ioNodes []*network.NNode
}

// NewMIMOGene Creates new MIMO gene
func NewMIMOGene(controlNode *network.NNode, innovNum int64, mutNum float64, enabled bool) *MIMOControlGene {
	gene := &MIMOControlGene{
		ControlNode:   controlNode,
		InnovationNum: innovNum,
		MutationNum:   mutNum,
		IsEnabled:     enabled,
	}
	// collect IO nodes list
	gene.ioNodes = make([]*network.NNode, 0)
	for _, l := range controlNode.Incoming {
		gene.ioNodes = append(gene.ioNodes, l.InNode)
	}
	for _, l := range controlNode.Outgoing {
		gene.ioNodes = append(gene.ioNodes, l.OutNode)
	}

	return gene
}

// NewMIMOGeneCopy The copy constructor taking parameters from provided control gene for given control node
func NewMIMOGeneCopy(g *MIMOControlGene, controlNode *network.NNode) *MIMOControlGene {
	cg := NewMIMOGene(controlNode, g.InnovationNum, g.MutationNum, g.IsEnabled)
	return cg
}

// Tests whether this gene has intersection with provided map of nodes, i.e. any of it's IO nodes included into list
func (g *MIMOControlGene) hasIntersection(nodes map[int]*network.NNode) bool {
	for _, nd := range g.ioNodes {
		if _, Ok := nodes[nd.Id]; Ok {
			// found
			return true
		}
	}
	return false
}

// The stringer
func (g *MIMOControlGene) String() string {
	enabledStr := ""
	if !g.IsEnabled {
		enabledStr = " -DISABLED-"
	}
	return fmt.Sprintf("[MIMO Gene INNOV (%5d, %2.3f) %s control node: %s]",
		g.InnovationNum, g.MutationNum, enabledStr, g.ControlNode.String())
}


text:
.class Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;
.super Ljava/lang/Object;
.source "ContentService.java"

# interfaces
.implements Landroid/os/IBinder$DeathRecipient;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/content/ContentService$ObserverNode;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "ObserverEntry"
.end annotation

# instance fields
.field public final notifyForDescendants:Z

.field public final observer:Landroid/database/IContentObserver;

.field private final observersLock:Ljava/lang/Object;

.field public final pid:I

.field final synthetic this$1:Lcom/android/server/content/ContentService$ObserverNode;

.field public final uid:I

.field private final userHandle:I

# direct methods
.method static synthetic -get0(Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;)I
    .locals 1

    iget v0, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->userHandle:I

    return v0
.end method

.method public constructor <init>(Lcom/android/server/content/ContentService$ObserverNode;Landroid/database/IContentObserver;ZLjava/lang/Object;III)V
    .locals 3
    .param p1, "this$1"    # Lcom/android/server/content/ContentService$ObserverNode;
    .param p2, "o"    # Landroid/database/IContentObserver;
    .param p3, "n"    # Z
    .param p4, "observersLock"    # Ljava/lang/Object;
    .param p5, "_uid"    # I
    .param p6, "_pid"    # I
    .param p7, "_userHandle"    # I

    .prologue
    .line 956
    iput-object p1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->this$1:Lcom/android/server/content/ContentService$ObserverNode;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 958
    iput-object p4, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observersLock:Ljava/lang/Object;

    .line 959
    iput-object p2, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observer:Landroid/database/IContentObserver;

    .line 960
    iput p5, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->uid:I

    .line 961
    iput p6, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->pid:I

    .line 962
    iput p7, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->userHandle:I

    .line 963
    iput-boolean p3, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->notifyForDescendants:Z

    .line 965
    :try_start_0
    iget-object v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observer:Landroid/database/IContentObserver;

    invoke-interface {v1}, Landroid/database/IContentObserver;->asBinder()Landroid/os/IBinder;

    move-result-object v1

    const/4 v2, 0x0

    invoke-interface {v1, p0, v2}, Landroid/os/IBinder;->linkToDeath(Landroid/os/IBinder$DeathRecipient;I)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 957
    :goto_0
    return-void

    .line 966
    :catch_0
    move-exception v0

    .line 967
    .local v0, "e":Landroid/os/RemoteException;
    invoke-virtual {p0}, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->binderDied()V

    goto :goto_0
.end method

# virtual methods
.method public binderDied()V
    .locals 3

    .prologue
    .line 972
    iget-object v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observersLock:Ljava/lang/Object;

    monitor-enter v1

    .line 973
    :try_start_0
    iget-object v0, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->this$1:Lcom/android/server/content/ContentService$ObserverNode;

    iget-object v2, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observer:Landroid/database/IContentObserver;

    invoke-virtual {v0, v2}, Lcom/android/server/content/ContentService$ObserverNode;->removeObserverLocked(Landroid/database/IContentObserver;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v1

    .line 971
    return-void

    .line 972
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method public dumpLocked(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/util/SparseIntArray;)V
    .locals 3
    .param p1, "fd"    # Ljava/io/FileDescriptor;
    .param p2, "pw"    # Ljava/io/PrintWriter;
    .param p3, "args"    # [Ljava/lang/String;
    .param p4, "name"    # Ljava/lang/String;
    .param p5, "prefix"    # Ljava/lang/String;
    .param p6, "pidCounts"    # Landroid/util/SparseIntArray;

    .prologue
    const/4 v0, 0x0

    .line 979
    iget v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->pid:I

    iget v2, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->pid:I

    invoke-virtual {p6, v2}, Landroid/util/SparseIntArray;->get(I)I

    move-result v2

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {p6, v1, v2}, Landroid/util/SparseIntArray;->put(II)V

    .line 980
    invoke-virtual {p2, p5}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    invoke-virtual {p2, p4}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    const-string/jumbo v1, ": pid="

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 981
    iget v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->pid:I

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(I)V

    const-string/jumbo v1, " uid="

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 982
    iget v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->uid:I

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(I)V

    const-string/jumbo v1, " user="

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 983
    iget v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->userHandle:I

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(I)V

    const-string/jumbo v1, " target="

    invoke-virtual {p2, v1}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    .line 985
    iget-object v1, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observer:Landroid/database/IContentObserver;

    if-eqz v1, :cond_0

    iget-object v0, p0, Lcom/android/server/content/ContentService$ObserverNode$ObserverEntry;->observer:Landroid/database/IContentObserver;

    invoke-interface {v0}, Landroid/database/IContentObserver;->asBinder()Landroid/os/IBinder;

    move-result-object v0

    .line 984
    :cond_0
    invoke-static {v0}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 978
    return-void
.end method