text:
#ifndef GMCMC_ION_H
#define GMCMC_ION_H

#include <gmcmc/gmcmc_likelihood.h>

/**
 * Ion channel model likelihood function using Metropolis-Hastings.
 */
extern const gmcmc_likelihood_function gmcmc_ion_likelihood_mh;

/**
 * Ion channel model-specific data.
 *
 * In addition to data common to all models, ion channel models have a Q matrix
 * which details the transitions between open and closed states.
 */
typedef struct gmcmc_ion_model gmcmc_ion_model;

/**
 * Ion channel dataset type.
 */
typedef struct {
  void (*destroy)(void *);                      /** Destructor function */
  size_t (*num_timepoints)(const void *);       /** Returns the number of timepoints in the dataset */
  const double * (*timepoints)(const void *);   /** Returns a pointer to the timepoints */
  const double * (*data)(const void *);         /** Returns a pointer to the data */
} gmcmc_ion_dataset_type;

/**
 * Ion channel dataset.
 */
typedef struct {
  const gmcmc_ion_dataset_type * type;  /** Pointer to function table */
  void * data;                          /** Pointer to implementation */
} gmcmc_ion_dataset;

/**
 * Function type that populates the Q matrix based on the current parameter
 * values.  The size of the parameter vector and number of open and closed
 * states are expected to be known in the model.  A Q matrix of the correct size
 * for the model is allocated based on the number of open and closed states and
 * is initialised to zero before calling this function.
 *
 * The Q matrix is expected to have the closed states in the upper left and open
 * states in the lower right.
 *
 * @param [in]  params  current parameter values
 * @param [out] Q       Q matrix to populate
 * @param [in]  ldq     leading dimension of the Q matrix
 */
typedef void (*gmcmc_ion_calculate_Q_matrix)(const double *, double *, size_t);

/**
 * Creates an ion channel model-specific data object.
 *
 * @param [out] ion_model           the ion channel model
 * @param [in]  closed              number of closed states in the model
 * @param [in]  open                number of open states in the model
 * @param [in]  calculate_Q_matrix  a function to calculate the Q matrix based
 *                                    on the current parameter values.
 *
 * @return 0 on success,
 *         GMCMC_EINVAL if calculate_Q_matrix is NULL, or
 *         GMCMC_ENOMEM if there is not enough memory to create the data object.
 */
int gmcmc_ion_model_create(gmcmc_ion_model **, unsigned int, unsigned int,
                           gmcmc_ion_calculate_Q_matrix);

/**
 * Destroys the ion channel model-specific data.
 *
 * @param [in] ion_model  the ion channel model-specific data object to destroy
 */
void gmcmc_ion_model_destroy(gmcmc_ion_model *);

/**
 * Gets the number of closed states in the model.
 *
 * @param [in] ion_model  the ion channel model
 *
 * @return the number of closed states in the model.
 */
unsigned int gmcmc_ion_model_get_num_closed_states(const gmcmc_ion_model *);

/**
 * Gets the number of open states in the model.
 *
 * @param [in] ion_model  the ion channel model
 *
 * @return the number of open states in the model.
 */
unsigned int gmcmc_ion_model_get_num_open_states(const gmcmc_ion_model *);

/**
 * Calculates the Q matrix for an ion channel model.
 *
 * @param [in]  ion_model  the ion channel model
 * @param [in]  params     the parameter values to use to calculate the Q matrix
 * @param [out] Q          the Q matrix
 * @param [in]  ldq        leading dimension of the Q matrix
 */
void gmcmc_ion_model_calculate_Q_matrix(const gmcmc_ion_model *, const double *,
                                        double *, size_t);

/**
 * Destroys an ion channel dataset.
 *
 * @param [in] dataset  the dataset to destroy.
 */
void gmcmc_ion_dataset_destroy(gmcmc_ion_dataset *);

/**
 * Gets the number of timepoints in the dataset.
 *
 * @param [in] dataset  the dataset
 *
 * @return the number of timepoints in the dataset.
 */
static inline size_t gmcmc_ion_dataset_num_timepoints(const gmcmc_ion_dataset * dataset) {
  return dataset->type->num_timepoints(dataset->data);
}

/**
 * Gets a pointer to the timepoints.
 *
 * @param [in] dataset  the dataset
 *
 * @return a pointer to the timepoints.
 */
static inline const double * gmcmc_ion_dataset_timepoints(const gmcmc_ion_dataset * dataset) {
  return dataset->type->timepoints(dataset->data);
}

/**
 * Gets a pointer to the data.
 *
 * @param [in] dataset  the dataset
 *
 * @return a pointer to the data.
 */
static inline const double * gmcmc_ion_dataset_data(const gmcmc_ion_dataset * dataset) {
  return dataset->type->data(dataset->data);
}

/**
 * Loads an ion channel dataset from a Matlab file.  The file must contain a
 * real-valued column vector named "TimePoints" containing strictly increasing
 * timepoints and a vector of data points named "Data".
 * The dimensionality of the timepoints must match that of the data.
 *
 * @param [out] dataset     the dataset object to load data into
 * @param [in]  filename    the name of the Matlab .mat file containing the data
 *
 * @return 0 on success,
 *         GMCMC_ENOMEM if there is not enough memory to allocate the dataset or
 *                        data vectors,
 *         GMCMC_EINVAL if the Matlab file does not contain valid ion channel
 *                        data,
 *         GMCMC_EIO    if there is an input/output error.
 */
int gmcmc_ion_dataset_load_matlab(gmcmc_ion_dataset **, const char *);

/**
 * Loads an ion channel dataset from an HDF5 file.  The file must contain a
 * 1-by-n dataset of native double values named "TimePoints" and a corresponding
 * dataset of the same dimensions and type named "Data".
 *
 * @param [out] dataset     the dataset object to load data into
 * @param [in]  filename    the name of the HDF5 .h5 file containing the data
 *
 * @return 0 on success,
 *         GMCMC_ENOMEM if there is not enough memory to allocate the dataset or
 *                        data vectors,
 *         GMCMC_EINVAL if the HDF5 file does not contain valid ion channel
 *                        data,
 *         GMCMC_EIO    if there is an input/output error.
 */
int gmcmc_ion_dataset_load_hdf5(gmcmc_ion_dataset **, const char *);

#endif /* GMCMC_ION_H */


text:
/* ###
 * IP: GHIDRA
 * REVIEWED: YES
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ghidra.app.util.opinion;

import ghidra.program.model.lang.LanguageCompilerSpecPair;

public class QueryResult {
	public final LanguageCompilerSpecPair pair;
	public final boolean preferred;

	public QueryResult(LanguageCompilerSpecPair pair, boolean preferred) {
		this.pair = pair;
		this.preferred = preferred;
	}

	@Override
	public String toString() {
		return "query result: " + pair + " (" + (preferred ? "" : "not ") + "preferred)";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((pair == null) ? 0 : pair.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		QueryResult other = (QueryResult) obj;
		if (pair == null) {
			if (other.pair != null) {
				return false;
			}
		}
		else if (!pair.equals(other.pair)) {
			return false;
		}
		return true;
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

return [
   'mustBeArray'          => 'The email validation method must be passed an array.',
   'invalidAddress'       => 'Invalid email address: {0}',
   'attachmentMissing'    => 'Unable to locate the following email attachment: {0}',
   'attachmentUnreadable' => 'Unable to open this attachment: {0}',
   'noFrom'               => 'Cannot send mail with no "From" header.',
   'noRecipients'         => 'You must include recipients: To, Cc, or Bcc',
   'sendFailurePHPMail'   => 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.',
   'sendFailureSendmail'  => 'Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.',
   'sendFailureSmtp'      => 'Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.',
   'sent'                 => 'Your message has been successfully sent using the following protocol: {0, string}',
   'noSocket'             => 'Unable to open a socket to Sendmail. Please check settings.',
   'noHostname'           => 'You did not specify a SMTP hostname.',
   'SMTPError'            => 'The following SMTP error was encountered: {0}',
   'noSMTPAuth'           => 'Error: You must assign a SMTP username and password.',
   'failedSMTPLogin'      => 'Failed to send AUTH LOGIN command. Error: {0}',
   'SMTPAuthUsername'     => 'Failed to authenticate username. Error: {0}',
   'SMTPAuthPassword'     => 'Failed to authenticate password. Error: {0}',
   'SMTPDataFailure'      => 'Unable to send data: {0}',
   'exitStatus'           => 'Exit status code: {0}',
];


text:
const test = require('tape');
const queryString = require('querystring');
const createFilters = require('../../lib/transforms/create-selected-filters');
const createQueryParams = require('../../lib/query-params/query-params');
const dir = __dirname.split('/')[__dirname.split('/').length - 1];
const file = dir + __filename.replace(__dirname, '') + ' > ';

test(file + 'datefrom and birthdate filters', (t) => {
  t.plan(1);
  const query = queryString.parse('q=ada&filter%5Bdate%5Bfrom%5D%5D=1800&page%5Bsize%5D=50');
  const queryParams = createQueryParams('html', {query: query, params: {type: 'objects'}});
  const filters = createFilters(queryParams);

  t.equal(filters['date[from]'], '1800', 'The dates are the same');
  t.end();
});

test(file + 'dateto and deathdate filters', (t) => {
  t.plan(1);
  const query = queryString.parse('q=ada&filter%5Bdate%5Bto%5D%5D=1900&page%5Bsize%5D=50');
  const queryParams = createQueryParams('html', {query: query, params: {type: 'objects'}});
  const filters = createFilters(queryParams);

  t.equal(filters['date[to]'], '1900', 'The dates are the same');
  t.end();
});


text:
<?php

namespace Tmdb\Model\Collection;

use Tmdb\Model\Common\GenericCollection;

/**
 * Class QueryParametersCollection
 * @package Tmdb\Model\Collection
 */
