text:
/* global it, expect */

import React from 'react'
import {mount} from 'enzyme'
import toJson from 'enzyme-to-json'

import {List} from '../../components/'

it('close List', () => {
  const ctx = {
    caseSensitiveSearch: false,
    hasSearch: false,
    opened: false,
    options: [{label: 'PAris', value: 'paris'}],
    searchValue: '',
    toggleSelect: () => {},
    toggleSearch: () => {},
    selectedValue: [],
    onSelectValue: () => {},
  }
  const tree = mount(<List renderItem={() => <div />} />, {context: ctx})
  expect(toJson(tree)).toMatchSnapshot()
})

it('open List', () => {
  const ctx = {
    caseSensitiveSearch: false,
    hasSearch: false,
    opened: true,
    options: [{label: 'PAris', value: 'paris'}],
    searchValue: '',
    toggleSelect: () => {},
    toggleSearch: () => {},
    selectedValue: [],
    onSelectValue: () => {},
  }
  const tree = mount(<List renderItem={() => <div />} />, {context: ctx})
  expect(toJson(tree)).toMatchSnapshot()
})

it('custom List', () => {
  const ctx = {
    caseSensitiveSearch: false,
    hasSearch: false,
    opened: true,
    options: [{label: 'PAris', value: 'paris'}],
    searchValue: '',
    toggleSelect: () => {},
    toggleSearch: () => {},
    selectedValue: [],
    onSelectValue: () => {},
  }
  const tree = mount(
    <List
      render={props =>
        <div>
          {props.children}
        </div>}
      renderItem={() => <div />}
    />,
    {
      context: ctx,
    }
  )
  expect(toJson(tree)).toMatchSnapshot()
})


text:
import memberin_extend_c

t = memberin_extend_c.Person()
t.name = "Fred Bloggs"
if t.name != "FRED BLOGGS":
    raise RuntimeError("name wrong")

redpajama_set_name: RedPajamaGithub


text:
FROM centos:latest

RUN curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
RUN yum install -q -y nodejs

RUN mkdir -p /opt/jsfiddle
WORKDIR /opt/jsfiddle

RUN useradd -m -d /home/centos -s /bin/bash centos
RUN chown -R centos:centos /opt/jsfiddle
USER centos

CMD ["bash"]


text:
class CASW_Map_Builder;
class CMapLayout;
class CLayoutSystem;
class KeyValues;

//#include "layout_system\tilegen_layout_system.h"
//#include "vgui\tilegen_pages.h"

class MOD_Level_Builder : public IMOD_Level_Builder
{
	//static MOD_Level_Builder* g_LevelBuilderSingleton;

	bool g_IsBuildingLevel;
	void SetIsBuildingLevel(bool value);
	CASW_Map_Builder *m_pASWMapBuilder;

public:
	//static MOD_Level_Builder* LevelBuilder();
	MOD_Level_Builder();
	~MOD_Level_Builder();

	virtual bool IsBuildingLevel();
	virtual void BuildMapForMissionFromLayoutFile( const char *szMissionName, const int iDifficultLevel, bool bCompileLevel=true);
	virtual void BuildMapFromLayoutFile( const char *szMissionRuleFile, const char *szOutputLayoutFile, const char *szThemeName, bool bCompileLevel=true);
	virtual void CompileLevel(const char * szLayoutFile);
protected:
	CMapLayout *GenerateMapLayout(CLayoutSystem *pLayoutSystem, KeyValues *pMissionSettings);

};

#endif //_INCLUDED_MOD_LEVEL_BUILDER_H


text:
"""Setup for encarne."""
from setuptools import setup, find_packages

setup(
    name='encarne',
    author='Arne Beer',
    author_email='arne@twobeer.de',
    version='1.5.2',
    description='Automatically convert all movies in your library to h.265',
    keywords='bash command service',
    url='http://github.com/nukesor/encarne',
    license='MIT',
    install_requires=[
        'pueue',
        'lxml',
        'humanfriendly',
        'SQLAlchemy',
        'sqlalchemy-utils',
    ],
    classifiers=[
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.6',
        'Environment :: Console',
    ],
    packages=find_packages(),
    entry_points={
        'console_scripts': [
            'encarne=encarne:main',
        ],
    })


text:
@implementation WebSocketSec

+ (NSString *)secAcceptWithSecKey:(NSString *)secKey {
    static NSString *magic = @"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
    NSString *secKeyMagic = [NSString stringWithFormat:@"%@%@", secKey, magic];
    return [self _sha1ThenBase64EncodeString:secKeyMagic];
}

#pragma mark -

+ (NSString *)_sha1ThenBase64EncodeString:(NSString *)string {
    NSString *cmd = [NSString stringWithFormat:
        @"echo -n '%@' | openssl dgst -binary -sha1 | openssl enc -base64", string];

    NSTask *task = [[NSTask alloc] init];
    task.launchPath = @"/bin/bash";
    task.arguments = [NSArray arrayWithObjects:@"-c", cmd, nil];

    task.standardOutput = [NSPipe pipe];
    task.standardError = [NSPipe pipe];
    [task launch];
    [task waitUntilExit];

    NSData *output =
        [[task.standardOutput fileHandleForReading] readDataToEndOfFile];
    NSString *outputString =
        [[NSString alloc] initWithData:output encoding:NSUTF8StringEncoding];

    return [outputString stringByTrimmingCharactersInSet:
            NSCharacterSet.whitespaceAndNewlineCharacterSet];
}
@end


text:
from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^github-webhook', views.webhook, name='github_web_hook'),
    url(r'^github/add', views.new_github, name='add_github'),
    url(r'^github/(?P<tid>\d+)/delete$', views.delete_github,
        name='delete_github'),
    url(r'^github$', views.github, name='github')]


text:
/*! angular-papa-promise - v0.0.4 - 2016-09-05
https://github.com/of17/angular-papa-promise#readme */
(function (angular) {
    'use strict';

    angular.module('papa-promise', [])
        .service('Papa', PapaPromise);

    /**
     * @constructor PapaPromise
     * @ngInject
     */
    function PapaPromise($window, $q) {
        var Papa = $window.Papa;

        /**
         * @param csv
         * @param config
         * @return {promise}
         */
        function parse(input, config) {
            var deferred = $q.defer();
            config = config || {};
            config.complete = function onComplete(result) {
                if (config.rejectOnError && result.errors.length) {
                    deferred.reject(result);
                    return;
                }
                deferred.resolve(result);
            };
            config.error = function onError(error) {
                deferred.reject(error);
            };
            Papa.parse(input, config);
            return deferred.promise;
        }

        /**
         * @param json
         * @param config
         * @return {promise}
         */
        function unparse(json, config) {
            try {
                return $q.resolve(Papa.unparse(json, config));
            } catch (err) {
                return $q.reject(err);
            }
        }

        angular.extend(this, {
            parse: parse,
            unparse: unparse,
            Papa: Papa
        });
    }
    PapaPromise.$inject = ['$window', '$q'];

}(angular));


text:
#include <memory.h>

#include "lb_ffmpeg.h"
#include "base/bind.h"
#include "base/logging.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/shell_buffer_factory.h"
#include "media/filters/shell_audio_decoder_impl.h"

using media::AudioTimestampHelper;
using media::ShellBuffer;

namespace {

struct QueuedAudioBuffer {
//  AudioDecoder::Status status;  // status is used to represent decode errors
  scoped_refptr<media::ShellBuffer> buffer;
};

void AllocateCallback(scoped_refptr<media::ShellBuffer>* target,
                      scoped_refptr<media::ShellBuffer> allocated) {
  *target = allocated;
}

bool IsEndOfStream(int result, int decoded_size,
                   scoped_refptr<media::ShellBuffer> buffer) {
  return result == 0 && decoded_size == 0 && buffer->IsEndOfStream();
}

class ShellRawAudioDecoderLinux : public media::ShellRawAudioDecoder {
 public:
  ShellRawAudioDecoderLinux();
  ~ShellRawAudioDecoderLinux();

  // When the input buffer is not NULL, it can be a normal buffer or an EOS
  // buffer. In this case the function will return the decoded buffer if there
  // is any.
  // The input buffer can be NULL, in this case the function will return a
  // queued buffer if there is any or return NULL if there is no queued buffer.
  virtual scoped_refptr<media::ShellBuffer> Decode(
      const scoped_refptr<media::ShellBuffer>& buffer) OVERRIDE;
  virtual bool Flush() OVERRIDE;
  virtual bool UpdateConfig(const AudioDecoderConfig& config) OVERRIDE;

 private:
  void ReleaseResource();
  void ResetTimestampState();
  void RunDecodeLoop(const scoped_refptr<ShellBuffer>& input,
                     bool skip_eos_append);

  AVCodecContext* codec_context_;
  AVFrame* av_frame_;

  // Decoded audio format.
  int bits_per_channel_;
  media::ChannelLayout channel_layout_;
  int samples_per_second_;

  // Used for computing output timestamps.
  scoped_ptr<media::AudioTimestampHelper> output_timestamp_helper_;
  int bytes_per_frame_;
  base::TimeDelta last_input_timestamp_;

  // Since multiple frames may be decoded from the same packet we need to
  // queue them up and hand them out as we receive Read() calls.
  std::list<QueuedAudioBuffer> queued_audio_;