class QueryParametersCollection extends GenericCollection
{
}


text:
.class public Lcom/android/internal/app/NetInitiatedActivity;
.super Lcom/android/internal/app/AlertActivity;
.source "NetInitiatedActivity.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;

# static fields
.field private static final DEBUG:Z = true

.field private static final GPS_NO_RESPONSE_TIME_OUT:I = 0x1

.field private static final NEGATIVE_BUTTON:I = -0x2

.field private static final POSITIVE_BUTTON:I = -0x1

.field private static final TAG:Ljava/lang/String; = "NetInitiatedActivity"

.field private static final VERBOSE:Z = false

.field private static final WAKELOCK_KEY:Ljava/lang/String; = "NetInitiatedActivity"

.field private static mWakeLock:Landroid/os/PowerManager$WakeLock;

# instance fields
.field private default_response:I

.field private default_response_timeout:I

.field private final mHandler:Landroid/os/Handler;

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

.field private mNetInitiatedReceiver:Landroid/content/BroadcastReceiver;

.field private notificationId:I

.field private timeout:I

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    const/4 v0, -0x1

    .line 40
    invoke-direct {p0}, Lcom/android/internal/app/AlertActivity;-><init>()V

    .line 52
    iput v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    .line 53
    iput v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->timeout:I

    .line 54
    iput v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->default_response:I

    .line 55
    const/4 v0, 0x6

    iput v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->default_response_timeout:I

    .line 61
    new-instance v0, Ljava/lang/Object;

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

    iput-object v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->mLock:Ljava/lang/Object;

    .line 67
    new-instance v0, Lcom/android/internal/app/NetInitiatedActivity$1;

    invoke-direct {v0, p0}, Lcom/android/internal/app/NetInitiatedActivity$1;-><init>(Lcom/android/internal/app/NetInitiatedActivity;)V

    iput-object v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->mNetInitiatedReceiver:Landroid/content/BroadcastReceiver;

    .line 77
    new-instance v0, Lcom/android/internal/app/NetInitiatedActivity$2;

    invoke-direct {v0, p0}, Lcom/android/internal/app/NetInitiatedActivity$2;-><init>(Lcom/android/internal/app/NetInitiatedActivity;)V

    iput-object v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->mHandler:Landroid/os/Handler;

    return-void
.end method