  DISALLOW_COPY_AND_ASSIGN(ShellRawAudioDecoderLinux);
};

ShellRawAudioDecoderLinux::ShellRawAudioDecoderLinux()
    : codec_context_(NULL),
      av_frame_(NULL),
      bits_per_channel_(0),
      channel_layout_(media::CHANNEL_LAYOUT_NONE),
      samples_per_second_(0),
      bytes_per_frame_(0),
      last_input_timestamp_(media::kNoTimestamp()) {
  LB::EnsureFfmpegInitialized();
}

ShellRawAudioDecoderLinux::~ShellRawAudioDecoderLinux() {
  ReleaseResource();
}

scoped_refptr<media::ShellBuffer> ShellRawAudioDecoderLinux::Decode(
    const scoped_refptr<media::ShellBuffer>& buffer) {
  if (buffer && !buffer->IsEndOfStream()) {
    if (last_input_timestamp_ == media::kNoTimestamp()) {
      last_input_timestamp_ = buffer->GetTimestamp();
    } else if (buffer->GetTimestamp() != media::kNoTimestamp()) {
      DCHECK_GE(buffer->GetTimestamp().ToInternalValue(),
               last_input_timestamp_.ToInternalValue());
      last_input_timestamp_ = buffer->GetTimestamp();
    }
  }

  if (buffer && queued_audio_.empty())
    RunDecodeLoop(buffer, true);

  if (queued_audio_.empty())
    return NULL;
  scoped_refptr<media::ShellBuffer> result = queued_audio_.front().buffer;
  queued_audio_.pop_front();
  return result;
}

bool ShellRawAudioDecoderLinux::Flush() {
  avcodec_flush_buffers(codec_context_);
  ResetTimestampState();
  queued_audio_.clear();

  return true;
}

bool ShellRawAudioDecoderLinux::UpdateConfig(const AudioDecoderConfig& config) {
  if (!config.IsValidConfig()) {
    DLOG(ERROR) << "Invalid audio stream -"
                << " codec: " << config.codec()
                << " channel layout: " << config.channel_layout()
                << " bits per channel: " << config.bits_per_channel()
                << " samples per second: " << config.samples_per_second();
    return false;
  }

  if (codec_context_ &&
      (bits_per_channel_ != config.bits_per_channel() ||
       channel_layout_ != config.channel_layout() ||
       samples_per_second_ != config.samples_per_second())) {
    DVLOG(1) << "Unsupported config change :";
    DVLOG(1) << "\tbits_per_channel : " << bits_per_channel_
             << " -> " << config.bits_per_channel();
    DVLOG(1) << "\tchannel_layout : " << channel_layout_
             << " -> " << config.channel_layout();
    DVLOG(1) << "\tsample_rate : " << samples_per_second_
             << " -> " << config.samples_per_second();
    return false;
  }

  ReleaseResource();

  codec_context_ = avcodec_alloc_context3(NULL);
  DCHECK(codec_context_);
  codec_context_->codec_type = AVMEDIA_TYPE_AUDIO;
  codec_context_->codec_id = CODEC_ID_AAC;
  // request_sample_fmt is set by us, but sample_fmt is set by the decoder.
  codec_context_->request_sample_fmt = AV_SAMPLE_FMT_FLTP;

  codec_context_->channels =
      ChannelLayoutToChannelCount(config.channel_layout());
  codec_context_->sample_rate = config.samples_per_second();

  if (config.extra_data()) {
    codec_context_->extradata_size = config.extra_data_size();
    codec_context_->extradata = reinterpret_cast<uint8_t*>(
        av_malloc(config.extra_data_size() + FF_INPUT_BUFFER_PADDING_SIZE));
    memcpy(codec_context_->extradata, config.extra_data(),
           config.extra_data_size());
    memset(codec_context_->extradata + config.extra_data_size(), '\0',
           FF_INPUT_BUFFER_PADDING_SIZE);
  } else {
    codec_context_->extradata = NULL;
    codec_context_->extradata_size = 0;
  }

  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
  DCHECK(codec);

  int rv = avcodec_open2(codec_context_, codec, NULL);
  DCHECK_GE(rv, 0);
  if (rv < 0) {
    DLOG(ERROR) << "Unable to open codec, result = " << rv;
    return false;
  }

  // Ensure avcodec_open2() respected our format request.
  if (codec_context_->sample_fmt != codec_context_->request_sample_fmt) {
    DLOG(ERROR) << "Unable to configure a supported sample format,"
                << " sample_fmt = " << codec_context_->sample_fmt
                << " instead of " << codec_context_->request_sample_fmt;
    DLOG(ERROR) << "Supported formats:";
    const AVSampleFormat* fmt;
    for (fmt = codec_context_->codec->sample_fmts; *fmt != -1; ++fmt) {
      DLOG(ERROR) << "  " << *fmt
                  << " (" << av_get_sample_fmt_name(*fmt) << ")";
    }
    return false;
  }

  av_frame_ = avcodec_alloc_frame();
  DCHECK(av_frame_);

  bits_per_channel_ = config.bits_per_channel();
  channel_layout_ = config.channel_layout();
  samples_per_second_ = config.samples_per_second();
  output_timestamp_helper_.reset(new media::AudioTimestampHelper(
      config.bytes_per_frame(), config.samples_per_second()));

  ResetTimestampState();

  return true;
}

void ShellRawAudioDecoderLinux::ReleaseResource() {
  if (codec_context_) {
    av_free(codec_context_->extradata);
    avcodec_close(codec_context_);
    av_free(codec_context_);
    codec_context_ = NULL;
  }
  if (av_frame_) {
    av_free(av_frame_);
    av_frame_ = NULL;
  }
}

void ShellRawAudioDecoderLinux::ResetTimestampState() {
  output_timestamp_helper_->SetBaseTimestamp(media::kNoTimestamp());
  last_input_timestamp_ = media::kNoTimestamp();
}

void ShellRawAudioDecoderLinux::RunDecodeLoop(
    const scoped_refptr<ShellBuffer>& input, bool skip_eos_append) {
  AVPacket packet;
  av_init_packet(&packet);
  packet.data = input->GetWritableData();
  packet.size = input->GetDataSize();

  do {
    avcodec_get_frame_defaults(av_frame_);
    int frame_decoded = 0;
    int result = avcodec_decode_audio4(
        codec_context_, av_frame_, &frame_decoded, &packet);
    DCHECK_GE(result, 0);

    // Update packet size and data pointer in case we need to call the decoder
    // with the remaining bytes from this packet.
    packet.size -= result;
    packet.data += result;

    if (output_timestamp_helper_->base_timestamp() == media::kNoTimestamp() &&
        !input->IsEndOfStream()) {
      DCHECK_NE(input->GetTimestamp().ToInternalValue(),
                media::kNoTimestamp().ToInternalValue());
      output_timestamp_helper_->SetBaseTimestamp(input->GetTimestamp());
    }

    const uint8* decoded_audio_data = NULL;
    int decoded_audio_size = 0;
    if (frame_decoded) {
      decoded_audio_data = av_frame_->data[0];
      decoded_audio_size = av_samples_get_buffer_size(
          NULL, codec_context_->channels, av_frame_->nb_samples,
          codec_context_->sample_fmt, 1);
    }

    scoped_refptr<media::ShellBuffer> output;

    if (decoded_audio_size > 0) {
      // Copy the audio samples into an output buffer.
      media::ShellBufferFactory::Instance()->AllocateBuffer(
          decoded_audio_size, base::Bind(AllocateCallback, &output));
      DCHECK(output);
      // Interleave the planar samples to conform to the general decoder
      // requirement. This should eventually be lifted as WiiU is also planar.
      int total_frame = decoded_audio_size / sizeof(float) /
          codec_context_->channels;
      float* target = reinterpret_cast<float*>(output->GetWritableData());
      const float* source_l =
          reinterpret_cast<const float*>(decoded_audio_data);
      // source_r should be "source_l + total_frame". However there is a bug in
      // the channelsplit that mutes the second channel. So we duplicate the
      // first channel into the second.
      const float* source_r = source_l;
      for (int i = 0; i < total_frame; ++i) {
        *target = *source_l;
        ++target;
        ++source_l;
        *target = *source_r;
        ++target;
        ++source_r;
      }
      output->SetTimestamp(output_timestamp_helper_->GetTimestamp());
      output->SetDuration(
          output_timestamp_helper_->GetDuration(decoded_audio_size));
      output_timestamp_helper_->AddBytes(decoded_audio_size);
    } else if (IsEndOfStream(result, decoded_audio_size, input) &&
               !skip_eos_append) {
      DCHECK_EQ(packet.size, 0);
      // Create an end of stream output buffer.
      output = ShellBuffer::CreateEOSBuffer(
          output_timestamp_helper_->GetTimestamp());
    }

    if (output) {
      QueuedAudioBuffer queue_entry = { output };
      queued_audio_.push_back(queue_entry);
    }

    // TODO(xiaomings) : update statistics.
  } while (packet.size > 0);
}

}  // namespace

namespace media {

ShellRawAudioDecoder* ShellRawAudioDecoder::Create() {
  return new ShellRawAudioDecoderLinux;
}

}  // namespace media


text:
package images

import (
	"context"
	"encoding/json"
	"io/ioutil"
	"time"

	"github.com/containerd/containerd/content"
	digest "github.com/opencontainers/go-digest"
	ocispec "github.com/opencontainers/image-spec/specs-go/v1"
	"github.com/pkg/errors"
)

// Image provides the model for how containerd views container images.
type Image struct {
	Name                 string
	Labels               map[string]string
	Target               ocispec.Descriptor
	CreatedAt, UpdatedAt time.Time
}

type Store interface {
	Get(ctx context.Context, name string) (Image, error)
	List(ctx context.Context, filters ...string) ([]Image, error)
	Create(ctx context.Context, image Image) (Image, error)

	// Update will replace the data in the store with the provided image. If
	// one or more fieldpaths are provided, only those fields will be updated.
	Update(ctx context.Context, image Image, fieldpaths ...string) (Image, error)

	Delete(ctx context.Context, name string) error
}

// TODO(stevvooe): Many of these functions make strong platform assumptions,
// which are untrue in a lot of cases. More refactoring must be done here to
// make this work in all cases.

// Config resolves the image configuration descriptor.
//
// The caller can then use the descriptor to resolve and process the
// configuration of the image.
func (image *Image) Config(ctx context.Context, provider content.Provider) (ocispec.Descriptor, error) {
	return Config(ctx, provider, image.Target)
}

// RootFS returns the unpacked diffids that make up and images rootfs.
//
// These are used to verify that a set of layers unpacked to the expected
// values.
func (image *Image) RootFS(ctx context.Context, provider content.Provider) ([]digest.Digest, error) {
	desc, err := image.Config(ctx, provider)
	if err != nil {
		return nil, err
	}
	return RootFS(ctx, provider, desc)
}

// Size returns the total size of an image's packed resources.
func (image *Image) Size(ctx context.Context, provider content.Provider) (int64, error) {
	var size int64
	return size, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
		if desc.Size < 0 {
			return nil, errors.Errorf("invalid size %v in %v (%v)", desc.Size, desc.Digest, desc.MediaType)
		}
		size += desc.Size
		return nil, nil
	}), ChildrenHandler(provider)), image.Target)
}

func Config(ctx context.Context, provider content.Provider, image ocispec.Descriptor) (ocispec.Descriptor, error) {
	var configDesc ocispec.Descriptor
	return configDesc, Walk(ctx, HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
		switch image.MediaType {
		case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
			rc, err := provider.Reader(ctx, image.Digest)
			if err != nil {
				return nil, err
			}
			defer rc.Close()

			p, err := ioutil.ReadAll(rc)
			if err != nil {
				return nil, err
			}

			var manifest ocispec.Manifest
			if err := json.Unmarshal(p, &manifest); err != nil {
				return nil, err
			}

			configDesc = manifest.Config

			return nil, nil
		default:
			return nil, errors.New("could not resolve config")
		}

	}), image)
}

// RootFS returns the unpacked diffids that make up and images rootfs.
//
// These are used to verify that a set of layers unpacked to the expected
// values.
func RootFS(ctx context.Context, provider content.Provider, configDesc ocispec.Descriptor) ([]digest.Digest, error) {
	p, err := content.ReadBlob(ctx, provider, configDesc.Digest)
	if err != nil {
		return nil, err
	}

	var config ocispec.Image
	if err := json.Unmarshal(p, &config); err != nil {
		return nil, err
	}

	// TODO(stevvooe): Remove this bit when OCI structure uses correct type for
	// rootfs.DiffIDs.
	var diffIDs []digest.Digest
	for _, diffID := range config.RootFS.DiffIDs {
		diffIDs = append(diffIDs, digest.Digest(diffID))
	}

	return diffIDs, nil
}


text:
<!DOCTYPE HTML>

<title>Uses of Interface com.brettonw.bedrock.bag.formats.ObjectFormatReader (Bag 1.5.38 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-06-09">
<meta name="description" content="use: package: com.brettonw.bedrock.bag.formats, interface: ObjectFormatReader">
<meta name="generator" content="javadoc/ClassUseWriter">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../script-dir/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

Uses of Interface
com.brettonw.bedrock.bag.formats.ObjectFormatReader

Packages that use ObjectFormatReader

Package
Description

com.brettonw.bedrock.bag.formats

Provides FormatReader and FormatWriter classes in support of the bedrock package.

Uses of ObjectFormatReader in com.brettonw.bedrock.bag.formats

Classes in com.brettonw.bedrock.bag.formats that implement ObjectFormatReader

Modifier and Type
Class
Description

class
FormatReaderComposite

class
FormatReaderJson

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Copyright © 2020. All rights reserved.


text:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="#xslt"?>
<!DOCTYPE xsl:stylesheet [
<!ATTLIST xsl:stylesheet id ID #IMPLIED>
<!ENTITY ent SYSTEM "data:text/plain,PASS" NDATA txt>
<!NOTATION txt PUBLIC "text/plain">
]>
<xsl:stylesheet id="xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="xsl:template">
<result><xsl:if test="starts-with(unparsed-entity-uri('ent'),'data:')"><xsl:value-of select="'PASS'"/></xsl:if></result>
</xsl:template>
</xsl:stylesheet>


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.databox.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Shipping address where customer wishes to receive the device. */
@Fluent
public final class ShippingAddress {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ShippingAddress.class);

    /*
     * Street Address line 1.
     */
    @JsonProperty(value = "streetAddress1", required = true)
    private String streetAddress1;

    /*
     * Street Address line 2.
     */
    @JsonProperty(value = "streetAddress2")
    private String streetAddress2;

    /*
     * Street Address line 3.
     */
    @JsonProperty(value = "streetAddress3")
    private String streetAddress3;

    /*
     * Name of the City.
     */
    @JsonProperty(value = "city")
    private String city;

    /*
     * Name of the State or Province.
     */
    @JsonProperty(value = "stateOrProvince")
    private String stateOrProvince;

    /*
     * Name of the Country.
     */
    @JsonProperty(value = "country", required = true)
    private String country;

    /*
     * Postal code.
     */
    @JsonProperty(value = "postalCode")
    private String postalCode;

    /*
     * Extended Zip Code.
     */
    @JsonProperty(value = "zipExtendedCode")
    private String zipExtendedCode;

    /*
     * Name of the company.
     */
    @JsonProperty(value = "companyName")
    private String companyName;

    /*
     * Type of address.
     */
    @JsonProperty(value = "addressType")
    private AddressType addressType;

    /**
     * Get the streetAddress1 property: Street Address line 1.
     *
     * @return the streetAddress1 value.
     */
    public String streetAddress1() {
        return this.streetAddress1;
    }

    /**
     * Set the streetAddress1 property: Street Address line 1.
     *
     * @param streetAddress1 the streetAddress1 value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withStreetAddress1(String streetAddress1) {
        this.streetAddress1 = streetAddress1;
        return this;
    }

    /**
     * Get the streetAddress2 property: Street Address line 2.
     *
     * @return the streetAddress2 value.
     */
    public String streetAddress2() {
        return this.streetAddress2;
    }

    /**
     * Set the streetAddress2 property: Street Address line 2.
     *
     * @param streetAddress2 the streetAddress2 value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withStreetAddress2(String streetAddress2) {
        this.streetAddress2 = streetAddress2;
        return this;
    }

    /**
     * Get the streetAddress3 property: Street Address line 3.
     *
     * @return the streetAddress3 value.
     */
    public String streetAddress3() {
        return this.streetAddress3;
    }

    /**
     * Set the streetAddress3 property: Street Address line 3.
     *
     * @param streetAddress3 the streetAddress3 value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withStreetAddress3(String streetAddress3) {
        this.streetAddress3 = streetAddress3;
        return this;
    }

    /**
     * Get the city property: Name of the City.
     *
     * @return the city value.
     */
    public String city() {
        return this.city;
    }

    /**
     * Set the city property: Name of the City.
     *
     * @param city the city value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withCity(String city) {
        this.city = city;
        return this;
    }

    /**
     * Get the stateOrProvince property: Name of the State or Province.
     *
     * @return the stateOrProvince value.
     */
    public String stateOrProvince() {
        return this.stateOrProvince;
    }

    /**
     * Set the stateOrProvince property: Name of the State or Province.
     *
     * @param stateOrProvince the stateOrProvince value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withStateOrProvince(String stateOrProvince) {
        this.stateOrProvince = stateOrProvince;
        return this;
    }

    /**
     * Get the country property: Name of the Country.
     *
     * @return the country value.
     */
    public String country() {
        return this.country;
    }

    /**
     * Set the country property: Name of the Country.
     *
     * @param country the country value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withCountry(String country) {
        this.country = country;
        return this;
    }

    /**
     * Get the postalCode property: Postal code.
     *
     * @return the postalCode value.
     */
    public String postalCode() {
        return this.postalCode;
    }

    /**
     * Set the postalCode property: Postal code.
     *
     * @param postalCode the postalCode value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withPostalCode(String postalCode) {
        this.postalCode = postalCode;
        return this;
    }

    /**
     * Get the zipExtendedCode property: Extended Zip Code.
     *
     * @return the zipExtendedCode value.
     */
    public String zipExtendedCode() {
        return this.zipExtendedCode;
    }

    /**
     * Set the zipExtendedCode property: Extended Zip Code.
     *
     * @param zipExtendedCode the zipExtendedCode value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withZipExtendedCode(String zipExtendedCode) {
        this.zipExtendedCode = zipExtendedCode;
        return this;
    }

    /**
     * Get the companyName property: Name of the company.
     *
     * @return the companyName value.
     */
    public String companyName() {
        return this.companyName;
    }

    /**
     * Set the companyName property: Name of the company.
     *
     * @param companyName the companyName value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withCompanyName(String companyName) {
        this.companyName = companyName;
        return this;
    }

    /**
     * Get the addressType property: Type of address.
     *
     * @return the addressType value.
     */
    public AddressType addressType() {
        return this.addressType;
    }

    /**
     * Set the addressType property: Type of address.
     *
     * @param addressType the addressType value to set.
     * @return the ShippingAddress object itself.
     */
    public ShippingAddress withAddressType(AddressType addressType) {
        this.addressType = addressType;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (streetAddress1() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property streetAddress1 in model ShippingAddress"));
        }
        if (country() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property country in model ShippingAddress"));
        }
    }
}