.method static synthetic access$000(Lcom/android/internal/app/NetInitiatedActivity;Landroid/content/Intent;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 40
    invoke-direct {p0, p1}, Lcom/android/internal/app/NetInitiatedActivity;->handleNIVerify(Landroid/content/Intent;)V

    return-void
.end method

.method static synthetic access$100(Lcom/android/internal/app/NetInitiatedActivity;)I
    .locals 1
    .parameter "x0"

    .prologue
    .line 40
    iget v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    return v0
.end method

.method static synthetic access$200(Lcom/android/internal/app/NetInitiatedActivity;)I
    .locals 1
    .parameter "x0"

    .prologue
    .line 40
    iget v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->default_response:I

    return v0
.end method

.method static synthetic access$300(Lcom/android/internal/app/NetInitiatedActivity;I)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 40
    invoke-direct {p0, p1}, Lcom/android/internal/app/NetInitiatedActivity;->sendUserResponseLocked(I)V

    return-void
.end method

.method private handleNIVerify(Landroid/content/Intent;)V
    .locals 4
    .parameter "intent"

    .prologue
    .line 182
    const-string/jumbo v1, "notif_id"

    const/4 v2, -0x1

    invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    .line 183
    .local v0, notifId:I
    iget-object v2, p0, Lcom/android/internal/app/NetInitiatedActivity;->mLock:Ljava/lang/Object;

    monitor-enter v2

    .line 184
    :try_start_0
    iput v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    .line 185
    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 187
    const-string v1, "NetInitiatedActivity"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "handleNIVerify action: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 188
    return-void

    .line 185
    :catchall_0
    move-exception v1

    :try_start_1
    monitor-exit v2
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method

.method private sendUserResponseLocked(I)V
    .locals 4
    .parameter "response"

    .prologue
    .line 168
    const-string v1, "NetInitiatedActivity"

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string/jumbo v3, "sendUserResponse, response: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 169
    const-string v1, "location"

    invoke-virtual {p0, v1}, Lcom/android/internal/app/NetInitiatedActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/location/LocationManager;

    .line 171
    .local v0, locationManager:Landroid/location/LocationManager;
    iget v1, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    invoke-virtual {v0, v1, p1}, Landroid/location/LocationManager;->sendNiResponse(II)Z

    .line 174
    sget-object v1, Lcom/android/internal/app/NetInitiatedActivity;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->isHeld()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 175
    const-string v1, "NetInitiatedActivity"

    const-string v2, "Releasing wakelock"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 176
    sget-object v1, Lcom/android/internal/app/NetInitiatedActivity;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->release()V

    .line 179
    :cond_0
    return-void
.end method

.method private showNIError()V
    .locals 2

    .prologue
    .line 191
    const-string v0, "NI error"

    const/4 v1, 0x1

    invoke-static {p0, v0, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 193
    return-void
.end method

# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 3
    .parameter "dialog"
    .parameter "which"

    .prologue
    const/4 v2, -0x1

    .line 148
    iget-object v1, p0, Lcom/android/internal/app/NetInitiatedActivity;->mLock:Ljava/lang/Object;

    monitor-enter v1

    .line 149
    :try_start_0
    iget v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    if-eq v0, v2, :cond_2

    .line 150
    if-ne p2, v2, :cond_0

    .line 151
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/android/internal/app/NetInitiatedActivity;->sendUserResponseLocked(I)V

    .line 153
    :cond_0
    const/4 v0, -0x2

    if-ne p2, v0, :cond_1

    .line 154
    const/4 v0, 0x2

    invoke-direct {p0, v0}, Lcom/android/internal/app/NetInitiatedActivity;->sendUserResponseLocked(I)V

    .line 158
    :cond_1
    invoke-virtual {p0}, Lcom/android/internal/app/NetInitiatedActivity;->finish()V

    .line 159
    const/4 v0, -0x1

    iput v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    .line 161
    :cond_2
    monitor-exit v1

    .line 162
    return-void

    .line 161
    :catchall_0
    move-exception v0

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 9
    .parameter "savedInstanceState"

    .prologue
    const/4 v8, 0x1

    const/4 v7, 0x0

    .line 94
    invoke-super {p0, p1}, Lcom/android/internal/app/AlertActivity;->onCreate(Landroid/os/Bundle;)V

    .line 97
    invoke-virtual {p0}, Lcom/android/internal/app/NetInitiatedActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    .line 98
    .local v1, intent:Landroid/content/Intent;
    iget-object v3, p0, Lcom/android/internal/app/AlertActivity;->mAlertParams:Lcom/android/internal/app/AlertController$AlertParams;

    .line 99
    .local v3, p:Lcom/android/internal/app/AlertController$AlertParams;
    invoke-virtual {p0}, Lcom/android/internal/app/NetInitiatedActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 100
    .local v0, context:Landroid/content/Context;
    const v5, 0x10802bf

    iput v5, v3, Lcom/android/internal/app/AlertController$AlertParams;->mIconId:I

    .line 101
    const-string/jumbo v5, "title"

    invoke-virtual {v1, v5}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/android/internal/app/AlertController$AlertParams;->mTitle:Ljava/lang/CharSequence;

    .line 102
    const-string/jumbo v5, "message"

    invoke-virtual {v1, v5}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/android/internal/app/AlertController$AlertParams;->mMessage:Ljava/lang/CharSequence;

    .line 103
    const v5, 0x104047c

    invoke-virtual {v0, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v5

    new-array v6, v7, [Ljava/lang/Object;

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/android/internal/app/AlertController$AlertParams;->mPositiveButtonText:Ljava/lang/CharSequence;

    .line 104
    iput-object p0, v3, Lcom/android/internal/app/AlertController$AlertParams;->mPositiveButtonListener:Landroid/content/DialogInterface$OnClickListener;

    .line 105
    const v5, 0x104047d

    invoke-virtual {v0, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v5

    new-array v6, v7, [Ljava/lang/Object;

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    iput-object v5, v3, Lcom/android/internal/app/AlertController$AlertParams;->mNegativeButtonText:Ljava/lang/CharSequence;

    .line 106
    iput-object p0, v3, Lcom/android/internal/app/AlertController$AlertParams;->mNegativeButtonListener:Landroid/content/DialogInterface$OnClickListener;

    .line 108
    const-string/jumbo v5, "notif_id"

    const/4 v6, -0x1

    invoke-virtual {v1, v5, v6}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v5

    iput v5, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    .line 109
    const-string/jumbo v5, "timeout"

    iget v6, p0, Lcom/android/internal/app/NetInitiatedActivity;->default_response_timeout:I

    invoke-virtual {v1, v5, v6}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v5

    iput v5, p0, Lcom/android/internal/app/NetInitiatedActivity;->timeout:I

    .line 110
    const-string v5, "default_resp"

    invoke-virtual {v1, v5, v8}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v5

    iput v5, p0, Lcom/android/internal/app/NetInitiatedActivity;->default_response:I

    .line 111
    const-string v5, "NetInitiatedActivity"

    new-instance v6, Ljava/lang/StringBuilder;

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

    const-string/jumbo v7, "onCreate() : notificationId: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget v7, p0, Lcom/android/internal/app/NetInitiatedActivity;->notificationId:I

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " timeout: "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget v7, p0, Lcom/android/internal/app/NetInitiatedActivity;->timeout:I

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, " default_response:"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget v7, p0, Lcom/android/internal/app/NetInitiatedActivity;->default_response:I

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 113
    iget-object v5, p0, Lcom/android/internal/app/NetInitiatedActivity;->mHandler:Landroid/os/Handler;

    iget-object v6, p0, Lcom/android/internal/app/NetInitiatedActivity;->mHandler:Landroid/os/Handler;

    invoke-virtual {v6, v8}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v6

    iget v7, p0, Lcom/android/internal/app/NetInitiatedActivity;->timeout:I

    mul-int/lit16 v7, v7, 0x3e8

    int-to-long v7, v7

    invoke-virtual {v5, v6, v7, v8}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z

    .line 114
    invoke-virtual {p0}, Lcom/android/internal/app/NetInitiatedActivity;->setupAlert()V

    .line 117
    sget-object v5, Lcom/android/internal/app/NetInitiatedActivity;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    if-nez v5, :cond_0

    .line 118
    move-object v2, p0

    .line 119
    .local v2, mContext:Landroid/content/Context;
    const-string/jumbo v5, "power"

    invoke-virtual {v2, v5}, Lcom/android/internal/app/NetInitiatedActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/os/PowerManager;

    .line 120
    .local v4, powerManager:Landroid/os/PowerManager;
    const v5, 0x1000000a

    const-string v6, "NetInitiatedActivity"

    invoke-virtual {v4, v5, v6}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;

    move-result-object v5

    sput-object v5, Lcom/android/internal/app/NetInitiatedActivity;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    .line 123
    .end local v2           #mContext:Landroid/content/Context;
    .end local v4           #powerManager:Landroid/os/PowerManager;
    :cond_0
    sget-object v5, Lcom/android/internal/app/NetInitiatedActivity;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v5}, Landroid/os/PowerManager$WakeLock;->isHeld()Z

    move-result v5

    if-nez v5, :cond_1

    .line 124
    const-string v5, "NetInitiatedActivity"

    const-string v6, "Acquiring wakelock"

    invoke-static {v5, v6}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 125
    sget-object v5, Lcom/android/internal/app/NetInitiatedActivity;->mWakeLock:Landroid/os/PowerManager$WakeLock;

    invoke-virtual {v5}, Landroid/os/PowerManager$WakeLock;->acquire()V

    .line 128
    :cond_1
    return-void
.end method

.method protected onPause()V
    .locals 2

    .prologue
    .line 139
    invoke-super {p0}, Lcom/android/internal/app/AlertActivity;->onPause()V

    .line 140
    const-string v0, "NetInitiatedActivity"

    const-string/jumbo v1, "onPause"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 141
    iget-object v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->mNetInitiatedReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {p0, v0}, Lcom/android/internal/app/NetInitiatedActivity;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 142
    return-void
.end method

.method protected onResume()V
    .locals 3

    .prologue
    .line 132
    invoke-super {p0}, Lcom/android/internal/app/AlertActivity;->onResume()V

    .line 133
    const-string v0, "NetInitiatedActivity"

    const-string/jumbo v1, "onResume"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 134
    iget-object v0, p0, Lcom/android/internal/app/NetInitiatedActivity;->mNetInitiatedReceiver:Landroid/content/BroadcastReceiver;

    new-instance v1, Landroid/content/IntentFilter;

    const-string v2, "android.intent.action.NETWORK_INITIATED_VERIFY"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0, v0, v1}, Lcom/android/internal/app/NetInitiatedActivity;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 135
    return-void
.end method


text:
package mva2.adapter.testconfig;

public class Header {

  private final String test;

  public Header(String test) {
    this.test = test;
  }

  public String getTest() {
    return test;
  }
}


text:
I'm a page that click a mismatching regular link.

Mismatching regular link


text:
/* globals angular */
angular.module('formula').directive('formulaField', ['$compile', 'formulaClassService', 'formulaI18n',
  function($compile, formulaClassService, i18n) {
    "use strict";

    return {
      restrict: 'AE',
      scope: {
        field: '='
      },
      link: function(scope, iElement, iAttrs) {
        var field = scope.field;
        iElement.addClass(formulaClassService.pathClass(field));
        iElement.addClass(formulaClassService.schemaClass(field));
        if (field.required) {
          iElement.addClass('required');
        }
        scope.i18n = i18n;
        scope.$watch('field.template', function (template) {
          if (!field.hidden && field.template) {
            iElement.html(field.template);
            $compile(iElement.contents())(scope);
            field._elem_q.resolve(iElement);
          } else {
            field._elem_q.reject(iElement);
          }
        });
      },
    };
  }
]);


text:
# [Laravel](https://laravel.com) + [Keen.io](https://keen.io)

Defer sending event data to [Keen.io](https://keen.io) until after a request
has been fulfilled–automatically and transparently.

[![Latest Stable Version](https://poser.pugx.org/frnkly/laravel-keen/version)](https://packagist.org/packages/frnkly/laravel-keen)
[![Build Status](https://travis-ci.org/frnkly/laravel-keen.png)](https://travis-ci.org/frnkly/laravel-keen)
[![Total Downloads](https://poser.pugx.org/frnkly/laravel-keen/downloads)](https://packagist.org/packages/frnkly/laravel-keen)
[![License](https://poser.pugx.org/frnkly/laravel-keen/license)](https://packagist.org/packages/frnkly/laravel-keen)

This package provides a light wrapper around the
[Keen PHP client](https://github.com/keenlabs/KeenClient-PHP), as well as a
middleware configured to defer sending event data to Keen until after each
request has been fulfilled. That means that as the number of tracked events
increase, the impact on request time remains virtually non-existent.
For convenience, the middleware can also track every request automatically.

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Getting started](#getting-started)
- [Automatic tracking of every request](#automatic-tracking-of-every-request)
    - [Data enrichment](#data-enrichment)
    - [Using your own middleware](#using-your-own-middleware)
    - [Skipping requests](#skipping-requests)
- [Type-hinting](#type-hinting)

# Features

- [x] Deferred event tracking :raised_hands:
- [x] Optional automatic tracking of every request
- [x] Support data enrichment out of the box
    - [x] [IP to Geo](https://keen.io/docs/streams/ip-to-geo-enrichment)
    - [x] [User Agent](https://keen.io/docs/streams/user-agent-enrichment)
    - [x] [Referrer](https://keen.io/docs/streams/referrer-enrichment)
- [x] Extensible middleware
- [x] Option to ignore specific HTTP status codes (e.g. `100`, `302`, etc.)
    - [x] Or any request based on custom logic
- [ ] More to come!

# Installation

Install the Laravel + Keen package using [Composer](https://getcomposer.org):

    $ composer require frnkly/laravel-keen

This will also install the Keen PHP client as a dependency.

# Configuration

Your Keen project ID and keys should be defined in the `config/services.php`
configuration file, but will usually come from the
[environment configuration](https://laravel.com/docs/configuration):

```php
return [
    // Other 3rd-party Services
    // ...

    // Add your Keen information here
    'keen' => [
        'id'     => env('KEEN_PROJECT_ID'),
        'master' => env('KEEN_MASTER_KEY'),
        'write'  => env('KEEN_WRITE_KEY'),
    ],
];
```

And in your `.env` file, you might add something like:

```
KEEN_PROJECT_ID=your-project-id
KEEN_MASTER_KEY=your-master-key
KEEN_WRITE_KEY=your-write-key
```

# Getting started

Register the middleware globally in `app/Http/Kernel.php`:

```php
protected $middleware = [
    // Other Middleware
    // ...

    \Frnkly\LaravelKeen\Middleware::class,
];
```

Or within a middleware group:

```php
protected $middlewareGroups = [
    'web' => [
        // Other "Web" Middleware
        // ...

        \Frnkly\LaravelKeen\Middleware::class,
    ],

    'api' => [
        // Other "API" Middleware
        // ...

        \Frnkly\LaravelKeen\Middleware::class,
    ],
];
```

Thanks to [package discovery](https://laravel.com/docs/packages#package-discovery)
in Laravel 5.5, the service provider should already be available. It can
also be manually registered through the `config/app.php` configuration file:

```php
'providers' => [
    // Other Service Providers
    // ...

    Frnkly\LaravelKeen\ServiceProvider::class,
]
```

# Automatic tracking of every request

Automatic tracking is enabled by default. You may disable this behaviour
through the configuration file:

```php
'keen' => [
    // Other Keen options
    // ...

    'track_requests' => false,
],
```

## Data enrichment
To automatically add [data enrichment](https://keen.io/docs/api/?php#data-enrichment)
to each request, use the following configuration options:

```php
'keen' => [
    // Other Keen settings
    // ...

    'addons' => [
        'ip_to_geo'       => true,  // IP to Geo parser
        'ua_parser'       => true,  // User Agent parser
        'referrer_parser' => true,  // Referrer parser
    ],
],
```

Each data enrichment object will appear in your Keen stream under the same
name as above (i.e. `ip_to_geo` and `ua_parser`).

## Using your own middleware

The included middleware makes it simple to extend and gain more
granular control over the data that gets sent to Keen. You can create your own
middleware using `Artisan`, and then have it extend
`\Frnkly\LaravelKeen\Middleware`:

    $ php artisan make:middleware TracksRequests

Inside the new middleware, override the protected method
`buildRequestEventData`:

```php
<?php

namespace App\Http\Middleware;

class TracksRequests extends \Frnkly\LaravelKeen\Middleware
{
    /**
     * Data for "request" event.
     *
     * @param \Illuminate\Http\Request  $request
     * @param \Illuminate\Http\Response $response
     */
    protected function buildRequestEventData($request, $response)
    {
        parent::buildRequestEventData($request, $response);

        // Add or overwrite values.
        $host      = 'staging';
        $overwrite = true;
        $this->client->addRequestEventData('host', $host, $overwrite)

        // Add parameters to array values.
        ->addRequestEventParams([
            'user' => $request->user()->id
        ])
        ->addRequestEventParams([
            'mime' => $request->getMimeType('html')
        ], 'response')

        // Add data enrichment.
        ->addRequestEventData('target_url', 'https://example.com')
        ->enrichRequestEvent([
            'name'  => 'url_parser',
            'output'=> 'url_parser',
            'input' => ['url' => 'target_url']
        ]);
    }
}
```

Remember to update your `app/Http/Kernel.php` file to use your own middleware
class instead of the pre-configured one.

## Skipping requests

Some response codes do not need to be tracked, such as redirects. You
can configure a list of response codes to ignore in your middleware:

```php
/**
 * @var array
 */
protected $skipResponseCodes = [
    100,
    101,
    301,
    302,
    307,
    308,
];
```

You may also override the `shouldRun` method in the middleware:

```php
/**
 * Determines if the middleware should run or not.
 *
 * @param  \Illuminate\Http\Request  $request
 * @param  \Illuminate\Http\Response $response
 * @return bool
 */
protected function shouldRun($request, $response) : bool
{
    if (! parent::shouldRun($request, $response)) {
        return false;
    }

    // Define your own custom logic here.
    // ...

    return true;
}
```

# Type-hinting

The LaravelKeen client can be [type-hinted](https://laravel.com/docs/container#automatic-injection)
in the constructor of any class that is resolved by the container:

```php
namespace App\Events;

use App\Events\OrderShipped;
use Frnkly\LaravelKeen\Client;

class OrderShipped
{
    private $client;

    public function __construct(Client $client)
    {
        // The client can now be accessed by all methods in this class.
        $this->client = $client;
    }

    public function handle(OrderShipped $event)
    {
        // By adding a deferred event, we can continue working on the request
        // without waiting on a reply back from Keen.io. The event will be
        // processed once the request is done–automatically and transparently.
        $this->client->addDeferredEvent('order-shipped', [
            // Event data...
        ]);
    }
}
```

Controllers can also take advantage of method injection:

```php
use Frnkly\LaravelKeen\Client;

class UserController extends Controller
{
    public function store(Client $client)
    {
        $client->addDeferredEvent('new-user', [
            // Event data...
        ]);
    }
}
```

-----------

This project is licensed under the
[MIT license](https://github.com/frnkly/laravel-keen/blob/dev/LICENSE).

I'd love to hear your comments or questions about this project. If you have
an idea on how to improve it,
[create an issue](https://github.com/frnkly/laravel-keen/issues/new) or
[get in touch](https://frnk.ca).


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/dark_gray"
    android:clickable="true"
    android:focusable="true"
    android:padding="16dp"
    android:visibility="gone"
    app:layout_constraintTop_toTopOf="parent"
    tools:visibility="visible">

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline_middle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.3" />

    <CheckBox
        android:id="@+id/use_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/duplicate_use_title"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <CheckBox
        android:id="@+id/use_cover"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="@string/duplicate_use_cover"
        app:layout_constraintStart_toEndOf="@id/guideline_middle"
        app:layout_constraintTop_toTopOf="parent" />

    <CheckBox
        android:id="@+id/use_artist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="@string/duplicate_use_artist"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/use_cover" />

    <CheckBox
        android:id="@+id/use_same_language"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="@string/duplicate_use_same_language"
        app:layout_constraintStart_toEndOf="@id/guideline_middle"
        app:layout_constraintTop_toBottomOf="@id/use_cover" />

    <CheckBox
        android:id="@+id/ignore_chapters"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:checked="true"
        android:text="@string/duplicate_ignore_chapters"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/use_same_language" />

    <TextView
        android:id="@+id/use_sensitivity_txt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:checked="true"
        android:text="@string/duplicate_use_sensitivity"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/ignore_chapters" />

    <com.skydoves.powerspinner.PowerSpinnerView
        android:id="@+id/use_sensitivity"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:background="@drawable/bg_spinner_border"
        android:gravity="center_vertical"
        app:layout_constraintBottom_toBottomOf="@id/use_sensitivity_txt"
        app:layout_constraintStart_toEndOf="@id/use_sensitivity_txt"
        app:layout_constraintTop_toTopOf="@id/use_sensitivity_txt"
        app:spinner_arrow_gravity="end"
        app:spinner_arrow_padding="8dp"
        app:spinner_arrow_tint="@color/white_opacity_66"
        app:spinner_divider_show="true"
        app:spinner_divider_size="0.4dp"
        app:spinner_popup_background="@color/dark_gray"
        app:spinner_popup_elevation="14dp" />

    <TextView
        android:id="@+id/scan_fab"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_marginTop="16dp"
        android:background="@drawable/bg_fab_extended"
        android:drawablePadding="12dp"
        android:gravity="center"
        android:paddingStart="12dp"
        android:paddingEnd="20dp"
        android:text="@string/duplicate_find_action"
        app:drawableStartCompat="@drawable/ic_search"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/use_sensitivity" />

    <TextView
        android:id="@+id/stop_fab"
        android:layout_width="wrap_content"
        android:layout_height="48dp"
        android:layout_marginTop="16dp"
        android:background="@drawable/bg_fab_extended"
        android:gravity="center"
        android:paddingStart="28dp"
        android:paddingEnd="28dp"
        android:text="@string/stop"
        android:visibility="invisible"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/use_sensitivity" />

    <TextView
        android:id="@+id/index_pictures_txt"
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        android:checked="true"
        android:paddingTop="16dp"
        android:text="@string/duplicate_index_covers"
        android:visibility="gone"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/scan_fab"
        tools:visibility="visible" />

    <ProgressBar
        android:id="@+id/index_pictures_pb"
        style="@style/Widget.AppCompat.ProgressBar.Horizontal"
        android:layout_width="0dp"
        android:layout_height="4dp"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/index_pictures_txt"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/index_pictures_txt"
        app:layout_constraintTop_toTopOf="@id/index_pictures_txt"
        tools:visibility="visible" />

    <TextView
        android:id="@+id/index_pictures_pb_txt"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textSize="@dimen/caption"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/index_pictures_txt"
        app:layout_constraintEnd_toEndOf="@id/index_pictures_pb"
        app:layout_constraintStart_toStartOf="@id/index_pictures_pb"
        app:layout_constraintTop_toTopOf="@id/index_pictures_txt"
        tools:text="4816/6755"
        tools:visibility="visible" />

    <TextView
        android:id="@+id/detect_books_txt"
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:checked="true"
        android:text="@string/duplicate_find"
        android:visibility="gone"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/index_pictures_txt"
        tools:visibility="visible" />

    <ProgressBar
        android:id="@+id/detect_books_pb"
        style="@style/Widget.AppCompat.ProgressBar.Horizontal"
        android:layout_width="0dp"
        android:layout_height="4dp"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/detect_books_txt"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/detect_books_txt"
        app:layout_constraintTop_toTopOf="@id/detect_books_txt"
        tools:visibility="visible" />

    <TextView
        android:id="@+id/detect_books_pb_txt"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textSize="@dimen/caption"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/detect_books_txt"
        app:layout_constraintEnd_toEndOf="@id/detect_books_pb"
        app:layout_constraintStart_toStartOf="@id/detect_books_pb"
        app:layout_constraintTop_toTopOf="@id/detect_books_txt"
        tools:text="@string/duplicate_wait_index"
        tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_enabled="false" android:color="@color/neutral_4" />
  <item android:color="@color/ms_black" />
</selector>


text:
layout: page
title: Tags
header: Posts By Tag
categories: ["Consigninator"]
group: navigation_old
nav_home_class: ""
nav_blog_class: ""
nav_archive_class: ""
nav_tags_class: "active"
emptyArray: []
---
{% include JB/setup %}
{% include JB/is_multiblog %}

{% assign empty_array = page.emptyArray %}
{% include JB/tags_summary-multiblog %}


text:
import os
from distutils.core import setup

# setup taken from shablona outline
ver_file = os.path.join('skedm', 'version.py')
with open(ver_file) as f:
    exec(f.read())

opts = dict(name=NAME,
            maintainer=MAINTAINER,
            maintainer_email=MAINTAINER_EMAIL,
            description=DESCRIPTION,
            long_description=LONG_DESCRIPTION,
            url=URL,
            download_url=DOWNLOAD_URL,
            license=LICENSE,
            classifiers=CLASSIFIERS,
            author=AUTHOR,
            author_email=AUTHOR_EMAIL,
            platforms=PLATFORMS,
            version=VERSION,
            packages=PACKAGES,
            #package_data=PACKAGE_DATA,
            requires=REQUIRES)

if __name__ == '__main__':
    setup(**opts)


text:
module CommentsController
end

module CommentsGridController
  def grid_columns
    super
    column('', html: true) do |record|
      link_to('Replies', @parent_records + [record, :replies])
    end
  end
end


text:
<?php

namespace SystemUsersBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ResourcesType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('controllerName')
            ->add('actionName')
            ->add('routeName')
            ->add('status')
            ->add('createdAt')
            ->add('updatedAt')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'SystemUsersBundle\Entity\Resources'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'systemusersbundle_resources';
    }
}


text:
<?xml version="1.0"?>
<resource>
  <metadata>
    <uri>http://dvorka/e-mentality/concept/MR_Documentation#Launching_</uri>
    <author>dvorka</author>
    <created>1107644482598</created>
    <revision>8</revision>
    <timestamp>1109677537040</timestamp>
    <type>http://e-mental.com/mindraider/owl/class#Concept</type>
    <mr>0.506</mr>
  </metadata>
  <data>
    <notebookProperty>
      <uri>http://dvorka/e-mentality/notebook#MR_Documentation</uri>
    </notebookProperty>
    <labelProperty>Launching</labelProperty>
    <annotationProperty>You may open node/literal URLs by double-clicking a node in graph. All launchable nodes are marked with "rocket" icon.</annotationProperty>
    <parentConceptUri>http://dvorka/e-mentality/concept/MR_Documentation#Graph_Navigation</parentConceptUri>
    <propertyGroup uri="com:e-mental:mindraider:folder:notebook:concept:attachments" label="Attachments" />
  </data>
</resource>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Intern Weekenders</title>

    <link href="static/css/bootstrap.min.css" rel="stylesheet">

    <link href="static/css/business-casual.css" rel="stylesheet">

    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">

Intern Weekenders

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>

                Intern Weekenders

                        Home

                        Sites

                        Contact

                    {% if user.email %}
                        logout
                    {% else %}
                        login
                    {% endif %}

 {{ post['title'] }}

 {{ post ['date'] }} -- {{ post['location'] }} -- {{ post['expense'] }} -- {{ post['activity'] }} -- {{ post['crowd'] }}

 {{ post['blog'] }}

					<form action="{{ url_for('comment', comment_id = '1234random') }}" method=post role="form">

                                <input type="text" name=title class="form-control" placeholder="Subject of your comment">

                                <textarea class="form-control" name=comment rows="6" placeholder="Leave a comment here!"></textarea>

                                <input type="hidden" name="save" value="contact">
                                <button type="submit" class="btn btn-default" style="color:blue">Post</button>

                    </form>

				{% for comment in comments %}

								{{ comment['comment_text'] }}

				{% endfor %}

Copyright © InternWeekenders 2015


text:
package sun.bob.mcalendar.fragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import sun.bob.mcalendar.R;

import sun.bob.mcalendar.adapters.DayAdapter;
import sun.bob.mcalendar.adapters.TaskAdapter;
import sun.bob.mcalendar.adapters.OnTaskClickListener;
import sun.bob.mcalendar.content.CalendarResolver;

/**
 * Created by bob.sun on 15/10/21.
 */
public class FragmentTask extends Fragment {
//    TaskAdapter taskAdapter;
    DayAdapter dayAdapter;
    public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState){
        View ret = inflater.inflate(R.layout.fragment_task, null);
        RecyclerView recyclerView = (RecyclerView) ret.findViewById(R.id.id_task_list);
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this.getActivity());
        recyclerView.setLayoutManager(layoutManager);
//        if (taskAdapter == null)
//            taskAdapter = new TaskAdapter(this.getActivity());
//        recyclerView.setAdapter(taskAdapter);
        if (dayAdapter == null){
            CalendarResolver.getStaticInstance(getActivity()).refreshAllEvents();
            dayAdapter = new DayAdapter(getActivity());
        }
        recyclerView.setAdapter(dayAdapter);
        return ret;
    }
}


text:
<?php

namespace Company\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Session\Container;
use Admin\Model\common;
class IndexController extends AbstractActionController {
    protected $authservice;
    public $session;
    public function __construct($user) {
        $this->session = new Container('User');
        $this->userObj = $user;
    }

    public function indexAction() {

        $request = $this->getRequest();
        $view = new ViewModel();
        if ($request->isPost()) {
            $params = array();
            $inputParams = $request->getPost();
            $params['password'] = md5($inputParams['password']);
            $params['username'] = $inputParams['username'];
            $method = 'loginuser';
            $response = json_decode($this->userObj->userAuthenticate($params, $method));
            if ($response->status == 'success') {
                $this->session->offsetSet('user', $response);
                $this->session['userDetail'] = $response;
                return $this->redirect()->toUrl($GLOBALS['SITE_ADMIN_URL'].'dashboard');
            } else {
                $this->flashMessenger()->addMessage(array('error' => 'invalid credentials.'));
            }
        }
        return $this->redirect()->toUrl($GLOBALS['SITE_ADMIN_URL'].'index/login');
    }
    public function loginAction() {
        $viewModel = new ViewModel();
        return $viewModel;
    }
/*    public function logoutAction()
    {
        $this->session->offsetUnset('user');
        unset($this->session['userDetail']);
        $this->redirect()->toUrl($GLOBALS['SITE_ADMIN_URL'].'index/login');
    }    */
}


text:
<!DOCTYPE html >

          <meta http-equiv="X-UA-Compatible" content="IE=edge" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
          <title></title>
          <meta name="description" content="" />
          <meta name="keywords" content="" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

        < Back

            <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
            
            

Packages

        

        package

              root

Definition Classes

root

        

        package

              kr

Definition Classes

root

        

        package

              bydelta

Definition Classes

kr

        

        package

              koala

각 Package의 Parser와 Tagger를 참조하세요.

 KoalaNLP

 통합 Scala 한국어 분석기, Koala

각 Package의 Parser와 Tagger를 참조하세요.

Definition Classes

bydelta

        

        package

              twt

Package for OpenKoreanText tagger

Package for OpenKoreanText tagger

Definition Classes

koala

Note

Dependencies: OpenKoreanText v2.1.2 (For Scala 2.12+) or TwitterKoreanProcessor v4.4.4 (For Scala 2.11)

See also

kr.bydelta.koala.twt.Dictionary for using user-defined dictionary.

kr.bydelta.koala.twt.Tagger for POS tagging

kr.bydelta.koala.twt.SentenceSplitter for segmenting sentences

                          Dictionary

                          JavaDictionary

                          SentenceSplitter

                          Tagger

o

kr.bydelta.koala.twt

Dictionary

        

        object

        Dictionary extends CanCompileDict

트위터 분석기 사용자사전

            Linear Supertypes

CanCompileDict, AnyRef, Any

          

            <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />

          

            Ordering

Alphabetic

By Inheritance

                  Inherited

Dictionary

CanCompileDict

AnyRef

Any

Hide All

Show All

              Visibility

Public

All

Value Members

        

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        def

        addUserDictionary(dict: (String, POSTag)*): Unit

사용자 사전에, (표면형,품사)의 여러 순서쌍을 추가.

사용자 사전에, (표면형,품사)의 여러 순서쌍을 추가.

dict

추가할 (표면형,품사)의 순서쌍.

Definition Classes

Dictionary → CanCompileDict

        

        def

        addUserDictionary(morph: String, tag: POSTag): Unit

사용자 사전에, 표면형과 그 품사를 추가.

사용자 사전에, 표면형과 그 품사를 추가.

morph

표면형.

tag

품사.

Definition Classes

CanCompileDict

        

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        

        def

        baseEntriesOf(filter: (POSTag) ⇒ Boolean): Iterator[(String, POSTag)]

원본 사전에 등재된 항목 중에서, 지정된 형태소의 항목만을 가져옵니다.

원본 사전에 등재된 항목 중에서, 지정된 형태소의 항목만을 가져옵니다. (복합 품사 결합 형태는 제외)

filter

가져올 품사인지 판단하는 함수.

returns

(형태소, 품사)의 Iterator.

Definition Classes

Dictionary → CanCompileDict

        

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        def

        contains(word: String, posTag: Set[POSTag] = Set(POS.NNP, POS.NNG)): Boolean

사전에 등재되어 있는지 확인합니다.

사전에 등재되어 있는지 확인합니다.

word

확인할 형태소

posTag

품사들(기본값: NNP 고유명사, NNG 일반명사)

Definition Classes

CanCompileDict

        

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        

        def

        getNotExists(dummy: Boolean, word: (String, POSTag)*): Seq[(String, POSTag)]

사전에 등재되어 있는지 확인하고, 사전에 없는단어만 반환합니다.

사전에 등재되어 있는지 확인하고, 사전에 없는단어만 반환합니다.

dummy

(제공하지 않는 기능.)

word

확인할 (형태소, 품사)들.

returns

사전에 없는 단어들.

Definition Classes

Dictionary → CanCompileDict

        

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        

        def

        importFrom(dict: CanCompileDict, filter: (POSTag) ⇒ Boolean = POS.isNoun, fastAppend: Boolean = false): Unit

다른 사전을 참조하여, 선택된 사전에 없는 단어를 사용자사전으로 추가합니다.

다른 사전을 참조하여, 선택된 사전에 없는 단어를 사용자사전으로 추가합니다.

dict

참조할 사전

filter

추가할 품사를 지정하는 함수.

fastAppend

선택된 사전에 존재하는지를 검사하지 않고, 빠르게 추가하고자 할 때 (기본값 false)

Definition Classes

CanCompileDict

        

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        

        def

        items: Set[(String, POSTag)]

사용자 사전에 등재된 모든 Item을 불러옵니다.

사용자 사전에 등재된 모든 Item을 불러옵니다.

returns

(형태소, 통합품사)의 Sequence.

Definition Classes

Dictionary → CanCompileDict

        

        def

        jUserDictionary(morphs: List[String], tags: List[POSTag]): Unit

(Java) 사용자 사전에, (표면형,품사)의 여러 순서쌍을 추가.

(Java) 사용자 사전에, (표면형,품사)의 여러 순서쌍을 추가.

morphs

추가할 단어의 표면형의 목록.

tags

추가할 단어의 품사의 목록.

Definition Classes

CanCompileDict

        

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        

        def

        toString(): String

Definition Classes

AnyRef → Any

        

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from CanCompileDict

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
class CreateRubberRingPageContents < ActiveRecord::Migration
  def change
    create_table :rubber_ring_page_contents do |t|
      t.string :key
      t.string :value
      t.references :page, index: true

      t.timestamps
    end
  end
end


text:
typedef enum : NSUInteger {
    PullToRefreshPosition_Top,
    PullToRefreshPosition_Bottom,
} PullToRefreshPosition;

typedef enum : NSUInteger {
    PullToRefreshState_initial,
    PullToRefreshState_releasing,
    PullToRefreshState_loading,
    PullToRefreshState_finished,
} PullToRefreshState;

@protocol PullToRefreshViewAnimator <NSObject>

-(void)animator:(PullToRefreshState)state any:(_Nullable id)any;

@end

@interface PullToRefresh : UIView

@property(nonatomic,assign) PullToRefreshPosition position;
@property(weak,nonatomic) UIScrollView * _Nullable scrollView;
@property(nonatomic,weak) id <PullToRefreshViewAnimator> refreshView;
@property (nonatomic, copy,nullable) void (^action)(void);
@property (nonatomic, assign) BOOL showsPullToRefresh;

-(void)startRefreshing;
-(void)endRefreshing;

@end


text:
//
//  PPHomeDistrictViewController.m
//  PPBuy
//
//  Created by jiaguanglei on 15/10/10.
//  Copyright (c) 2015年 roseonly. All rights reserved.
//

#import "PPHomeRegionViewController.h"

#import "PPHomeDropDown.h"
#import "PPHomeCityViewController.h"
#import "PPNavgationController.h"
#import "PPRegion.h"
#import "PPMetaTool.h"
#import "PPCity.h"

@interface PPHomeRegionViewController ()<PPHomeDropDownDataSource,PPHomeDropDownDelegate>

@property (weak, nonatomic) IBOutlet UIView *topTittle;

- (IBAction)changeCity;
@end

@implementation PPHomeRegionViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // 创建下拉菜单
    PPHomeDropDown *dropdown = [PPHomeDropDown dropdown];
    [self.view addSubview:dropdown];

    dropdown.y = self.topTittle.height;
    dropdown.dataSource = self;
    dropdown.delegate = self;

    // 设置控制器在POPover中
    self.preferredContentSize = CGSizeMake(dropdown.width, CGRectGetMaxY(dropdown.frame));

}

/**
 *  监听切换城市按钮点击
 */
- (IBAction)changeCity {
    // pop dismiss
    [self.popoverVc dismissPopoverAnimated:YES];

    PPNavgationController *navVc = [[PPNavgationController alloc] initWithRootViewController:[[PPHomeCityViewController alloc] init]];
    navVc.modalPresentationStyle = UIModalPresentationFormSheet;

// 弹出控制器 --- 不能用self modal, self.presentedViewController 对nav引用
    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:navVc animated:YES completion:^{
    }];

}

#pragma mark - PPHomeDropDownDataSource
- (NSInteger)numberOfRowsInMainTableView:(PPHomeDropDown *)homeDropdown
{
    return self.regions.count;
//    LogPurple(@"%ld",self.regions.count);
}

- (NSString *)homeDropdown:(PPHomeDropDown *)homeDropdown titleForRowInMainTableView:(NSInteger)row
{
    PPRegion *region = self.regions[row];
//    LogPurple(@"%@",region.name);
    return region.name;
}

- (NSArray *)homeDropdown:(PPHomeDropDown *)homeDropdown subDataForRowInMainTableView:(NSInteger)row
{
    PPRegion *region = self.regions[row];
//    LogPurple(@"%ld",region.subregions.count);
    return region.subregions;
}

#pragma mark - PPHomeDropDownDelegate
- (void)homeDropdown:(PPHomeDropDown *)homeDropdown didSelectedRowInMainTableView:(NSInteger)row
{
    PPRegion *region = self.regions[row];

//    LogYellow(@"%@",category.name);

    // 发通知
    if(!region.subregions.count){
        [PPNOTICEFICATION postNotificationName:PPHomeRegionVcRegionSelectedNoticefication object:nil userInfo:@{PPHomeRegionSelectedRegion : region}];
    }
}

- (void)homeDropdown:(PPHomeDropDown *)homeDropdown didSelectedRowInSubTableView:(NSInteger)subrow inMainTable:(NSInteger)mainrow
{
    // 取出主表模型
    PPRegion *region = self.regions[mainrow];
//    LogMagenta(@"%@",category.subcategories[subrow]);

    // 发通知
    [PPNOTICEFICATION postNotificationName:PPHomeRegionVcRegionSelectedNoticefication object:nil userInfo:@{PPHomeRegionSelectedRegion : region, PPHomeRegionSelectedSubRegionName : region.subregions[subrow]}];

}

- (void)dealloc
{
    [PPNOTICEFICATION removeObserver:self];
}

@end


text:
#include "core/private.h"

/*
 * notice this returns number of bytes consumed, or -1
 */
int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len)
{
	struct lws_context *context = lws_get_context(wsi);
	struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi];
	size_t real_len = len;
	unsigned int n, m;

	// lwsl_notice("%s: len %d\n", __func__, (int)len);
	// lwsl_hexdump_level(LLL_NOTICE, buf, len);

	/*
	 * Detect if we got called twice without going through the
	 * event loop to handle pending.  Since that guarantees extending any
	 * existing buflist_out it's inefficient.
	 */
	if (0 && buf && wsi->could_have_pending) {
		lwsl_hexdump_level(LLL_INFO, buf, len);
		lwsl_info("** %p: vh: %s, prot: %s, role %s: "
			 "Inefficient back-to-back write of %lu detected...\n",
			 wsi, wsi->vhost->name, wsi->protocol->name,
			 wsi->role_ops->name,
			 (unsigned long)len);
	}

	lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_API_WRITE, 1);

	/* just ignore sends after we cleared the truncation buffer */
	if (lwsi_state(wsi) == LRS_FLUSHING_BEFORE_CLOSE &&
	    !lws_has_buffered_out(wsi)
#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION)
	    && !wsi->http.comp_ctx.may_have_more
#endif
	    )
		return (int)len;

	if (buf && lws_has_buffered_out(wsi)) {
		lwsl_info("** %p: vh: %s, prot: %s, incr buflist_out by %lu\n",
			 wsi, wsi->vhost->name, wsi->protocol->name,
			 (unsigned long)len);

		/*
		 * already buflist ahead of this, add it on the tail of the
		 * buflist, then ignore it for now and act like we're flushing
		 * the buflist...
		 */

		lws_buflist_append_segment(&wsi->buflist_out, buf, len);

		buf = NULL;
		len = 0;
	}

	if (wsi->buflist_out) {
		/* we have to drain the earliest buflist_out stuff first */

		len = lws_buflist_next_segment_len(&wsi->buflist_out, &buf);
		real_len = len;

		lwsl_debug("%s: draining %d\n", __func__, (int)len);
	}

	if (!len || !buf)
		return 0;

	if (!wsi->http2_substream && !lws_socket_is_valid(wsi->desc.sockfd))
		lwsl_warn("** error invalid sock but expected to send\n");

	/* limit sending */
	if (wsi->protocol->tx_packet_size)
		n = (int)wsi->protocol->tx_packet_size;
	else {
		n = (int)wsi->protocol->rx_buffer_size;
		if (!n)
			n = context->pt_serv_buf_size;
	}
	n += LWS_PRE + 4;
	if (n > len)
		n = (int)len;

	/* nope, send it on the socket directly */
	lws_latency_pre(context, wsi);
	m = lws_ssl_capable_write(wsi, buf, n);
	lws_latency(context, wsi, "send lws_issue_raw", n, n == m);

	lwsl_info("%s: ssl_capable_write (%d) says %d\n", __func__, n, m);

	/* something got written, it can have been truncated now */
	wsi->could_have_pending = 1;

	switch (m) {
	case LWS_SSL_CAPABLE_ERROR:
		/* we're going to close, let close know sends aren't possible */
		wsi->socket_is_permanently_unusable = 1;
		return -1;
	case LWS_SSL_CAPABLE_MORE_SERVICE:
		/*
		 * nothing got sent, not fatal.  Retry the whole thing later,
		 * ie, implying treat it was a truncated send so it gets
		 * retried
		 */
		m = 0;
		break;
	}

	/*
	 * we were sending this from buflist_out?  Then not sending everything
	 * is a small matter of advancing ourselves only by the amount we did
	 * send in the buflist.
	 */
	if (lws_has_buffered_out(wsi)) {
		if (m) {
			lwsl_info("%p partial adv %d (vs %ld)\n", wsi, m,
					(long)real_len);
			lws_buflist_use_segment(&wsi->buflist_out, m);
		}

		if (!lws_has_buffered_out(wsi)) {
			lwsl_info("%s: wsi %p: buflist_out flushed\n",
				  __func__, wsi);

			m = (int)real_len;
			if (lwsi_state(wsi) == LRS_FLUSHING_BEFORE_CLOSE) {
				lwsl_info("*%p signalling to close now\n", wsi);
				return -1; /* retry closing now */
			}

#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
#if !defined(LWS_WITHOUT_SERVER)
			if (wsi->http.deferred_transaction_completed) {
				lwsl_notice("%s: partial completed, doing "
					    "deferred transaction completed\n",
					    __func__);
				wsi->http.deferred_transaction_completed = 0;
				return lws_http_transaction_completed(wsi) ?
							-1 : (int)real_len;
			}
#endif
#endif
		}
		/* always callback on writeable */
		lws_callback_on_writable(wsi);

		return m;
	}

#if defined(LWS_WITH_HTTP_STREAM_COMPRESSION)
	if (wsi->http.comp_ctx.may_have_more)
		lws_callback_on_writable(wsi);
#endif

	if (m == real_len)
		/* what we just sent went out cleanly */
		return m;

	/*
	 * We were not able to send everything... and we were not sending from
	 * an existing buflist_out.  So we are starting a fresh buflist_out, by
	 * buffering the unsent remainder on it.
	 * (it will get first priority next time the socket is writable).
	 */
	lwsl_debug("%p new partial sent %d from %lu total\n", wsi, m,
		    (unsigned long)real_len);

	lws_buflist_append_segment(&wsi->buflist_out, buf + m, real_len - m);

	lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_WRITE_PARTIALS, 1);
	lws_stats_atomic_bump(wsi->context, pt,
			      LWSSTATS_B_PARTIALS_ACCEPTED_PARTS, m);

#if !defined(LWS_WITH_ESP32)
	if (lws_wsi_is_udp(wsi)) {
		/* stash original destination for fulfilling UDP partials */
		wsi->udp->sa_pending = wsi->udp->sa;
		wsi->udp->salen_pending = wsi->udp->salen;
	}
#endif

	/* since something buffered, force it to get another chance to send */
	lws_callback_on_writable(wsi);

	return (int)real_len;
}

LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf, size_t len,
			  enum lws_write_protocol wp)
{
	struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi];

	lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_API_LWS_WRITE, 1);

	if ((int)len < 0) {
		lwsl_err("%s: suspicious len int %d, ulong %lu\n", __func__,
				(int)len, (unsigned long)len);
		return -1;
	}

	lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_B_WRITE, len);

#ifdef LWS_WITH_ACCESS_LOG
	wsi->http.access_log.sent += len;
#endif
	if (wsi->vhost)
		wsi->vhost->conn_stats.tx += len;

	assert(wsi->role_ops);
	if (!wsi->role_ops->write_role_protocol)
		return lws_issue_raw(wsi, buf, len);

	return wsi->role_ops->write_role_protocol(wsi, buf, len, &wp);
}

LWS_VISIBLE int
lws_ssl_capable_read_no_ssl(struct lws *wsi, unsigned char *buf, int len)
{
	struct lws_context *context = wsi->context;
	struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
	int n = 0;

	lws_stats_atomic_bump(context, pt, LWSSTATS_C_API_READ, 1);

	if (lws_wsi_is_udp(wsi)) {
#if !defined(LWS_WITH_ESP32)
		wsi->udp->salen = sizeof(wsi->udp->sa);
		n = recvfrom(wsi->desc.sockfd, (char *)buf, len, 0,
			     &wsi->udp->sa, &wsi->udp->salen);
#endif
	} else
		n = recv(wsi->desc.sockfd, (char *)buf, len, 0);

	if (n >= 0) {

		if (!n && wsi->unix_skt)
			return LWS_SSL_CAPABLE_ERROR;

		if (wsi->vhost)
			wsi->vhost->conn_stats.rx += n;
		lws_stats_atomic_bump(context, pt, LWSSTATS_B_READ, n);

		return n;
	}

	if (LWS_ERRNO == LWS_EAGAIN ||
	    LWS_ERRNO == LWS_EWOULDBLOCK ||
	    LWS_ERRNO == LWS_EINTR)
		return LWS_SSL_CAPABLE_MORE_SERVICE;

	lwsl_info("error on reading from skt : %d\n", LWS_ERRNO);
	return LWS_SSL_CAPABLE_ERROR;
}

LWS_VISIBLE int
lws_ssl_capable_write_no_ssl(struct lws *wsi, unsigned char *buf, int len)
{
	int n = 0;

	if (lws_wsi_is_udp(wsi)) {
#if !defined(LWS_WITH_ESP32)
		if (lws_has_buffered_out(wsi))
			n = sendto(wsi->desc.sockfd, (const char *)buf,
				   len, 0, &wsi->udp->sa_pending,
				   wsi->udp->salen_pending);
		else
			n = sendto(wsi->desc.sockfd, (const char *)buf,
				   len, 0, &wsi->udp->sa, wsi->udp->salen);
#endif
	} else
		n = send(wsi->desc.sockfd, (char *)buf, len, MSG_NOSIGNAL);
//	lwsl_info("%s: sent len %d result %d", __func__, len, n);
	if (n >= 0)
		return n;

	if (LWS_ERRNO == LWS_EAGAIN ||
	    LWS_ERRNO == LWS_EWOULDBLOCK ||
	    LWS_ERRNO == LWS_EINTR) {
		if (LWS_ERRNO == LWS_EWOULDBLOCK) {
			lws_set_blocking_send(wsi);
		}

		return LWS_SSL_CAPABLE_MORE_SERVICE;
	}

	lwsl_debug("ERROR writing len %d to skt fd %d err %d / errno %d\n",
		   len, wsi->desc.sockfd, n, LWS_ERRNO);

	return LWS_SSL_CAPABLE_ERROR;
}

LWS_VISIBLE int
lws_ssl_pending_no_ssl(struct lws *wsi)
{
	(void)wsi;
#if defined(LWS_WITH_ESP32)
	return 100;
#else
	return 0;
#endif
}


text:
package com.orange.opengl.texture.atlas.buildable;

import com.orange.opengl.texture.atlas.ITextureAtlas;
import com.orange.opengl.texture.atlas.source.ITextureAtlasSource;
import com.orange.opengl.texture.region.TextureRegion;
import com.orange.opengl.texture.region.TiledTextureRegion;
import com.orange.util.call.Callback;

/**
 * (c) OrangeGame 2012
 *
 *
 * @author OrangeGame <OGEngine@orangegame.cn>
 */
public class BuildableTextureAtlasTextureRegionFactory {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	// ===========================================================
	// Constructors
	// ===========================================================

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	// ===========================================================
	// Methods
	// ===========================================================

	// ===========================================================
	// Methods using BuildableBitmapTexture
	// ===========================================================

	// ===========================================================
	// Methods
	// ===========================================================

	public static <T extends ITextureAtlasSource, A extends ITextureAtlas<T>> TextureRegion createFromSource(final BuildableTextureAtlas<T, A> pBuildableTextureAtlas, final T pTextureAtlasSource, final boolean pRotated) {
		final TextureRegion textureRegion = new TextureRegion(pBuildableTextureAtlas, 0, 0, pTextureAtlasSource.getTextureWidth(), pTextureAtlasSource.getTextureHeight(), pRotated);
		pBuildableTextureAtlas.addTextureAtlasSource(pTextureAtlasSource, new Callback<T>() {
			@Override
			public void onCallback(final T pCallbackValue) {
				textureRegion.setTexturePosition(pCallbackValue.getTextureX(), pCallbackValue.getTextureY());
			}
		});
		return textureRegion;
	}

	public static <T extends ITextureAtlasSource, A extends ITextureAtlas<T>> TiledTextureRegion createTiledFromSource(final BuildableTextureAtlas<T, A> pBuildableTextureAtlas, final T pTextureAtlasSource, final int pTileColumns, final int pTileRows) {
		final TiledTextureRegion tiledTextureRegion = TiledTextureRegion.create(pBuildableTextureAtlas, 0, 0, pTextureAtlasSource.getTextureWidth(), pTextureAtlasSource.getTextureHeight(), pTileColumns, pTileRows);
		pBuildableTextureAtlas.addTextureAtlasSource(pTextureAtlasSource, new Callback<T>() {
			@Override
			public void onCallback(final T pCallbackValue) {
				final int tileWidth = pTextureAtlasSource.getTextureWidth() / pTileColumns;
				final int tileHeight = pTextureAtlasSource.getTextureHeight() / pTileRows;

				for(int tileColumn = 0; tileColumn < pTileColumns; tileColumn++) {
					for(int tileRow = 0; tileRow < pTileRows; tileRow++) {
						final int tileIndex = tileRow * pTileColumns + tileColumn;

						final int x = pCallbackValue.getTextureX() + tileColumn * tileWidth;
						final int y = pCallbackValue.getTextureY() + tileRow * tileHeight;

						tiledTextureRegion.setTexturePosition(tileIndex, x, y);
					}
				}
			}
		});
		return tiledTextureRegion;
	}

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
// DATA_TEMPLATE: empty_table
oTest.fnStart("aaSortingFixed");

$(document).ready(function () {
    /* Check the default */
    var oTable = $('#example').dataTable({
        "bServerSide": true,
        "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
    });
    var oSettings = oTable.fnSettings();

    oTest.fnWaitTest(
        "No fixed sorting by default",
        null,
        function () {
            return oSettings.aaSortingFixed == null;
        }
    );

    oTest.fnWaitTest(
        "Fixed sorting on first column (string/asc) with user sorting on second column (string/asc)",
        function () {
            oSession.fnRestore();
            $('#example').dataTable({
                "bServerSide": true,
                "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
                "aaSortingFixed": [['0', 'asc']]
            });
            $('#example thead th:eq(1)').click();
        },
        function () {
            return $('#example tbody td:eq(1)').html() == "Camino 1.0";
        }
    );

    oTest.fnWaitTest(
        "Fixed sorting on first column (string/asc) with user sorting on second column (string/desc)",
        function () {
            $('#example thead th:eq(1)').click();
        },
        function () {
            return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1";
        }
    );

    oTest.fnWaitTest(
        "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/asc)",
        function () {
            oSession.fnRestore();
            $('#example').dataTable({
                "bServerSide": true,
                "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
                "aaSortingFixed": [['3', 'asc']]
            });
            $('#example thead th:eq(1)').click();
        },
        function () {
            return $('#example tbody td:eq(1)').html() == "All others";
        }
    );

    oTest.fnWaitTest(
        "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/desc)",
        function () {
            $('#example thead th:eq(1)').click();
        },
        function () {
            return $('#example tbody td:eq(1)').html() == "PSP browser";
        }
    );

    oTest.fnComplete();
});


text:
<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>[%thread] %d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>
    <root level="info">
        <appender-ref ref="STDOUT"/>
    </root>
    <logger name="com.softmotions.ncms.js.JsServiceRS" level="TRACE"/>
</configuration>


text:
using HtmlTags;
using SuperGlue.Web.Output;

namespace SuperGlue.Web.Assets
{
    public interface IAssetTagWriter
    {
        TagList WriteAllTags();

        TagList WriteTags(MimeType mimeType, params string[] tags);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  - Copyright 2013-2017 consulo.io
  -
  - Licensed under the Apache License, Version 2.0 (the "License");
  - you may not use this file except in compliance with the License.
  - You may obtain a copy of the License at
  -
  - http://www.apache.org/licenses/LICENSE-2.0
  -
  - Unless required by applicable law or agreed to in writing, software
  - distributed under the License is distributed on an "AS IS" BASIS,
  - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  - See the License for the specific language governing permissions and
  - limitations under the License.
  -->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>consulo</groupId>
    <artifactId>arch.global</artifactId>
    <version>2-SNAPSHOT</version>
    <relativePath>../../../arch/global/pom.xml</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <artifactId>consulo-platform-impl</artifactId>
  <version>2-SNAPSHOT</version>

  <packaging>jar</packaging>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <compilerArg>--add-exports=java.desktop/sun.font=ALL-UNNAMED</compilerArg>
            <compilerArg>--add-exports=java.desktop/sun.awt=ALL-UNNAMED</compilerArg>
            <compilerArg>--add-exports=java.desktop/sun.awt.datatransfer=ALL-UNNAMED</compilerArg>
            <compilerArg>--add-exports=java.desktop/java.awt.peer=ALL-UNNAMED</compilerArg>
          </compilerArgs>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <!--TODO [VISTALL] this desktop only dependency. remove later -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-desktop-awt-hacking</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-runtime-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-platform-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-external-service-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-external-service-impl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-base-localize-library</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-lang-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-core-impl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-ui-impl</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-project-model-impl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-analysis-impl</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-editor-ui-ex</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-localize-impl</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-diff-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-util-collection</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-util-collection-primitive</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-util-lang</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>consulo-util-nodep</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <!--internal libraries-->
    <dependency>
      <groupId>consulo.internal</groupId>
      <artifactId>eawtstub</artifactId>
      <version>2-SNAPSHOT</version>
      <optional>true</optional>
    </dependency>
    <!--extenal libraries-->
    <dependency>
      <groupId>org.lz4</groupId>
      <artifactId>lz4-java</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
    </dependency>
    <dependency>
      <groupId>args4j</groupId>
      <artifactId>args4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jvnet.winp</groupId>
      <artifactId>winp</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
    </dependency>
    <dependency>
      <groupId>com.miglayout</groupId>
      <artifactId>miglayout</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>consulo.internal</groupId>
      <artifactId>trove4j</artifactId>
      <optional>true</optional>
    </dependency>
  </dependencies>
</project>


text:
"""
Python to Javascript compiler
"""

from .compiler import js_compile, runtime, JSCode


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

  <parent>
    <groupId>org.cdlflex</groupId>
    <artifactId>fruit</artifactId>
    <version>0.6.0-SNAPSHOT</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>fruit-util</artifactId>

  <packaging>bundle</packaging>

  <name>Fruit Utils</name>

  <properties>
    <bundle.symbolicName>${project.groupId}.fruit.util</bundle.symbolicName>
    <bundle.namespace>${project.groupId}.fruit.util</bundle.namespace>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.cdlflex</groupId>
      <artifactId>fruit-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>
</project>


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

using System.Collections.Generic;
using System.Collections.Tests;

namespace System.Collections.Immutable.Tests
{
    public class ImmutableArray_NonGeneric_Tests : IList_NonGeneric_Tests
    {
        protected override bool IsReadOnly => true;
        protected override bool ExpectedFixedSize => true;
        protected override bool ExpectedIsSynchronized => true;
        protected override bool ICollection_NonGeneric_SupportsSyncRoot => false;

        protected override Type IList_NonGeneric_Item_InvalidIndex_ThrowType => typeof(IndexOutOfRangeException);
        protected override IEnumerable<ModifyEnumerable> GetModifyEnumerables(ModifyOperation operations) => new List<ModifyEnumerable>();
        protected override bool Enumerator_Current_UndefinedOperation_Throws => true;

        protected override Type ICollection_NonGeneric_CopyTo_TwoDimensionArray_ThrowType => typeof(RankException);
        protected override Type ICollection_NonGeneric_CopyTo_ArrayOfIncorrectReferenceType_ThrowType => typeof(InvalidCastException);
        protected override Type ICollection_NonGeneric_CopyTo_ArrayOfIncorrectValueType_ThrowType => typeof(InvalidCastException);
        protected override Type ICollection_NonGeneric_CopyTo_NonZeroLowerBound_ThrowType => typeof(ArgumentOutOfRangeException);

        protected override IList NonGenericIListFactory() => NonGenericIListFactory(0);
        protected override IList NonGenericIListFactory(int count)
        {
            object[] items = new object[count];
            for (int i = 0; i < count; i++)
            {
                items[i] = CreateT(i);
            }
            return ImmutableArray.Create(items);
        }
    }
}