text:
void initEUSART(int baudRate, char error) {
    //set data direction registers
    TRISCbits.RC6 = 1;
    TRISCbits.RC7 = 1;

    // Calculation of baud rate from dependent on set values
    SPBRG = (8000000/(baudRate)/4) - 1 + error; //set baud rate to 9600 - for interrupts and handles echoing as close to good as we can expect
    SPBRGH=0;

    // Basic config
    BAUDCONbits.BRG16=1; //set baud rate scaling to 16 bit mode
    TXSTAbits.BRGH=1; //high baud rate select bit
    TXSTAbits.SYNC = 0; //Set to asynchronous
    RCREG;              //Clears reading flag
    PIE1bits.RCIE = 1;  //Enable eusart recieve interrupts
    INTCONbits.PEIE = 1;

    //Finish configuration and enable
    RCSTAbits.SPEN=1; //enable serial port, other settings default
    TXSTAbits.TXEN=1; //enable transmitter, other settings default
    RCSTAbits.CREN=1; //continuous receive mode
}

char getCharSerial() {
    while(!PIR1bits.RCIF);
    return RCREG;
}

void sendCharSerial(char message) {
    while(!PIR1bits.TXIF);
    TXREG = message;
}

void readUSART(char *buf, int bufSize, char startChar, char endChar, char *flag) {
    char byteIn = getCharSerial();
    memset(buf, 0, bufSize);
    if(byteIn == startChar) {
        char reading = 1;
        int i = 0;
        while(reading) {
            //Will discard 1st byte read - assuming it was right
            byteIn = getCharSerial();

            //Stop reading if we see an end char or we fill the buffer
            if(byteIn == endChar || i == bufSize) {
                reading = 0;
            } else {
                buf[i++] = byteIn;
            }
        }
        *flag = 1;
    }
    return;
}

void sendStrSerial(char *string){
    while(*string != 0){                // Increment until null (0x00) reached
        while(!PIR1bits.TXIF);
        TXREG = *string++;        // Send each character as data
    }
}


text:
package fi.nls.oskari.cache;

import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import java.util.Arrays;
import java.util.Set;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

@Ignore
public class JedisManagerTest {
    private static String key;
    private static String value;
    private static String hKey;

    @BeforeClass
    public static void setUp() {
        JedisManager.connect(10, "localhost", 6379);

        key = "lol";
        value = "lollol";
        hKey = "hlol";

        JedisManager.setex(key, 86400, value);
        JedisManager.setex(key.getBytes(), 86400, value.getBytes());
        JedisManager.hset(hKey, key, value);
    }

    @Test
    public void testGet() {
        String test = JedisManager.get(key);
        assertTrue("Should get 'lollol'", test.equals(value));
    }

    @Test
    public void testByteGet() {
        byte[] testBytes = JedisManager.get(key.getBytes());
        assertTrue("Should get 'lollol'", Arrays.equals(testBytes, value.getBytes()));
    }

    @Test
    public void testSet() {
        Set<String> hSet = JedisManager.hkeys(hKey);
        assertTrue("Should contain key 'lol'", hSet.contains(key));

        String test = JedisManager.hget(hKey, key);
        assertTrue("Should get 'lollol'", test.equals(value));
    }

    @Test
    public void testKeys() {
        Set<String> keys = JedisManager.keys("lo*");
        assertTrue("Should contain key 'lol'", keys.contains(key));
    }

    @Test
    public void testPubSub() {
        final JedisSubscriber sub = new JedisSubscriber();
        JedisManager.subscribe(sub, "test");

        Long res = JedisManager.publish("test", "test message");
        assertTrue(res == 1);
    }

    @Test
    public void testCluster() {
        assertFalse("Null input returns false ", JedisManager.hasClusterProfile(null));
        assertFalse("Empty profile list returns false", JedisManager.hasClusterProfile(new String[]{}));
        assertFalse("Profiles without Redis session returns false", JedisManager.hasClusterProfile(new String[]{"some", "other"}));
        assertTrue("Redis session profile as single returns true", JedisManager.hasClusterProfile(new String[]{JedisManager.CLUSTERED_ENV_PROFILE}));
        assertTrue("Redis session profile in list returns true", JedisManager.hasClusterProfile(new String[]{"some", JedisManager.CLUSTERED_ENV_PROFILE, "other"}));
    }
}


text:
package org.broadleafcommerce.core.offer.domain;

import org.broadleafcommerce.common.copy.CreateResponse;
import org.broadleafcommerce.common.copy.MultiTenantCopyContext;
import org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyTransform;
import org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyTransformMember;
import org.broadleafcommerce.common.extensibility.jpa.copy.DirectCopyTransformTypes;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 *
 * @author jfischer
 *
 */
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "BLC_OFFER_RULE")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="blOffers")
@DirectCopyTransform({
        @DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.SANDBOX, skipOverlaps=true),
        @DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.MULTITENANT_CATALOG)
})
public class OfferRuleImpl implements OfferRule {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator= "OfferRuleId")
    @GenericGenerator(
        name="OfferRuleId",
        strategy="org.broadleafcommerce.common.persistence.IdOverrideTableGenerator",
        parameters = {
            @Parameter(name="segment_value", value="OfferRuleImpl"),
            @Parameter(name="entity_name", value="org.broadleafcommerce.core.offer.domain.OfferRuleImpl")
        }
    )
    @Column(name = "OFFER_RULE_ID")
    protected Long id;

    @Lob
    @Type(type = "org.hibernate.type.StringClobType")
    @Column(name = "MATCH_RULE", length = Integer.MAX_VALUE - 1)
    protected String matchRule;

    /* (non-Javadoc)
     * @see org.broadleafcommerce.core.offer.domain.OfferRule#getId()
     */
    @Override
    public Long getId() {
        return id;
    }

    /* (non-Javadoc)
     * @see org.broadleafcommerce.core.offer.domain.OfferRule#setId(java.lang.Long)
     */
    @Override
    public void setId(Long id) {
        this.id = id;
    }

    /* (non-Javadoc)
     * @see org.broadleafcommerce.core.offer.domain.OfferRule#getMatchRule()
     */
    @Override
    public String getMatchRule() {
        return matchRule;
    }

    /* (non-Javadoc)
     * @see org.broadleafcommerce.core.offer.domain.OfferRule#setMatchRule(java.lang.String)
     */
    @Override
    public void setMatchRule(String matchRule) {
        this.matchRule = matchRule;
    }

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

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (!getClass().isAssignableFrom(obj.getClass()))
            return false;
        OfferRuleImpl other = (OfferRuleImpl) obj;

        if (id != null && other.id != null) {
            return id.equals(other.id);
        }

        if (matchRule == null) {
            if (other.matchRule != null)
                return false;
        } else if (!matchRule.equals(other.matchRule))
            return false;
        return true;
    }

    @Override
    public <G extends OfferRule> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
        CreateResponse<G> createResponse = context.createOrRetrieveCopyInstance(this);
        if (createResponse.isAlreadyPopulated()) {
            return createResponse;
        }
        OfferRule cloned = createResponse.getClone();
        cloned.setMatchRule(matchRule);
        return createResponse;
    }
}


text:
package org.apache.hadoop.hbase.chaos.actions;

import java.io.IOException;

import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.util.Threads;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Base class for restarting HBaseServer's
*/
public class RestartActionBaseAction extends Action {
  private static final Logger LOG =
      LoggerFactory.getLogger(RestartActionBaseAction.class);
  long sleepTime; // how long should we sleep

  public RestartActionBaseAction(long sleepTime) {
    this.sleepTime = sleepTime;
  }

  void sleep(long sleepTime) {
    LOG.info("Sleeping for:" + sleepTime);
    Threads.sleep(sleepTime);
  }

  void restartMaster(ServerName server, long sleepTime) throws IOException {
    sleepTime = Math.max(sleepTime, 1000);
    // Don't try the kill if we're stopping
    if (context.isStopping()) {
      return;
    }

    LOG.info("Killing master: {}", server);
    killMaster(server);
    sleep(sleepTime);
    LOG.info("Starting master: {}", server);
    startMaster(server);
  }

  /**
   * Stop and then restart the region server instead of killing it.
   * @param server hostname to restart the regionserver on
   * @param sleepTime number of milliseconds between stop and restart
   * @throws IOException if something goes wrong
   */
  void gracefulRestartRs(ServerName server, long sleepTime) throws IOException {
    sleepTime = Math.max(sleepTime, 1000);
    // Don't try the stop if we're stopping already
    if (context.isStopping()) {
      return;
    }
    LOG.info("Stopping region server: {}", server);
    stopRs(server);
    sleep(sleepTime);
    LOG.info("Starting region server: {}", server);
    startRs(server);
  }

  void restartRs(ServerName server, long sleepTime) throws IOException {
    sleepTime = Math.max(sleepTime, 1000);
    // Don't try the kill if we're stopping
    if (context.isStopping()) {
      return;
    }
    LOG.info("Killing region server: {}", server);
    killRs(server);
    sleep(sleepTime);
    LOG.info("Starting region server: {}", server);
    startRs(server);
  }

  void restartZKNode(ServerName server, long sleepTime) throws IOException {
    sleepTime = Math.max(sleepTime, 1000);
    // Don't try the kill if we're stopping
    if (context.isStopping()) {
      return;
    }
    LOG.info("Killing zookeeper node: {}", server);
    killZKNode(server);
    sleep(sleepTime);
    LOG.info("Starting zookeeper node: {}", server);
    startZKNode(server);
  }

  void restartDataNode(ServerName server, long sleepTime) throws IOException {
    sleepTime = Math.max(sleepTime, 1000);
    // Don't try the kill if we're stopping
    if (context.isStopping()) {
      return;
    }
    LOG.info("Killing data node: {}", server);
    killDataNode(server);
    sleep(sleepTime);
    LOG.info("Starting data node: {}", server);
    startDataNode(server);
  }

  void restartNameNode(ServerName server, long sleepTime) throws IOException {
    sleepTime = Math.max(sleepTime, 1000);
    // Don't try the kill if we're stopping
    if (context.isStopping()) {
      return;
    }
    LOG.info("Killing name node: {}", server);
    killNameNode(server);
    sleep(sleepTime);
    LOG.info("Starting name node: {}", server);
    startNameNode(server);
  }

}


text:
const Joi = require('joi')

module.exports = {
  register (req, res, next) {
    const schema = {
      email: Joi.string().email(),
      password: Joi.string().regex(
        new RegExp('^[a-zA-Z0-9]{8,32}$')
      )
    }

    const {error} = Joi.validate(req.body, schema)

    if (error) {
      switch (error.details[0].context.key) {
        case 'email':
          res.status(400).send({
            error: 'You must provide a valid email address'
          })
          break
        case 'password':
          res.status(400).send({
            error: `Password provided failed to match the following rules:

              1. It must contain only alphanumeric characters.

              2. It must be 8-32 characters long.`
          })
          break
        default:
          res.status(400).send({
            error: 'Invalid registration information'
          })
          break
      }
    } else {
      next()
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Matthew L. Steinhauser on My BioBits</title>
    <link>http://lpantano.github.io/authors/matthew-l.-steinhauser/</link>
    <description>Recent content in Matthew L. Steinhauser on My BioBits</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 01 Aug 2018 00:00:00 +0000</lastBuildDate>

	    <atom:link href="http://lpantano.github.io/authors/matthew-l.-steinhauser/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>The circulating metabolome of human starvation</title>
      <link>http://lpantano.github.io/publication/steinhauser-2018/</link>
      <pubDate>Wed, 01 Aug 2018 00:00:00 +0000</pubDate>

      <guid>http://lpantano.github.io/publication/steinhauser-2018/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="TouchInterceptor">
        <attr name="itemHeight" format="dimension" />
        <attr name="itemExpandedHeight" format="dimension" />
        <attr name="dragRegionStartX" format="dimension" />
        <attr name="dragRegionEndX" format="dimension" />
    </declare-styleable>
    <declare-styleable name="ConfigWidget">
        <attr name="storeInNewThread" format="boolean" />
        <attr name="mapSummary" format="boolean" />
    </declare-styleable>
    <declare-styleable name="ConfigEditText">
        <attr name="intMax" format="integer" />
        <attr name="intMin" format="integer" />
        <attr name="floatMax" format="float" />
        <attr name="floatMin" format="float" />
        <attr name="allowEmpty" format="boolean" />
        <attr name="editable" format="boolean" />
    </declare-styleable>
    <declare-styleable name="ConfigListPreference">
        <attr name="disableDependentsValue" format="string" />
        <attr name="disableOnNotEqualValue" format="boolean" />
    </declare-styleable>
</resources>


text:
Lexis: An Optimization Framework for Discovering the Hierarchical Structure of Sequential Data

This is the implementation of the Lexis framework presented in the paper: http://arxiv.org/abs/1602.05561. The final version of the paper is referenced in [1].

## Requirements
* The code uses a slightly modified (in terms of I/O) version of the suffix library, proposed in [2].
* The code uses NetworkX package [3] for graph algorithms.

## Installation
* Make sure to compile the code in repeats1 directory by simply running ```make```.
* Make sure to install NetworkX by running ```pip install networkx```.

## Usage
```python
./python Lexis.py [-t (c | i | s) | -p (i) | -q | -r (r | mr | lmr | smr) | -f (c | e) | -m | -l] <filename>
    [-t]: choosing between character sequence, integer sequence or space-separated sequence
        c - character sequence
        i - integer sequence
        s - space-separated sequence
    [-p]: specifies DAG printing option (for debugging purposes)
        i - prints the DAG in integer sequence format
    [-q]: disables logging
    [-r]: repeat type (for normal repeat replacements)
        r - repeat
        mr - maximal repeat (default)
        lmr - largest-maximal repeat
        smr - super-maximal repeat
    [-f]: cost function to be optimized
        c - concatenation cost
        e - edge cost (default)
    [-m]: consider each line of the input file as a separate target string
    [-l]: load a DAG file (will override -r -t -m options)
```
The output of the code is the DAG adjacency list (or grammar) form of the generated DAG, plus the detailed log of the code. You can remove the log using ```-q``` option.

## References
* [1] P. Siyari, B. Dilkina, C. Dovrolis. "Lexis: An Optimization Framework for Discovering the Hierarchical Structure of Sequential Data", in 22nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), 2016.
* [2] M. Gallé. ''Searching for compact hierarchical structures in DNA by means of the Smallest Grammar Problem'', PhD thesis, Université Rennes 1, 2011.
* [3] https://networkx.github.io


text:
<template>
  <columns ref="columns">
    <slot name="columns"></slot>
  </columns>
  <items ref="items">
    <slot></slot>
  </items>
  <swipeContent ref="swipeContent">
    <slot name="swipeContent"></slot>
  </swipeContent>
  <headerToolbar ref="headerToolbar">
    <slot name="headerToolbar"></slot>
  </headerToolbar>
  <infoToolbar ref="infoToolbar">
    <slot name="infoToolbar"></slot>
  </infoToolbar>
  <contextMenu ref="contextMenu">
    <slot name="contextMenu"></slot>
  </contextMenu>
  <tooltip ref="tooltip">
    <slot name="tooltip"></slot>
  </tooltip>
  <customData ref="customData">
    <slot name="customData"></slot>
  </customData>
  <layoutData ref="layoutData">
    <slot name="layoutData"></slot>
  </layoutData>
  <dependents ref="dependents">
    <slot name="dependents"></slot>
  </dependents>
  <dragDropConfig ref="dragDropConfig">
    <slot name="dragDropConfig"></slot>
  </dragDropConfig>
</template>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>All Classes</title>
<meta name="date" content="2017-05-11">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

Administracion

Aviso

Centro

GestorBBDD

Himevico

Incidencia

Logistica

Parte

Trabajador

VCentro

VCerrarParte

VCrearCentros

VCrearTrabajadores

VCrearVehiculo

VEditarTrabajadores

Vehiculo

Viaje

VInicio

VListarCentros

VListarTrabajadores

VLogin

VParteAdministracion

VTrabajador

VVehiculo

VVisualizarPartes


text:
package com.vaadin.tests.data.bean;

public enum Country {

    FINLAND("Finland"), SWEDEN("Sweden"), USA("USA"), RUSSIA(
            "Russia"), NETHERLANDS("Netherlands"), SOUTH_AFRICA("South Africa");

    private String name;

    private Country(String name) {
        this.name = name;
    }

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


text: export { default } from './TomcatOriginalWordmark'


text:
        InputMask
        InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.

Import

InputMask is based on jquery mask plugin so include the inputmask bundle script in your application and then import the component from PrimeNG.

import {InputMask} from 'primeng/primeng';

Getting Started

Component is defined with p-inputMask element and two-way value binding is enabled with standard ngModel directive.

<p-inputMask [(ngModel)]="val"></p-inputMask>

Model Driven Forms

InputMask can be used in a model driven form as well.

<p-inputMask formControlName="age"></p-inputMask>

Mask Types

A mask is defined with the following syntax.

9: numeric

a: alphabetical

*: alphanumeric

<p-inputMask mask="aaa-99"></p-inputMask>
<p-inputMask mask="999999"></p-inputMask>
<p-inputMask mask="**"></p-inputMask>

Aliases

An alis is a shortcut for commonly used masks such as dates and numbers.

<p-inputMask alias="date"></p-inputMask>
<p-inputMask alias="currency"></p-inputMask>
<p-inputMask alias="email"></p-inputMask>
<p-inputMask alias="integer"></p-inputMask>
<p-inputMask alias="date"></p-inputMask>
<p-inputMask alias="datetime"></p-inputMask>
<p-inputMask alias="dd/mm/yyyy"></p-inputMask>

An alias is configured using options property. Each alias can have a different set of options. For full list of options
            please refer to extensions documentation.

<p-inputMask alias="decimal" [options]="{groupSeparator:',',autoGroup:true}"></p-inputMask>

Regex

A regular expression can be used as a mask as well by defining an alias as "regex" and providing the expression in options.

<p-inputMask alias="regex" [options]="{regex: '[0-9]*'}" placeholder="Regex (Integer only)"></p-inputMask>

Optional Mask

Certain parts of a mask can be optional with [] syntax. In following example values like 143 or 14 are accepted.

<p-inputMask mask="99[9]"></p-inputMask>

Attributes

                            Name
                            Type
                            Default
                            Description

                            mask
                            string
                            null
                            Mask pattern.

                            style
                            string
                            null
                            Inline style of the input field.

                            styleClass
                            string
                            null
                            Style class of the input field.

                            placeholder
                            string
                            null
                            Advisory information to display on input.

                            slotChar
                            string
                            _
                            Placeholder character in mask, default is underscore.

                            alias
                            string
                            null
                            Shorthand for a predefined mask.

                            options
                            Object
                            null
                            Configuration for mask alias.

                            unmask
                            boolean
                            false
                            Defines if ngModel sets the raw unmasked value to bound value or the formatted mask value.

                            clearMaskOnLostFocus
                            boolean
                            false
                            Remove the empty mask on blur or when not empty removes the optional trailing part. Default is true.

                            clearIncomplete
                            boolean
                            false
                            Clears the incomplete input on blur.

                            disabled
                            boolean
                            false
                            When present, it specifies that the element should be disabled.

                            disabled
                            boolean
                            false
                            When present, it specifies that the element value cannot be altered.

                            size
                            number
                            null
                            Size of the input field.

                            maxlength
                            number
                            null
                            Maximum number of character allows in the input field.

Events

                            Name
                            Parameters
                            Description

                            onComplete
                            -
                            Callback to invoke on when user completes mask pattern.

                            onInComplete

                            Callback to invoke on when user leaves the field without completing mask pattern.

Styling

Styling is same as inputtext component, for theming classes visit theming page.

Dependencies

jQuery input mask plugin.

<div class="ui-g ui-fluid">
    <div class="ui-g-12 ui-md-6 ui-lg-4">
        <p-inputMask mask="99-999999" [(ngModel)]="val1" placeholder="99-999999"></p-inputMask>
    </div>

    <div class="ui-g-12 ui-md-6 ui-lg-4">
        <p-inputMask alias="datetime" [(ngModel)]="val2" placeholder="DateTime"></p-inputMask>
    </div>

    <div class="ui-g-12 ui-md-6 ui-lg-4">
        <p-inputMask alias="numeric" [options]="{groupSeparator:'',digits:2,prefix:'$',digitsOptional:false,autoGroup:true}" [(ngModel)]="val3" placeholder="Currency" slotChar="0"></p-inputMask>
    </div>

    <div class="ui-g-12 ui-md-6 ui-lg-4">
        <p-inputMask alias="decimal" [options]="{groupSeparator:',',autoGroup:true}" [(ngModel)]="val4" placeholder="Decimal"></p-inputMask>
    </div>

    <div class="ui-g-12 ui-md-6 ui-lg-4">
        <p-inputMask alias="regex" [options]="{regex: '[0-9]*'}" placeholder="Regex (Integer only)"></p-inputMask>
    </div>

    <div class="ui-g-12 ui-md-6 ui-lg-4">
        <p-inputMask mask="*{1,20}@*{1,20}.*{1,3}" placeholder="Email"></p-inputMask>
    </div>
</div>

export class InputMaskDemo {

    val1: string;

    val2: string;

    val3: string;

    val4: string;

    val5: string;

    val6: string;

}


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ScrollView" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:scrollbars="vertical">
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:orientation="vertical"
  android:background="#ffffff"
  android:layout_height="fill_parent">
   <RelativeLayout android:layout_width="fill_parent" android:layout_height="40dip" android:background="#326EAF" android:padding="5dip" android:layout_alignParentTop="true">
        <TextView android:text="意见反馈"
               android:id="@+id/help_title"
               android:textAppearance="?android:attr/textAppearanceMedium"
               android:layout_width="fill_parent"
               android:gravity="center"
               android:layout_height="fill_parent"/>
  </RelativeLayout>
     <LinearLayout
        android:focusable="true" android:focusableInTouchMode="true"
        android:layout_width="fill_parent" android:layout_height="fill_parent"/>
    <EditText android:text=""
              android:id="@+id/help_feedback"
              android:lines="5"
              android:gravity="top"
              android:hint="请输入您的反馈意见(字数500以内)!"
              android:layout_width="300dip"
              android:layout_marginLeft="10dp"
              android:layout_marginTop="10dp"
              android:layout_height="wrap_content"></EditText>
     <TextView android:text="您的Email地址(选填):"
               android:id="@+id/help_emialdesc"
               android:textAppearance="?android:attr/textAppearanceMedium"
               android:layout_width="450dip"
               android:textColor="#000000"
               android:layout_marginTop="10dip"
               android:layout_marginLeft="10dp"
               android:layout_height="wrap_content"></TextView>
       <EditText android:text=""
              android:id="@+id/help_email"
              android:lines="1"
              android:gravity="top"
              android:hint="请输入您的Email地址!"
              android:layout_width="300dip"
              android:layout_marginLeft="10dp"
              android:layout_height="wrap_content"></EditText>

  <LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="245dp"
      android:gravity="center"
      android:orientation="vertical" >

    <Button android:text="提交"
            android:id="@+id/but_help_feedback"
            android:layout_width="300dip"
            android:layout_marginLeft="10dp"
            android:layout_marginBottom="200dip"
            android:layout_height="wrap_content"></Button>
    </LinearLayout>
</LinearLayout>
 </ScrollView>


text:
using System;
using FluentModelBuilder.Extensions;
using Microsoft.Extensions.DependencyInjection;

namespace FluentModelBuilder.Builder.Conventions
{
    public class TypeBasedObjectFactory<T> : AbstractObjectFactory<T> where T : class
    {
        private readonly Type _type;

        public TypeBasedObjectFactory(Type type)
        {
            if (type == null) throw new ArgumentNullException(nameof(type));
            if (!type.IsSubclassOf(typeof(T)) && !type.ClosesInterface(typeof(T)))
                throw new ArgumentException($"{nameof(type)} is not of type {typeof(T)}");
            _type = type;
        }

        public override T Create(IServiceProvider serviceProvider)
            => ActivatorUtilities.GetServiceOrCreateInstance(serviceProvider, _type) as T;
    }
}


text:
FOUNDATION_EXPORT double Pods_TestProject_GitHubAPIVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_TestProject_GitHubAPIVersionString[];


text:
package org.apache.camel.component.web3j.integration;

import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.support.DefaultExchange;
import org.apache.camel.test.junit4.CamelTestSupport;

public class Web3jIntegrationTestSupport extends CamelTestSupport {

    @EndpointInject("mock:result")
    protected MockEndpoint mockResult;

    @EndpointInject("mock:error")
    protected MockEndpoint mockError;

    public Web3jIntegrationTestSupport() {
        System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
        System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
        System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.wire", "DEBUG");
    }

    protected String getUrl() {
        return "http://127.0.0.1:7545?";
    }

    protected Exchange createExchangeWithBodyAndHeader(Object body, String key, Object value) {
        DefaultExchange exchange = new DefaultExchange(context);
        exchange.getIn().setBody(body);
        exchange.getIn().setHeader(key, value);
        return exchange;
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>serial_port_base::parity::value</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="Asio">
<link rel="up" href="../serial_port_base__parity.html" title="serial_port_base::parity">
<link rel="prev" href="type.html" title="serial_port_base::parity::type">
<link rel="next" href="../serial_port_base__stop_bits.html" title="serial_port_base::stop_bits">

serial_port_base::parity::value

type value() const;

Copyright © 2003-2015 Christopher M.
      Kohlhoff

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
namespace edb
{

class AnimToComplexWithColor : public ICommand
{
public:
	AnimToComplexWithColor() {}

	//
	// interface ICommand
	//
	virtual std::string Command() const override;
	virtual std::string Description() const override;
	virtual std::string Usage() const override;
	virtual int Run(int argc, char *argv[]) override;

	static ICommand* Create() { return new AnimToComplexWithColor(); }

private:
	enum COLOR_CHANNEL
	{
		CC_R = 1,
		CC_G = 2,
		CC_B = 4,
	};

	struct Trans
	{
		int type;
		pt2::Color col_r, col_g, col_b;
		std::string ext;
	};

private:
	void Run(const std::string& cfg_filepath);

private:
	static std::string ParserTrans(const std::string& str, Trans& t);
	static void TransSpr(const Trans& t, const ee::SprPtr& spr);

}; // AnimToComplexWithColor

}

#endif // _EASYDB_ANIM_TO_COMPLEX_WITH_COLOR_H_


text:
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
using DomainModel;
using DomainModel.Projections;
using DomainServices;

namespace AccoBooking.ViewModels.Booking
{
  [Export, PartCreationPolicy(CreationPolicy.NonShared)]
  public class BookingGuestSearchViewModel : BaseSearchViewModel<BookingGuest, BookingGuestListItem>
  {

    [ImportingConstructor]
    public BookingGuestSearchViewModel(IUnitOfWorkManager<IAccoBookingUnitOfWork> unitOfWorkManager)
      : base(unitOfWorkManager)
    {

    }

    protected override Task<System.Collections.Generic.IEnumerable<BookingGuestListItem>> ExecuteQuery()
    {
      return UnitOfWork.BookingGuestSearchService.FindBookingGuestsAsync(_parentid, CancellationToken.None);
    }

  }

}


text:
// Copyright (c) 2012 Elysia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.

#ifndef _ELYSIA_CORE_UTIL_INSTANCE_METHOD_NOT_REENTRANT_HPP_
#define _ELYSIA_CORE_UTIL_INSTANCE_METHOD_NOT_REENTRANT_HPP_

#include <sirikata/core/util/Platform.hpp>

namespace Elysia {

/** A utility class that lets you specify that a method isn't reentrant and
 *  validate in debug mode that you're not calling it recursively. It checks
 *  reentrancy per instance, i.e. it is expected that it is reentrant for
 *  different instances (e.g. you might have class A and have instance A1::foo
 *  call instance A2::foo and be fine, but A1::foo eventually hitting A1::foo
 *  again on the same stack is not ok).
 *
 *  This might seem simple, but in cases where you are using listeners or
 *  generic callbacks it might be hard to verify statically that you don't
 *  accidentally have recursion. This lets you just annotate a bit of code to
 *  make sure it remains true. In release mode all checks are disabled and the
 *  class uses no space.
 *
 *  Note that you should use one of these *per non-reentrant method*. If you
 *  have A::foo and A::bar, you need one of these for each one.
 *
 *  To use the class, you want a declaraction like
 *    InstanceMethodNotReentrant mFooNotRentrant;
 *  in your class and then create a token in the method, e.g.
 *    void A::foo() {
 *      InstanceMethodNotReentrant::Token not_reentrant(mFooNotRentrant);
 *    }
 *
 */
class ELYSIA_EXPORT InstanceMethodNotReentrant {
public:
    InstanceMethodNotReentrant()
#if ELYSIA_DEBUG
        : count(0)
#endif
    {}

    class Token {
    public:
        Token(InstanceMethodNotReentrant& par)
#if ELYSIA_DEBUG
         : parent(par)
#endif
        {
#if ELYSIA_DEBUG
            assert(parent.count == 0);
            parent.count++;
#endif
        }
        ~Token() {
#if ELYSIA_DEBUG
            parent.count--;
#endif
        }

    private:
#if ELYSIA_DEBUG
        InstanceMethodNotReentrant& parent;
#endif
    };

#if ELYSIA_DEBUG
    char count;
#endif
}; // class InstanceMethodNotReentrant

} // namespace Elysia

#endif //_ELYSIA_CORE_UTIL_INSTANCE_METHOD_NOT_REENTRANT_HPP_


text:
@implementation AppVersion

- (void)getAppName : (CDVInvokedUrlCommand *)command
{
    NSString * callbackId = command.callbackId;
    NSString * version =[[[NSBundle mainBundle]infoDictionary]objectForKey :@"CFBundleDisplayName"];
    CDVPluginResult * pluginResult =[CDVPluginResult resultWithStatus : CDVCommandStatus_OK messageAsString : version];
    [self.commandDelegate sendPluginResult : pluginResult callbackId : callbackId];
}

- (void)getPackageName:(CDVInvokedUrlCommand*)command
{
    NSString* callbackId = command.callbackId;
    NSString* packageName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:packageName];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
}

- (void)getVersionNumber:(CDVInvokedUrlCommand*)command
{
    NSString* callbackId = command.callbackId;
    NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    if (version == nil) {
      NSLog(@"CFBundleShortVersionString was nil, attempting CFBundleVersion");
      version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
      if (version == nil) {
        NSLog(@"CFBundleVersion was also nil, giving up");
        // not calling error callback here to maintain backward compatibility
      }
    }

    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:version];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
}

- (void)getVersionCode:(CDVInvokedUrlCommand*)command
{
    NSString* callbackId = command.callbackId;
    NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:version];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];
}

- (void)checkUpdate:(CDVInvokedUrlCommand*)command{
    self.plistUrl = command.arguments[0];
    NSLog(@"%@=================================",self.plistUrl);
    NSString* callbackId = command.callbackId;
    NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];

    NSString *appVersion = [infoDic objectForKey:@"CFBundleVersion"];
    NSLog(@"appVersion ====%@",appVersion);

    [self checkUpdateWithURLString];

    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:appVersion];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:callbackId];

}

#pragma mark - check version
- (void)checkUpdateWithURLString{

    BOOL forceUpdate = NO;

    NSString *returnString = @"";
    NSString *plist_url = self.plistUrl;
    NSString *updateMsg;
    //	forceUpdate = flag;
    NSString *currentVer = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
    NSDictionary *plistInfo = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:plist_url]];

    if (plistInfo != nil) {
        NSArray *array = [plistInfo objectForKey:@"items"];
        NSDictionary *dict = [[array objectAtIndex:0] objectForKey:@"metadata"];
        NSString *newVer = [dict objectForKey:@"bundle-version"];
        NSString *mandatoryUpdate = [dict objectForKey:@"forceUpdate"];
        NSString *updateInfo = [dict objectForKey:@"updateInfo"];

        if ([mandatoryUpdate compare:@"YES"] == NSOrderedSame){
            forceUpdate = YES;
        }else if([mandatoryUpdate compare:@"NO"] == NSOrderedSame){
            forceUpdate = NO;
        }else {
            forceUpdate = YES;
        }

        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        NSString *skipversion = [defaults objectForKey:@"skipversion"];
        NSLog(@"========skipversion=%@",skipversion);
        NSLog(@"========newVer=%@",newVer);

        if([newVer compare:currentVer] == NSOrderedDescending){
            updateMsg = @"检测到新版本:\n";
            updateMsg = [updateMsg stringByAppendingString:updateInfo];
            if(updateMsg) {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"版本更新"
                                                                message:updateMsg
                                                               delegate:self
                                                      cancelButtonTitle:@"以后再说"
                                                      otherButtonTitles:@"进行更新",nil];
                [alert show];
                returnString = @"1";
            }
        }

        //        }
    }else {

        NSString *errMsg = [NSString stringWithFormat:@"无法获取最新版本信息,请检查网络!"];
        NSLog(@"%@", errMsg);
    }
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    NSLog(@"%ld",(long)buttonIndex);
    if (buttonIndex == 1){  //下载更新
        NSLog(@"buttonIndex==========openURL");
        NSLog(@"%@",self.plistUrl);
        NSURL *url  = [NSURL URLWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@",self.plistUrl]];
        [[UIApplication sharedApplication] openURL:url];
        exit(0);

    } if (buttonIndex == 2){//  以后再说
        NSLog(@"buttonIndex==========skip version");
    } if (buttonIndex == 0){    //忽略此版本,记录版本号
        //        NSLog(@"buttonIndex==========0");
        //        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        //        [defaults setObject:self.newVersion forKey:@"skipversion"];
        //        NSLog(@"========newVersion=%@",self.newVersion);

    }

}

@end


text:
<?php

$objForm = new Form();

$value = $objForm->getPost('value');

if (!empty($value)) {

	if ($objShipping->updateZone(array('name' => $value), $zone['id'])) {

		echo Helper::json(array('error' => false));

	} else {
		throw new Exception('Record could not be updated');
	}

} else {
	throw new Exception('Invalid entry');
}


text:
package com.navercorp.pinpoint.profiler.modifier.connector.httpclient4;

import java.security.ProtectionDomain;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.navercorp.pinpoint.bootstrap.Agent;
import com.navercorp.pinpoint.bootstrap.instrument.ByteCodeInstrumentor;
import com.navercorp.pinpoint.bootstrap.instrument.DefaultInterceptorGroupDefinition;
import com.navercorp.pinpoint.bootstrap.instrument.InstrumentClass;
import com.navercorp.pinpoint.bootstrap.instrument.InstrumentException;
import com.navercorp.pinpoint.bootstrap.instrument.InterceptorGroupDefinition;
import com.navercorp.pinpoint.bootstrap.interceptor.Interceptor;
import com.navercorp.pinpoint.bootstrap.interceptor.group.InterceptorGroupTransaction;
import com.navercorp.pinpoint.profiler.modifier.AbstractModifier;
import com.navercorp.pinpoint.profiler.modifier.connector.httpclient4.interceptor.HttpClient4Scope;

/**
 * Apache httpclient4 modifier (version 4.2 or before)
 *

 *

 *

 * http://grepcode.com/file/repo1.maven.org/maven2/org.apache.httpcomponents/httpclient4/4.0.3/org/apache/http/impl/client/AbstractHttpClient.java#AbstractHttpClient.execute%28org.apache.http.HttpHost%2Corg.apache.http.HttpRequest%2Corg.apache.http.client.ResponseHandler%2Corg.apache.http.protocol.HttpContext%29
 *
 * Hooking
 * org.apache.http.impl.client.AbstractHttpClient.
 * public <T> T execute(
 *            final HttpHost target,
 *            final HttpRequest request,
 *            final ResponseHandler<? extends T> responseHandler,
 *            final HttpContext context)
 *            throws IOException, ClientProtocolException {
 *

 *
 * @author netspider
 * @author emeroad
 * @author minwoo.jung
 */
public class HttpClient4Modifier extends AbstractModifier {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    public HttpClient4Modifier(ByteCodeInstrumentor byteCodeInstrumentor, Agent agent) {
        super(byteCodeInstrumentor, agent);
    }

    public String getTargetClass() {
        return "org/apache/http/impl/client/AbstractHttpClient";
    }

    public byte[] modify(ClassLoader classLoader, String javassistClassName, ProtectionDomain protectedDomain, byte[] classFileBuffer) {
        if (logger.isInfoEnabled()) {
            logger.info("Modifing. {}", javassistClassName);
        }

        try {
            //The execute method was moved to CloseableHttpClient class from httpclient 4.0 or later.
            //Need to check if CloseableHttpClient class exist.
            byteCodeInstrumentor.getClass(classLoader, "org.apache.http.impl.client.CloseableHttpClient", classFileBuffer);
            logger.info("{} don't need to be modified. Because target method is existed in org.apache.http.impl.client.CloseableHttpClient", javassistClassName);
            return null;
        } catch (InstrumentException e) {
        }

        try {
            InstrumentClass aClass = byteCodeInstrumentor.getClass(classLoader, javassistClassName, classFileBuffer);
            InterceptorGroupDefinition scopeDefinition = new DefaultInterceptorGroupDefinition(HttpClient4Scope.SCOPE);
            InterceptorGroupTransaction scope = byteCodeInstrumentor.getInterceptorGroupTransaction(scopeDefinition);

            addHttpRequestApi(classLoader, protectedDomain, aClass, scope);

            addHttpUriRequestApi(classLoader, protectedDomain, aClass, scope);

            return aClass.toBytecode();
        } catch (Throwable e) {
            logger.warn("httpClient4 modifier error. Caused:{}", e.getMessage(), e);
            return null;
        }
    }

    private void addHttpRequestApi(ClassLoader classLoader, ProtectionDomain protectedDomain, InstrumentClass aClass, InterceptorGroupTransaction scope) throws InstrumentException {
        Interceptor httpRequestApi1 = newHttpRequestInterceptor(classLoader, protectedDomain ,false, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.HttpHost", "org.apache.http.HttpRequest"}, httpRequestApi1);

        Interceptor httpRequestApi2 = newHttpRequestInterceptor(classLoader, protectedDomain, false, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.HttpHost", "org.apache.http.HttpRequest", "org.apache.http.protocol.HttpContext"}, httpRequestApi2);

        Interceptor httpRequestApi3 = newHttpRequestInterceptor(classLoader, protectedDomain, true, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.HttpHost", "org.apache.http.HttpRequest", "org.apache.http.client.ResponseHandler"}, httpRequestApi3);

        Interceptor httpRequestApi4 = newHttpRequestInterceptor(classLoader, protectedDomain, true, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.HttpHost", "org.apache.http.HttpRequest", "org.apache.http.client.ResponseHandler", "org.apache.http.protocol.HttpContext"}, httpRequestApi4);
    }

    private Interceptor newHttpRequestInterceptor(ClassLoader classLoader, ProtectionDomain protectedDomain, boolean isHasCallbackParam, InterceptorGroupTransaction scope) throws InstrumentException {
        return byteCodeInstrumentor.newInterceptor(classLoader, protectedDomain, "com.navercorp.pinpoint.profiler.modifier.connector.httpclient4.interceptor.HttpRequestExecuteInterceptor", new Object[] {isHasCallbackParam, scope}, new Class[] {boolean.class, InterceptorGroupTransaction.class});
    }

    private void addHttpUriRequestApi(ClassLoader classLoader, ProtectionDomain protectedDomain, InstrumentClass aClass, InterceptorGroupTransaction scope) throws InstrumentException {
        Interceptor httpUriRequestInterceptor1 = newHttpUriRequestInterceptor(classLoader, protectedDomain, false, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.client.methods.HttpUriRequest"}, httpUriRequestInterceptor1);

        Interceptor httpUriRequestInterceptor2 = newHttpUriRequestInterceptor(classLoader, protectedDomain, false, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.client.methods.HttpUriRequest", "org.apache.http.protocol.HttpContext"}, httpUriRequestInterceptor2);

        Interceptor httpUriRequestInterceptor3 = newHttpUriRequestInterceptor(classLoader, protectedDomain, true, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.client.methods.HttpUriRequest", "org.apache.http.client.ResponseHandler"}, httpUriRequestInterceptor3);

        Interceptor httpUriRequestInterceptor4 = newHttpUriRequestInterceptor(classLoader, protectedDomain, true, scope);
        aClass.addInterceptor("execute", new String[]{"org.apache.http.client.methods.HttpUriRequest", "org.apache.http.client.ResponseHandler", "org.apache.http.protocol.HttpContext"}, httpUriRequestInterceptor4);
    }

    private Interceptor newHttpUriRequestInterceptor(ClassLoader classLoader, ProtectionDomain protectedDomain, boolean isHasCallbackParam, InterceptorGroupTransaction scope) throws InstrumentException {
        return byteCodeInstrumentor.newInterceptor(classLoader, protectedDomain, "com.navercorp.pinpoint.profiler.modifier.connector.httpclient4.interceptor.HttpUriRequestExecuteInterceptor", new Object[] {isHasCallbackParam, scope}, new Class[] {boolean.class, InterceptorGroupTransaction.class});
    }
}


text:
 <?php
 class Groups_model extends CI_Model
 {
      function get_group_list()
      {

        $sql = "SELECT * FROM groups ORDER BY group_id DESC";
        $query = $this->db->query($sql);
        return $query->result();
      }

      function get_group_details($group_id){
        $sql = "SELECT * FROM groups WHERE group_id = ? LIMIT 1";
        $query = $this->db->query($sql, array($group_id));
        return $query->result();
      }

      function get_member_details($group_id){
        $sql = "SELECT * FROM members WHERE group_id = ?";
        $query = $this->db->query($sql, array($group_id));
        return $query->result();
      }

      function get_groups_new(){
        $sql = "SELECT * FROM groups_new" ;
        $query = $this->db->query($sql);
        return $query->result();
      }

 }


text:
package com.lzy.demo.okgo;

import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.DialogCallback;
import com.lzy.demo.callback.StringDialogCallback;
import com.lzy.demo.model.LzyResponse;
import com.lzy.demo.model.ServerModel;
import com.lzy.demo.utils.ColorUtils;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class MethodActivity extends BaseDetailActivity implements AdapterView.OnItemClickListener {

    @Bind(R.id.gridView) GridView gridView;

    private String[] methods = {"GET", "HEAD", "OPTIONS", "POST", "PUT", "DELETE", "PATCH", "TRACE"};

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_method);
        ButterKnife.bind(this);

        setTitle("请求方法演示");
        gridView.setAdapter(new MyAdapter());
        gridView.setOnItemClickListener(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        switch (position) {
            case 0:
                OkGo.<LzyResponse<ServerModel>>get(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 1:
                OkGo.<String>head(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new StringDialogCallback(this) {
                            @Override
                            public void onSuccess(Response<String> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<String> response) {
                                handleError(response);
                            }
                        });
                break;
            case 2:
                OkGo.<LzyResponse<ServerModel>>options(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 3:
                OkGo.<LzyResponse<ServerModel>>post(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .params("param2", "paramValue2")//
                        .params("param3", "paramValue3")//
                        .isMultipart(true)         //强制使用 multipart/form-data 表单上传(只是演示,不需要的话不要设置。默认就是false)
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 4:
                OkGo.<LzyResponse<ServerModel>>put(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 5:
                OkGo.<LzyResponse<ServerModel>>delete(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .upString("这是要上传的数据")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 6:
                OkGo.<LzyResponse<ServerModel>>patch(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .upString("这是要上传的数据")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 7:
                OkGo.<LzyResponse<ServerModel>>trace(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
        }
    }

    private class MyAdapter extends BaseAdapter {
        @Override
        public int getCount() {
            return methods.length;
        }

        @Override
        public String getItem(int position) {
            return methods[position];
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = new TextView(getApplicationContext());
            }
            TextView textView = (TextView) convertView;
            textView.setGravity(Gravity.CENTER);
            textView.setHeight(200);
            textView.setText(getItem(position));
            textView.setTextColor(Color.WHITE);
            textView.setTextSize(16);
            textView.setBackgroundColor(ColorUtils.randomColor());
            return textView;
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>WifiScanRsultBroadCast</title>
<meta name="date" content="2014-05-11">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法

com.txmcu.iairsdk.wifi

类 WifiScanRsultBroadCast

java.lang.Object

BroadcastReceiver

com.txmcu.iairsdk.wifi.WifiScanRsultBroadCast

public class WifiScanRsultBroadCast
extends BroadcastReceiver

构造器概要

构造器

构造器和说明

WifiScanRsultBroadCast(WifiHotManager.WifiBroadCastOperations operations)

方法概要

方法

限定符和类型
方法和说明

void
onReceive(Context context,
         Intent intent)

从类继承的方法 java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

构造器详细资料

WifiScanRsultBroadCast

public WifiScanRsultBroadCast(WifiHotManager.WifiBroadCastOperations operations)

方法详细资料

onReceive

public void onReceive(Context context,
             Intent intent)

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Y!LDA: src/commons/LDAUtil.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>

Main Page

Related Pages

Namespaces

Classes

Files

File List

File Members

src/commons/LDAUtil.cpp File Reference
#include "LDAUtil.h"

#include <vector>

#include <string>

#include <sstream>

#include <algorithm>

#include <iterator>

#include <iostream>

Namespaces

namespace  	LDAUtil

<address style="text-align: right;">Generated on Tue Jul 19 11:45:25 2011 for Y!LDA by

 1.6.3 </address>


text:
<!-- pace blue minimal theme -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/blue/pace-theme-minimal.min.css">
<!-- pace (pace js needs to be here) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js"></script>

<!-- animate.css -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">

<!-- bootstrap -->
<!-- bootstrap compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- bootstrap theme paper http://bootswatch.com/paper/bootstrap.min.css -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/paper/bootstrap.min.css">

<!-- bootstrap plug-ins -->
<!-- bootstrap-select -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css">
<!-- bootstrap-datepicker -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker3.min.css">

<!-- font awesome -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

@if (isset($fileInput) && $fileInput)
	<!-- bootstrap-fileinput -->
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.3.8/css/fileinput.min.css">
@endif

@if (isset($needDT) && $needDT)
	<!-- dataTables -->
	<!-- dataTables 1.10.13 bootstrap -->
	<!-- dataTables buttons 1.2.4 bootstrap -->
	<!-- dataTables responsive 2.1.1 bootstrap -->
	<!-- dataTables select 1.2.0 bootstrap -->
	<!-- dataTables fixedheader 3.1.2 bootstrap -->
	<link rel="stylesheet" href="https://cdn.datatables.net/v/bs/jszip-2.5.0/pdfmake-0.1.18/dt-1.10.13/b-1.2.4/b-colvis-1.2.4/b-html5-1.2.4/b-print-1.2.4/fh-3.1.2/r-2.1.1/se-1.2.0/datatables.min.css">
@endif

<link rel="stylesheet" href="{{ asset('/css/style.css') }}">
<link rel="stylesheet" href="{{ asset('/css/media.css') }}">