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

      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

      <title>Appropriate Treatment for Children with Upper Respiratory Infection (URI)</title>

               eMeasure Title
               Appropriate Treatment for Children with Upper Respiratory Infection (URI)

               eMeasure Identifier
(Measure Authoring Tool)
               154
               eMeasure Version number
               1

               NQF Number
               0069
               GUID
                e455fac0-f2cb-4074-a351-1e68a90fb7cf

               Measurement Period
               January 1, 20xx  through December 31, 20xx

               Measure Steward
               National Committee for Quality Assurance

               Measure Developer
               National Committee for Quality Assurance

               Endorsed By
               National Quality Forum

               Description

Percentage of children 3 months-18 years of age who were diagnosed with upper respiratory infection (URI) and were not dispensed an antibiotic prescription on or three days after the episode.

               Copyright

Physician Performance Measure (Measures) and related data specifications were developed by the National Committee for Quality Assurance (NCQA).

The Measures are copyrighted but can be reproduced and distributed, without modification, for noncommercial purposes (e.g., use by healthcare providers in connection with their practices). Commercial use is defined as the sale, licensing, or distribution of the Measures for commercial gain, or incorporation of the Measures into a product or service that is sold, licensed or distributed for commercial gain. Commercial use of the Measures requires a license agreement between the user and NCQA. NCQA is not responsible for any use of the Measures.

(c) 2012 National Committee for Quality Assurance. All Rights Reserved.

Limited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. NCQA disclaims all liability for use or accuracy of any CPT or other codes contained in the specifications.

CPT(R) contained in the Measure specifications is copyright 2004-2011 American Medical Association. LOINC (R) copyright 2004-2011 Regenstrief Institute, Inc.
This material contains SNOMED Clinical Terms (R) (SNOMED CT[R]) copyright 2004-2011 International Health Terminology Standards Development Organisation.  ICD-10 Copyright 2011 World Health Organization. All Rights Reserved.

               Disclaimer

These performance Measures are not clinical guidelines and do not establish a standard of medical care, and have not been tested for all potential applications.

THE MEASURES AND SPECIFICATIONS ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND.

               Measure Scoring
               Proportion

               Measure Type
               Process

               Stratification

None

               Risk Adjustment

None

               Rate Aggregation

None

               Rationale

In 1998, 25 million patients (adults and children) sought care for non-specific upper respiratory infections (URI, also known as the the common cold) and 30 percent received antibiotics. (Gonzales 2001)

Inappropriate antibiotic prescriptions for URI, pharyngitis, and bronchitis are estimated to amount to 55 percent (22.6 million) of all antibiotics prescribed for acute respiratory infections, costing $726 million in 1998 (Gonzales 2001).

Using antibiotics inappropriately can lead to antibiotic resistance, which can result in increased morbidity and mortality (Feikin 2000). The resulting increased effort to treat drug-resistant pathogens can also lead to more repeated health care visits, greater risk of disease complications, and increased health care costs (Feikin 2000; Dagan 2000; Watanabe 2000).

               Clinical Recommendation Statement

American Family Physician (Wong, Blumberg, and Lowe 2006)

- A diagnosis of acute bacterial rhinosinusitis should be considered in patients with symptoms of a viral upper respiratory infection that have not improved after 10 days or that worsen after five to seven days. (C)

- Treatment of sinus infection with antibiotics in the first week of symptoms is not recommended. (C)

- Telling patients not to fill an antibiotic prescription unless symptoms worsen or fail to improve after several days can reduce the inappropriate use of antibiotics. (B)

               Improvement Notation

Higher scores indicates better quality

               Reference

Wong, D.M., D.A. Blumberg, and L.G. Lowe. 2006. “Guidelines for the use of antibiotics in acute upper respiratory tract infections.” Am Fam Physician 74(6):956-966.

               Reference

Dagan, R. 2000. “Clinical significance of resistant organisms in otitis media.” Pediatr Infect Dis J 19(4):378-382.

               Reference

Feikin, D.R., A. Schuchat, M. Kolczak, N.L. Barrett, L.H. Harrison, L. Lefkowitz, A. McGeer, M.M. Farley, D.J. Vugia, C. Lexau, K.R. Stefonek, J.E. Patterson, J.H. Jorgensen. 2000. “Mortality from invasive pneumococcal pneumonia in the era of antibiotic resistance, 1995-1997.” Am J Public Health 90(2):223-229.

               Reference

Gonzales, R., D.C. Malone, J.H. Maselli, M.A. Sande. 2001. “Excessive antibiotic use for acute respiratory infections in the United States.” Clin Infect Dis 33(6):757-762.

               Reference

Watanabe, H., S. Sato, K. Kawakami, K. Watanabe, K. Oishi, N. Rikitomi, T. li, H. Ikeda, A. Sato, T. Nagatake. 2000. “A comparative clinical study of pneumonia by penicillin-resistant and sensitive Streptococcus pneumoniae in a community hospital.” Respirology 5(1):59-64.

               Definition

None

               Guidance

This measure examines all episodes per patient during the measurement period.

               Transmission Format

TBD

               Initial Patient Population

Children age 3 months to 18 years who had an outpatient or emergency department (ED) visit with a diagnosis of upper respiratory infection (URI) during the measurement period

               Denominator

Equals Initial Patient Population

               Denominator Exclusions

Exclude children who are taking antibiotics in the 30 days prior to the date of the encounter during which the diagnosis was established. Exclude children who had an encounter with a competing diagnosis within three days after the initial diagnosis of URI.

               Numerator

Children without a prescription for antibiotic medication on or 3 days after the outpatient or ED visit for an upper respiratory infection

               Numerator Exclusions

Not Applicable

               Denominator Exceptions

None

               Measure Population

Not Applicable

               Measure Observations

Not Applicable

               Supplemental Data Elements

For every patient evaluated by this measure also identify payer, race, ethnicity and sex.

Table of Contents

Population criteria

Data criteria (QDM Data Elements)

Reporting Stratification

Supplemental Data Elements

Population criteria

               Initial Patient Population =

AND: "Patient Characteristic Birthdate: birth date"  >= 3 month(s) starts before start of "Measurement Period"

AND: "Patient Characteristic Birthdate: birth date"  <= 18 year(s) starts before start of "Measurement Period"

AND:

OR: "Occurrence A of Diagnosis, Active: Upper Respiratory Infection" starts during

OR: "Encounter, Performed: Office Visit"

OR: "Encounter, Performed: Emergency Department Visit"

OR: "Encounter, Performed: Preventive Care- Initial Office Visit, 0 to 17"

OR: "Encounter, Performed: Preventive Care - Established Office Visit, 0 to 17"

OR: "Encounter, Performed: Hospital Observation Care - Initial"

OR: "Encounter, Performed: Face-to-Face Interaction"

 during "Measurement Period"

OR:

OR: "Encounter, Performed: Office Visit"

OR: "Encounter, Performed: Emergency Department Visit"

OR: "Encounter, Performed: Preventive Care- Initial Office Visit, 0 to 17"

OR: "Encounter, Performed: Preventive Care - Established Office Visit, 0 to 17"

OR: "Encounter, Performed: Hospital Observation Care - Initial"

OR: "Encounter, Performed: Face-to-Face Interaction"

 during  ("Occurrence A of Diagnosis, Active: Upper Respiratory Infection" during "Measurement Period")

               Denominator =

AND: "Initial Patient Population"

               Denominator Exclusions =

AND:

OR: "Diagnosis, Active: Competing Conditions for Respiratory Conditions"  <= 3 day(s) starts after start of "Occurrence A
                           of Diagnosis, Active: Upper Respiratory Infection"

OR: "Medication, Active: Antibiotic Medications"  <= 30 day(s) starts before or during "Occurrence A of Diagnosis, Active:
                           Upper Respiratory Infection"

               Numerator =

AND NOT: "Medication, Order: Antibiotic Medications"  <= 3 day(s) starts after start of "Occurrence A of Diagnosis, Active:
                     Upper Respiratory Infection"

               Denominator Exceptions =

None

Data criteria (QDM Data Elements)

               "Diagnosis, Active: Competing Conditions for Respiratory Conditions" using "Competing Conditions for Respiratory Conditions Grouping Value Set (2.16.840.1.113883.3.464.1003.102.12.1017)"

               "Diagnosis, Active: Upper Respiratory Infection" using "Upper Respiratory Infection Grouping Value Set (2.16.840.1.113883.3.464.1003.102.12.1022)"

               "Encounter, Performed: Emergency Department Visit" using "Emergency Department Visit Grouping Value Set (2.16.840.1.113883.3.464.1003.101.12.1010)"

               "Encounter, Performed: Face-to-Face Interaction" using "Face-to-Face Interaction Grouping Value Set (2.16.840.1.113883.3.464.1003.101.12.1048)"

               "Encounter, Performed: Hospital Observation Care - Initial" using "Hospital Observation Care - Initial Grouping Value Set (2.16.840.1.113883.3.464.1003.101.12.1002)"

               "Encounter, Performed: Office Visit" using "Office Visit Grouping Value Set (2.16.840.1.113883.3.464.1003.101.12.1001)"

               "Encounter, Performed: Preventive Care - Established Office Visit, 0 to 17" using "Preventive Care - Established Office Visit, 0 to 17 Grouping Value Set (2.16.840.1.113883.3.464.1003.101.12.1024)"

               "Encounter, Performed: Preventive Care- Initial Office Visit, 0 to 17" using "Preventive Care- Initial Office Visit, 0 to 17 Grouping Value Set (2.16.840.1.113883.3.464.1003.101.12.1022)"

               "Medication, Active: Antibiotic Medications" using "Antibiotic Medications Grouping Value Set (2.16.840.1.113883.3.464.1003.196.12.1001)"

               "Medication, Order: Antibiotic Medications" using "Antibiotic Medications Grouping Value Set (2.16.840.1.113883.3.464.1003.196.12.1001)"

               "Patient Characteristic Birthdate: birth date" using "birth date LOINC Value Set (2.16.840.1.113883.3.560.100.4)"

Reporting Stratification

None

Supplemental Data Elements

               "Patient Characteristic Ethnicity: Ethnicity" using "Ethnicity CDC Value Set (2.16.840.1.114222.4.11.837)"

               "Patient Characteristic Payer: Payer" using "Payer Source of Payment Typology Value Set (2.16.840.1.114222.4.11.3591)"

               "Patient Characteristic Race: Race" using "Race CDC Value Set (2.16.840.1.114222.4.11.836)"

               "Patient Characteristic Sex: ONC Administrative Sex" using "ONC Administrative Sex Administrative Sex Value Set (2.16.840.1.113762.1.4.1)"

               Measure Set

None


text:
require 'spec_helper'

describe "gws_schedule_user_plans", type: :feature, dbscope: :example do
  let(:site) { gws_site }
  let!(:item) { create :gws_schedule_facility_plan }
  let(:index_path) { gws_schedule_user_plans_path site, gws_user }
  let(:new_path) { new_gws_schedule_user_plan_path site, gws_user }
  let(:show_path) { gws_schedule_user_plan_path site, gws_user, item }
  let(:edit_path) { edit_gws_schedule_user_plan_path site, gws_user, item }
  let(:delete_path) { soft_delete_gws_schedule_user_plan_path site, gws_user, item }

  context "with auth", js: true do
    before { login_gws_user }

    it "#index" do
      visit index_path
      wait_for_ajax
      expect(page).to have_content(item.name)
    end

    it "#events" do
      sdate = item.start_at.to_date.beginning_of_month
      edate = item.end_at.to_date.beginning_of_month + 1.month
      visit "#{index_path}/events.json?s[start]=#{sdate}&s[end]=#{edate}"
      expect(page.body).to have_content(item.name)
    end

    it "#new" do
      visit new_path
      within "form#item-form" do
        fill_in "item[name]", with: "name"
        click_button I18n.t('ss.buttons.save')
      end
      wait_for_ajax
      expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'))
    end

    it "#show" do
      visit show_path
      expect(page).to have_content(item.name)
    end

    it "#edit" do
      visit edit_path
      within "form#item-form" do
        fill_in "item[name]", with: "modify"
        click_button I18n.t('ss.buttons.save')
      end
      wait_for_ajax
      expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'))
    end

    it "#delete" do
      visit index_path
      first('span.fc-title', text: item.name).click
      expect(current_path).to eq show_path
      within ".nav-menu" do
        click_link I18n.t('ss.links.delete')
      end
      within "form" do
        click_button I18n.t('ss.buttons.delete')
      end
      wait_for_ajax
      expect(current_path).to eq index_path
      expect(page).to have_css('#notice', text: I18n.t('ss.notice.deleted'))
    end

    context 'with gws_schedule_facility_plan_few_days' do
      let!(:item) { create :gws_schedule_facility_plan_few_days }

      it "#index" do
        visit index_path
        wait_for_ajax
        expect(page).to have_content(item.name)
      end

      it "#events" do
        sdate = item.start_on
        edate = item.end_on
        visit "#{index_path}/events.json?s[start]=#{sdate}&s[end]=#{edate}"
        expect(page.body).to have_content(item.name)
      end

      it "#new" do
        visit new_path
        within "form#item-form" do
          fill_in "item[name]", with: "name"
          click_button I18n.t('ss.buttons.save')
        end
        wait_for_ajax
        expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'))
      end

      it "#show" do
        visit show_path
        expect(page).to have_content(item.name)
      end

      it "#edit" do
        visit edit_path
        within "form#item-form" do
          fill_in "item[name]", with: "modify"
          click_button I18n.t('ss.buttons.save')
        end
        wait_for_ajax
        expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'))
      end

      it "#delete" do
        visit index_path
        first('span.fc-title', text: item.name).click
        expect(current_path).to eq show_path
        within ".nav-menu" do
          click_link I18n.t('ss.links.delete')
        end
        within "form" do
          click_button I18n.t('ss.buttons.delete')
        end
        wait_for_ajax
        expect(current_path).to eq index_path
        expect(page).to have_css('#notice', text: I18n.t('ss.notice.deleted'))
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
using System;
using L4p.Common.FunnelsModel.comm;
using L4p.Common.Loggers;
using L4p.Common.Wcf;

namespace L4p.Common.FunnelsModel.hub
{
    public static class WcfHelpers
    {
        public static IDisposable AsServiceAt(this IFunnelsResolver target, ILogFile log, string uri)
        {
            var wcf = hub.wcf.FunnelsResolver.New(target);

            var host = WcfHost<IFunnelsResolver>.New(log, wcf);
            host.StartAt(uri);

            return host;
        }

        public static IDisposable AsService(this IFunnelsShop target, ILogFile log)
        {
            var info = target.GetInfo();
            var uri = info.Uri;

            var wcf = hub.wcf.FunnelsShop.New(target);

            var host = WcfHost<IFunnelsShop>.New(log, wcf);
            host.StartAt(uri);

            return host;
        }
    }
}


text:
using OKHOSTING.ORM;
using OKHOSTING.ORM.Operations;
using OKHOSTING.Sql.Schema;
using System;

namespace OKHOSTING.Authentication
{
	/// <summary>
	/// Exception that is thrown when a database security violation is performed
	/// </summary>
	public class DbSecurityException : Exception
	{
		/// <summary>
		/// User that performs the security violation
		/// </summary>
		public readonly User User;

		/// <summary>
		/// DataType that was being accesed by the user
		/// </summary>
		public readonly DataType DataType;

		/// <summary>
		/// Operation the user was trying to perform
		/// </summary>
		public readonly Operation Operation;

		/// <summary>
		/// Creates a new instance
		/// </summary>
		/// <param name="user">User that performs the security violation</param>
		/// <param name="dtype">DataType that was being accesed by the user</param>
		/// <param name="operation">Operation the user was trying to perform</param>
		public DbSecurityException(User user, DataType dtype, Operation operation)
		{
			this.User = user;
			this.DataType = dtype;
			this.Operation = operation;
		}

		/// <summary>
		/// Creates a new instance
		/// </summary>
		/// <param name="user">User that performs the security violation</param>
		/// <param name="dtype">DataType that was being accesed by the user</param>
		/// <param name="operation">Operation the user was trying to perform</param>
		/// <param name="message">Custom message for this exception</param>
		public DbSecurityException(User user, DataType dtype, Operation operation, string message): base(message)
		{
			User = user;
			DataType = dtype;
			Operation = operation;
		}

		public override string Message
		{
			get
			{
				return
					base.Message +
					". " +
					"User : " + User +
					", " +
					"DataType : " + DataType +
					", " +
					"Operation : " + Operation;
			}
		}
	}
}


text:
package io.dropwizard.metrics;

import javax.annotation.Nonnull;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;

/**
 * A {@link ThreadFactory} that monitors the number of threads created, running and terminated.
 *
 * It will register the metrics using the given (or auto-generated) name as classifier, e.g:
 * "your-thread-delegate.created", "your-thread-delegate.running", etc.
 */
public class InstrumentedThreadFactory implements ThreadFactory {
    private static final AtomicLong nameCounter = new AtomicLong();

    private final ThreadFactory delegate;
    private final Meter created;
    private final Counter running;
    private final Meter terminated;

    /**
     * Wraps a {@link ThreadFactory}, uses a default auto-generated name.
     *
     * @param delegate {@link ThreadFactory} to wrap.
     * @param registry {@link MetricRegistry} that will contain the metrics.
     */
    public InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry) {
        this(delegate, registry, "instrumented-thread-delegate-" + nameCounter.incrementAndGet());
    }

    /**
     * Wraps a {@link ThreadFactory} with an explicit name.
     *
     * @param delegate {@link ThreadFactory} to wrap.
     * @param registry {@link MetricRegistry} that will contain the metrics.
     * @param name     name for this delegate.
     */
    public InstrumentedThreadFactory(ThreadFactory delegate, MetricRegistry registry, String name) {
        this.delegate = delegate;
        this.created = registry.meter(MetricRegistry.name(name, "created"));
        this.running = registry.counter(MetricRegistry.name(name, "running"));
        this.terminated = registry.meter(MetricRegistry.name(name, "terminated"));
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Thread newThread(@Nonnull Runnable runnable) {
        Runnable wrappedRunnable = new InstrumentedRunnable(runnable);
        Thread thread = delegate.newThread(wrappedRunnable);
        created.mark();
        return thread;
    }

    private class InstrumentedRunnable implements Runnable {
        private final Runnable task;

        InstrumentedRunnable(Runnable task) {
            this.task = task;
        }

        @Override
        public void run() {
            running.inc();
            try {
                task.run();
            } finally {
                running.dec();
                terminated.mark();
            }
        }
    }
}


text:
package org.dataone.annotator.generator;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dataone.service.types.v1.Identifier;

import com.hp.hpl.jena.ontology.OntDocumentManager;
import com.hp.hpl.jena.rdf.model.ModelFactory;

public abstract class AnnotationGenerator {

	private static Log log = LogFactory.getLog(AnnotationGenerator.class);

	public static String rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
	public static String rdfs = "http://www.w3.org/2000/01/rdf-schema#";
	public static String owl = "http://www.w3.org/2002/07/owl#";
	public static String oboe = "http://ecoinformatics.org/oboe/oboe.1.2/oboe.owl#";
	public static String oboe_core = "http://ecoinformatics.org/oboe/oboe.1.2/oboe-core.owl#";
	public static String oboe_characteristics = "http://ecoinformatics.org/oboe/oboe.1.2/oboe-characteristics.owl#";
	public static String oboe_sbc = "http://ecoinformatics.org/oboe-ext/sbclter.1.0/oboe-sbclter.owl#";
	public static String oa = "http://www.w3.org/ns/oa#";
	public static String oa_source = "http://www.w3.org/ns/oa.rdf";
	public static String dcterms = "http://purl.org/dc/terms/";
	public static String dcterms_source = "http://dublincore.org/2012/06/14/dcterms.rdf";
	public static String foaf = "http://xmlns.com/foaf/0.1/";
	public static String foaf_source = "http://xmlns.com/foaf/spec/index.rdf";
    public static String prov = "http://www.w3.org/ns/prov#";
    public static String prov_source = "http://www.w3.org/ns/prov.owl";
    public static String cito =  "http://purl.org/spar/cito/";
	public static String OBOE_SBC = "OBOE-SBC";

	private static boolean cacheInitialized;

	public AnnotationGenerator() {
		// import the ontologies we use - shared among all instances
		initializeCache();
	}

	public static void initializeCache() {
		if (!cacheInitialized) {
			// cache the ontologies we use
			OntDocumentManager.getInstance().addModel(oboe, ModelFactory.createOntologyModel().read(oboe));
			OntDocumentManager.getInstance().addModel(oboe_sbc, ModelFactory.createOntologyModel().read(oboe_sbc));
			OntDocumentManager.getInstance().addModel(oa, ModelFactory.createOntologyModel().read(oa_source));
			OntDocumentManager.getInstance().addModel(dcterms, ModelFactory.createOntologyModel().read(dcterms_source));
			OntDocumentManager.getInstance().addModel(foaf, ModelFactory.createOntologyModel().read(foaf_source));
			OntDocumentManager.getInstance().addModel(prov, ModelFactory.createOntologyModel().read(prov));
			//OntDocumentManager.getInstance().addModel(cito, ModelFactory.createOntologyModel().read(cito));
			cacheInitialized = true;
		}
	}

	public abstract Map<Identifier, String> generateAnnotations(Identifier id) throws Exception;

}


text:
// This is a generated file. Not intended for manual editing.
package org.intellij.xquery.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static org.intellij.xquery.psi.XQueryTypes.*;
import org.intellij.xquery.psi.*;
import com.intellij.navigation.ItemPresentation;

public class XQueryVarDeclImpl extends XQueryPsiElementImpl implements XQueryVarDecl {

  public XQueryVarDeclImpl(ASTNode node) {
    super(node);
  }

  public void accept(@NotNull XQueryVisitor visitor) {
    visitor.visitVarDecl(this);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof XQueryVisitor) accept((XQueryVisitor)visitor);
    else super.accept(visitor);
  }

  @Override
  @NotNull
  public List<XQueryAnnotation> getAnnotationList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, XQueryAnnotation.class);
  }

  @Override
  @NotNull
  public List<XQueryCompatibilityAnnotation> getCompatibilityAnnotationList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, XQueryCompatibilityAnnotation.class);
  }

  @Override
  @Nullable
  public XQueryExternalVarPart getExternalVarPart() {
    return findChildByClass(XQueryExternalVarPart.class);
  }

  @Override
  @NotNull
  public List<XQueryMarklogicAnnotation> getMarklogicAnnotationList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, XQueryMarklogicAnnotation.class);
  }

  @Override
  @Nullable
  public XQuerySeparator getSeparator() {
    return findChildByClass(XQuerySeparator.class);
  }

  @Override
  @Nullable
  public XQueryTypeDeclaration getTypeDeclaration() {
    return findChildByClass(XQueryTypeDeclaration.class);
  }

  @Override
  @Nullable
  public XQueryVarName getVarName() {
    return findChildByClass(XQueryVarName.class);
  }

  @Override
  @Nullable
  public XQueryVarValue getVarValue() {
    return findChildByClass(XQueryVarValue.class);
  }

  public ItemPresentation getPresentation() {
    return XQueryPsiImplUtil.getPresentation(this);
  }

  public boolean isExternal() {
    return XQueryPsiImplUtil.isExternal(this);
  }

  public int getTextOffset() {
    return XQueryPsiImplUtil.getTextOffset(this);
  }

  public boolean isPublic() {
    return XQueryPsiImplUtil.isPublic(this);
  }

}


text:
import { StorefrontModule } from '@vue-storefront/core/lib/modules';
import { isServer } from '@vue-storefront/core/helpers'

const hotjarStore = {
  namespaced: true,
  state: {
    key: null
  }
};

const hotjarSnippet = (hjid) => (function (h, o, t, j, a, r) {
  h.hj =
    h.hj ||
    function () {
      (h.hj.q = h.hj.q || []).push(arguments);
    };
  h._hjSettings = { hjid, hjsv: 6 };
  a = o.getElementsByTagName('head')[0];
  r = o.createElement('script');
  r.async = 1;
  r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
  a.appendChild(r);
})(window as any, document, '//static.hotjar.com/c/hotjar-', '.js?sv=');

export const HotjarModule: StorefrontModule = function ({ store, appConfig }) {
  store.registerModule('hotjar', hotjarStore)

  if (!isServer && appConfig.hotjar && appConfig.hotjar.id) {
    hotjarSnippet(appConfig.hotjar.id);
  }
}


text:
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>ResultUi</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet"
        href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
        integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
        crossorigin="anonymous">
  <link rel="stylesheet"
        href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="container">
  <app-root>Loading...</app-root>
</div>
</body>
</html>


text:
import express from 'express';
import * as path from 'path';
import * as bodyParser from 'body-parser';
import * as http from 'http';
import * as os from 'os';
import cookieParser from 'cookie-parser';
import swaggerify from './swagger';
import bunyan from 'bunyan';

const l = bunyan.createLogger({
  name: process.env.APP_ID,
  level: process.env.LOG_LEVEL
});
const app = new express();

export default class ExpressServer {
  constructor() {
    const root = path.normalize(__dirname + '/../..');
    app.set('appPath', root + 'client');
    app.use(bodyParser.json());
    app.use(bodyParser.urlencoded({ extended: true }));
    app.use(cookieParser(process.env.SESSION_SECRET));
    app.use(express.static(`${root}/public`));
  }

  router(routes) {
    swaggerify(app, routes)
    return this;
  }

  listen(port = process.env.PORT) {
    const welcome = port => () => l.info(`up and running in ${process.env.NODE_ENV || 'development'} @: ${os.hostname() } on port: ${port}}`);
    http.createServer(app).listen(port, welcome(port));
    return app;
  }
}


text:
require 'paperclip'

module Paperclip
  class FfmpegWavToMp3 < Processor
    attr_accessor :file, :params, :format

    def initialize(file, options = {}, attachment = nil)
      super
      @file = file
      @params = options[:params] || '-y -i'
      @current_format = File.extname(@file.path)
      @basename = File.basename(@file.path, @current_format)
      @format = options[:format] || 'mp3'
    end

    def make
      source = @file
      output = Tempfile.new([@basename, @format ? ".#{@format}" : '' ])

      begin
        parameters = [@params, ':source', ':dest'].flatten.compact.join(' ').strip.squeeze(' ')
        Paperclip.run('ffmpeg', parameters, :source => File.expand_path(source.path), :dest => File.expand_path(output.path))
      rescue PaperclipCommandLineError
        raise PaperclipError, "There was an error converting #{@basename} to mp3"
      end

      output
    end
  end
end


text:
'use strict';

import request from 'request';
import Boom from 'boom';

import { trelloMicroserviceUrl } from '../../config/config';
import { generateToken } from '../../utils/tokenController';
import { buildResponse } from '../../utils/responseService';
import { userModel } from '../../models/index';

export const saveUser = (req, res) => {
  userModel.findOne({name: req.body.name})
    .then(user => {
      if (user) {
        throw Boom.create(400, 'That name is already taken');
      } else {
        const user = new userModel({
          name: req.body.name,
          fullname: req.body.fullname,
          initials: req.body.initials,
          email: req.body.email,
          application: req.body.application,
          password: req.body.password
        });

        return user.save();
      }
    })
    .then(user => {
      request.post(
        `${trelloMicroserviceUrl}api/signup`,{
          json: {
            name: user.name,
            fullname: user.fullname,
            email: user.email
          }
        },
        function (error, res2, body) {
          if (!error && res2.statusCode === 200) {
            let { token, csrf } = generateToken(user.name, user.email, user._id);

            res.cookie('jwt', token, { httpOnly: true });
            buildResponse(200, csrf, res);
          } else {
            user
              .remove()
              .then(err => {
                if (err) {
                  buildResponse(500, err, res);
                } else {
                  buildResponse(500, 'The user was not created successfully', res);
                }
              })
          }
        }
      );
    })
    .catch(error => {
      if (error.isBoom) {
        buildResponse(error.output.statusCode, error.message, res);
      } else {
        buildResponse(500, error, res);
      }
    });
};


text:
angular.module('ng-blink', []).
  directive('blink', function($timeout) {
    return {
      restrict: 'E',
      transclude: true,
      template:
        '<div ng-transclude class="ng-blink">' +
          '</div>',
      replace: true ,
      controller: function($scope, $element) {

        // IE 6/7/8 don't support CSS animations, so fall back to Javascript
        if ( navigator.userAgent &&  navigator.userAgent.match(/MSIE [6-8]/i)) {
          setInterval(function () {
            $element.addClass("hidden");
            $timeout(function () {
              $element.removeClass("hidden");
            }, 250);
          }, 750);
        }
      }
    };
  });


text:
fopen_create
===========

Opens a file for writing, creating the folder hierarchy if required.

Example
--

`new_path` directory will be created and `file.txt` opened for writing with `fileID`.

    fileID = fopen_create( 'new_path/file.txt' );

Installation
--

To get library clone from github:

    cd to your lib folder
    git clone https://github.com/Matlab-Toolbox/fopen_create.git

Add package to path:

    %% Add package to path
    run(['/path_to_package/fopen_create/load_toolbox.m']);


text:
#ifndef __typedstream_INCLUDE_GNU
#define __typedstream_INCLUDE_GNU

#include "objc.h"
#include "hash.h"

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

typedef int (*objc_typed_read_func)(void*, char*, int);
typedef int (*objc_typed_write_func)(void*, const char*, int);
typedef int (*objc_typed_flush_func)(void*);
typedef int (*objc_typed_eof_func)(void*);

#define OBJC_READONLY   0x01
#define OBJC_WRITEONLY  0x02

#define OBJC_MANAGED_STREAM  0x01
#define OBJC_FILE_STREAM     0x02
#define OBJC_MEMORY_STREAM   0x04

#define OBJC_TYPED_STREAM_VERSION 0x01

typedef struct objc_typed_stream {
  void* physical;
  cache_ptr object_table;	/* read/written objects */
  cache_ptr stream_table;	/* other read/written but shared things.. */
  cache_ptr class_table;	/* class version mapping */
  cache_ptr object_refs;	/* forward references */
  int mode;			/* OBJC_READONLY or OBJC_WRITEONLY */
  int type;			/* MANAGED, FILE, MEMORY etc bit string */
  int version;			/* version used when writing */
  int writing_root_p;
  objc_typed_read_func read;
  objc_typed_write_func write;
  objc_typed_eof_func eof;
  objc_typed_flush_func flush;
} TypedStream;

/* opcode masks */
#define _B_VALUE   0x1fU
#define _B_CODE    0xe0U
#define _B_SIGN    0x10U
#define _B_NUMBER  0x0fU

/* standard opcodes */
#define _B_INVALID 0x00U
#define _B_SINT    0x20U
#define _B_NINT    0x40U
#define _B_SSTR    0x60U
#define _B_NSTR    0x80U
#define _B_RCOMM   0xa0U
#define _B_UCOMM   0xc0U
#define _B_EXT     0xe0U

/* eXtension opcodes */
#define _BX_OBJECT  0x00U
#define _BX_CLASS   0x01U
#define _BX_SEL     0x02U
#define _BX_OBJREF  0x03U
#define _BX_OBJROOT 0x04U
#define _BX_EXT     0x1fU

/*
** Read and write objects as specified by TYPE.  All the `last'
** arguments are pointers to the objects to read/write.
*/

int objc_write_type (TypedStream* stream, const char* type, const void* data);
int objc_read_type (TypedStream* stream, const char* type, void* data);

int objc_write_types (TypedStream* stream, const char* type, ...);
int objc_read_types (TypedStream* stream, const char* type, ...);

int objc_write_object_reference (TypedStream* stream, id object);
int objc_write_root_object (TypedStream* stream, id object);

long objc_get_stream_class_version (TypedStream* stream, Class class_type);

/*
** Convenience functions
*/

int objc_write_array (TypedStream* stream, const char* type,
		      int count, const void* data);
int objc_read_array (TypedStream* stream, const char* type,
		     int count, void* data);

int objc_write_object (TypedStream* stream, id object);
int objc_read_object (TypedStream* stream, id* object);

/*
** Open a typed stream for reading or writing.  MODE may be either of
** OBJC_READONLY or OBJC_WRITEONLY.
*/

TypedStream* objc_open_typed_stream (FILE* physical, int mode);
TypedStream* objc_open_typed_stream_for_file (const char* file_name, int mode);

void objc_close_typed_stream (TypedStream* stream);

BOOL objc_end_of_typed_stream (TypedStream* stream);
void objc_flush_typed_stream (TypedStream* stream);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* not __typedstream_INCLUDE_GNU */


text:
const geom2 = require('../geometry/geom2')

/**
 * Convert a shape2 to a list of points.
 * The returned list of points take the transforms of the given shape into account
 * @param {Shape2} shape the shape to convert
 * @return {points[]} list of points in 2D space
 */
const toPoints = (params, shape) => {
  const transformedGeom = geom2.transform(shape.transforms, shape.geometry)
  return geom2.toPoints(params, transformedGeom)
}

module.exports = toPoints


text:
package elastic

import (
	"encoding/json"
	"testing"
)

func TestTopHitsAggregation(t *testing.T) {
	fsc := NewFetchSourceContext(true).Include("title")
	agg := NewTopHitsAggregation().
		Sort("last_activity_date", false).
		FetchSourceContext(fsc).
		Size(1)
	src, err := agg.Source()
	if err != nil {
		t.Fatal(err)
	}
	data, err := json.Marshal(src)
	if err != nil {
		t.Fatalf("marshaling to JSON failed: %v", err)
	}
	got := string(data)
	expected := `{"top_hits":{"_source":{"excludes":[],"includes":["title"]},"size":1,"sort":[{"last_activity_date":{"order":"desc"}}]}}`
	if got != expected {
		t.Errorf("expected\n%s\n,got:\n%s", expected, got)
	}
}


text:
package sk.rxjrest.dao.transfer;

public class PerzistentCount {

	private int allCount;
	private int allPages;

	public PerzistentCount(int allCount, int allPages) {
		super();
		this.allCount = allCount;
		this.allPages = allPages;
	}

	public int getAllCount() {
		return allCount;
	}
	public void setAllCount(int allCount) {
		this.allCount = allCount;
	}
	public int getAllPages() {
		return allPages;
	}
	public void setAllPages(int allPages) {
		this.allPages = allPages;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    tools:orientation="vertical"
    tools:parentTag="android.widget.LinearLayout">

    <com.pr0gramm.app.ui.views.UsernameView
        android:id="@+id/username"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:minHeight="16dp"
        android:textAppearance="@style/TextStyle.12.Bold"
        android:textColor="?android:textColorSecondary"
        tools:text="Mopsalarm" />

    <TextView
        android:id="@+id/stats"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minHeight="16dp"
        android:textAppearance="@style/TextStyle.12"
        android:textColor="?android:textColorSecondary"
        tools:text="546 Benis . vor 8 Stunden" />

</merge>


text:
using FilterLists.Archival.Application.Commands;
using FilterLists.Archival.Infrastructure;
using FilterLists.Archival.Infrastructure.Scheduling;
using Hangfire;
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace FilterLists.Archival.Application;

public static class ConfigurationExtensions
{
    public static IHostBuilder ConfigureApplication(this IHostBuilder hostBuilder)
    {
        return hostBuilder.ConfigureInfrastructure();
    }

    public static void AddApplication(this IServiceCollection services, IConfiguration configuration)
    {
        services.AddMediatR(typeof(ConfigurationExtensions).Assembly);
        services.AddInfrastructure(configuration);
    }

    public static void UseApplication(this IApplicationBuilder app)
    {
        app.UseInfrastructure();
        ScheduleArchival();
    }

    private static void ScheduleArchival()
    {
        // TODO: fix InvalidOperationException and re-enable
#if DEBUG
        //JobStorage.Current?.GetMonitoringApi()?.PurgeJobs();
        //new EnqueueArchiveAllLists.Command().EnqueueBackgroundJob();
#else
        //new EnqueueArchiveAllLists.Command().AddOrUpdateRecurringJob(Cron.Daily);
#endif
    }
}


text:
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures;
using osu.Framework.Testing;
using osu.Game.Audio;
using osu.Game.Skinning;
using osu.Game.Tests.Visual;
using osuTK.Graphics;

namespace osu.Game.Tests.Skins
{
    [TestFixture]
    [HeadlessTest]
    public class TestSceneSkinConfigurationLookup : OsuTestScene
    {
        private LegacySkin source1;
        private LegacySkin source2;
        private SkinRequester requester;

        [SetUp]
        public void SetUp() => Schedule(() =>
        {
            Add(new SkinProvidingContainer(source1 = new SkinSource())
                .WithChild(new SkinProvidingContainer(source2 = new SkinSource())
                    .WithChild(requester = new SkinRequester())));
        });

        [Test]
        public void TestBasicLookup()
        {
            AddStep("Add config values", () =>
            {
                source1.Configuration.ConfigDictionary["Lookup"] = "source1";
                source2.Configuration.ConfigDictionary["Lookup"] = "source2";
            });

            AddAssert("Check lookup finds source2", () => requester.GetConfig<string, string>("Lookup")?.Value == "source2");
        }

        [Test]
        public void TestFloatLookup()
        {
            AddStep("Add config values", () => source1.Configuration.ConfigDictionary["FloatTest"] = "1.1");
            AddAssert("Check float parse lookup", () => requester.GetConfig<string, float>("FloatTest")?.Value == 1.1f);
        }

        [Test]
        public void TestBoolLookup()
        {
            AddStep("Add config values", () => source1.Configuration.ConfigDictionary["BoolTest"] = "1");
            AddAssert("Check bool parse lookup", () => requester.GetConfig<string, bool>("BoolTest")?.Value == true);
        }

        [Test]
        public void TestEnumLookup()
        {
            AddStep("Add config values", () => source1.Configuration.ConfigDictionary["Test"] = "Test2");
            AddAssert("Check enum parse lookup", () => requester.GetConfig<LookupType, ValueType>(LookupType.Test)?.Value == ValueType.Test2);
        }

        [Test]
        public void TestLookupFailure()
        {
            AddAssert("Check lookup failure", () => requester.GetConfig<string, float>("Lookup") == null);
        }

        [Test]
        public void TestLookupNull()
        {
            AddStep("Add config values", () => source1.Configuration.ConfigDictionary["Lookup"] = null);

            AddAssert("Check lookup null", () =>
            {
                var bindable = requester.GetConfig<string, string>("Lookup");
                return bindable != null && bindable.Value == null;
            });
        }

        [Test]
        public void TestColourLookup()
        {
            AddStep("Add config colour", () => source1.Configuration.CustomColours["Lookup"] = Color4.Red);
            AddAssert("Check colour lookup", () => requester.GetConfig<SkinCustomColourLookup, Color4>(new SkinCustomColourLookup("Lookup"))?.Value == Color4.Red);
        }

        [Test]
        public void TestGlobalLookup()
        {
            AddAssert("Check combo colours", () => requester.GetConfig<GlobalSkinConfiguration, List<Color4>>(GlobalSkinConfiguration.ComboColours)?.Value?.Count > 0);
        }

        [Test]
        public void TestWrongColourType()
        {
            AddStep("Add config colour", () => source1.Configuration.CustomColours["Lookup"] = Color4.Red);

            AddAssert("perform incorrect lookup", () =>
            {
                try
                {
                    requester.GetConfig<SkinCustomColourLookup, int>(new SkinCustomColourLookup("Lookup"));
                    return false;
                }
                catch
                {
                    return true;
                }
            });
        }

        public enum LookupType
        {
            Test
        }

        public enum ValueType
        {
            Test1,
            Test2,
            Test3
        }

        public class SkinSource : LegacySkin
        {
            public SkinSource()
                : base(new SkinInfo(), null, null, string.Empty)
            {
            }
        }

        public class SkinRequester : Drawable, ISkin
        {
            private ISkinSource skin;

            [BackgroundDependencyLoader]
            private void load(ISkinSource skin)
            {
                this.skin = skin;
            }

            public Drawable GetDrawableComponent(ISkinComponent component) => skin.GetDrawableComponent(component);

            public Texture GetTexture(string componentName) => skin.GetTexture(componentName);

            public SampleChannel GetSample(ISampleInfo sampleInfo) => skin.GetSample(sampleInfo);

            public IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup) => skin.GetConfig<TLookup, TValue>(lookup);
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">

  <bean id="supplierBinder" class="org.springframework.richclient.samples.dataeditor.ui.SupplierBinder">
    <property name="selectDialogId" value="selectSupplierDialog"/>
  </bean>

  <bean id="searchBinder" class="org.springframework.richclient.form.binding.swing.JXSearchFieldBinder"/>

  <bean id="binderSelectionStrategy" depends-on="serviceLocator"
        class="org.springframework.richclient.form.binding.swing.SwingBinderSelectionStrategy">
    <property name="bindersForPropertyTypes">
      <util:map key-type="java.lang.Class">
        <entry key="org.springframework.richclient.samples.dataeditor.domain.Supplier" value-ref="supplierBinder"/>
      </util:map>
    </property>
  </bean>

</beans>


text:
//renderEvent.h

#ifndef __GUTZ_RENDER_EVENT_DOT_H
#define __GUTZ_RENDER_EVENT_DOT_H

#include "cameraEvent.h"
#include "Light.h"

namespace gutz {

class RenderEvent : public CameraEvent {
public:
  RenderEvent()
    : CameraEvent(0,0), _picking(false), _update(false), _displayNum(0)
      {}
  RenderEvent(const CameraSP cam, const ManipSP manip, bool picking = false)
    : CameraEvent(cam, manip), _picking(picking), _update(false), _displayNum(0)
    {}
   virtual ~RenderEvent() {}
   RenderEvent( const RenderEvent &re )
     : CameraEvent( re ), _lights( re._lights), _picking( re._picking ), _update(re._update), _displayNum(re._displayNum)
   {}
   RenderEvent &operator=( const RenderEvent &re )
   {
      CameraEvent::operator =(re);
      _picking    = re._picking;
      _lights     = re._lights;
      _update     = re._update;
      _displayNum = re._displayNum;
      return *this;
   }

   bool picking() const      { return _picking; }
   void setPicking(bool yes) { _picking = yes; }

   /// request that the scene be redrawn
   void requestUpdate() const { _update = true; }
   bool getUpdate() const { return _update; }
   void setUpdate(bool yesno) { _update = yesno; }

   /// Set the display number
   void setDisplayNum(int displayNum) { _displayNum = displayNum; }

   /// Get the display number
   int getDisplayNum(void) const { return _displayNum; }

   LightVec  _lights;

protected:
   bool _picking;
   mutable bool _update;  ///< some renderable requested a redraw
   int _displayNum;

};

typedef gutz::SmartPtr<RenderEvent> RenderEventSP;

} //< end namespace gutz

#endif


text:
using System.Collections.Generic;

namespace UserManagement.Core
{
    /// <summary>
    /// Represents the data required to create a new role.
    /// </summary>
    public interface INewRoleInfo
    {
        /// <summary>
        /// Gets or sets the tenant to contain the new role.
        /// </summary>
        TenantId TenantId { get; set; }

        /// <summary>
        /// Gets or sets the name of the new role.
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// Gets or sets the description of the new role.
        /// </summary>
        string Description { get; set; }

        /// <summary>
        /// Gets or sets the permissions to be contained by the new role.
        /// </summary>
        IList<PermissionId> Permissions { get; set; }
    }
}


text:
package org.camunda.bpm.model.bpmn.impl.instance.dc;

import org.camunda.bpm.model.bpmn.impl.instance.BpmnModelElementInstanceImpl;
import org.camunda.bpm.model.bpmn.instance.dc.Font;
import org.camunda.bpm.model.xml.ModelBuilder;
import org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext;
import org.camunda.bpm.model.xml.type.ModelElementTypeBuilder;
import org.camunda.bpm.model.xml.type.attribute.Attribute;

import static org.camunda.bpm.model.bpmn.impl.BpmnModelConstants.*;
import static org.camunda.bpm.model.xml.type.ModelElementTypeBuilder.ModelTypeInstanceProvider;

/**
 * The DC font element
 *
 * @author Sebastian Menski
 */
public class FontImpl extends BpmnModelElementInstanceImpl implements Font {

  protected static Attribute<String> nameAttribute;
  protected static Attribute<Double> sizeAttribute;
  protected static Attribute<Boolean> isBoldAttribute;
  protected static Attribute<Boolean> isItalicAttribute;
  protected static Attribute<Boolean> isUnderlineAttribute;
  protected static Attribute<Boolean> isStrikeTroughAttribute;

  public static void registerType(ModelBuilder modelBuilder) {
    ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(Font.class, DC_ELEMENT_FONT)
      .namespaceUri(DC_NS)
      .instanceProvider(new ModelTypeInstanceProvider<Font>() {
        public Font newInstance(ModelTypeInstanceContext instanceContext) {
          return new FontImpl(instanceContext);
        }
      });

    nameAttribute = typeBuilder.stringAttribute(DC_ATTRIBUTE_NAME)
      .build();

    sizeAttribute = typeBuilder.doubleAttribute(DC_ATTRIBUTE_SIZE)
      .build();

    isBoldAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_BOLD)
      .build();

    isItalicAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_ITALIC)
      .build();

    isUnderlineAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_UNDERLINE)
      .build();

    isStrikeTroughAttribute = typeBuilder.booleanAttribute(DC_ATTRIBUTE_IS_STRIKE_THROUGH)
      .build();

    typeBuilder.build();
  }

  public FontImpl(ModelTypeInstanceContext instanceContext) {
    super(instanceContext);
  }

  public String getName() {
    return nameAttribute.getValue(this);
  }

  public void setName(String name) {
    nameAttribute.setValue(this, name);
  }

  public Double getSize() {
    return sizeAttribute.getValue(this);
  }

  public void setSize(Double size) {
    sizeAttribute.setValue(this, size);
  }

  public Boolean isBold() {
    return isBoldAttribute.getValue(this);
  }

  public void setBold(boolean isBold) {
    isBoldAttribute.setValue(this, isBold);
  }

  public Boolean isItalic() {
    return isItalicAttribute.getValue(this);
  }

  public void setItalic(boolean isItalic) {
    isItalicAttribute.setValue(this, isItalic);
  }

  public Boolean isUnderline() {
    return isUnderlineAttribute.getValue(this);
  }

  public void SetUnderline(boolean isUnderline) {
    isUnderlineAttribute.setValue(this, isUnderline);
  }

  public Boolean isStrikeThrough() {
    return isStrikeTroughAttribute.getValue(this);
  }

  public void setStrikeTrough(boolean isStrikeTrough) {
    isStrikeTroughAttribute.setValue(this, isStrikeTrough);
  }
}


text:
package com.sometrik.framework;

import com.sometrik.framework.NativeCommand.Selector;

import android.graphics.Bitmap;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;

public class FWActionSheet extends PopupMenu implements NativeCommandHandler {
  private int id;
  private boolean hasEntries = false;
  private boolean isDismissed = false;

  public FWActionSheet(final FrameWork frame, View anchor, final int id) {
    super(frame, anchor);
    this.id = id;

    this.setOnDismissListener(new OnDismissListener() {
      @Override
      public void onDismiss(PopupMenu arg0) {
	if (!isDismissed) {
	  frame.intChangedEvent(id, 0, 0);
	}
      }
    });

    this.setOnMenuItemClickListener(new OnMenuItemClickListener() {
      @Override
      public boolean onMenuItemClick(MenuItem item) {
	frame.intChangedEvent(id, item.getItemId(), 0);
	isDismissed = true;
	return true;
      }
    });

    // Add dummy entry, or the menu will not have any width
    getMenu().add("No menu entries");
    show();
  }

  @Override
  public void onScreenOrientationChange(boolean isLandscape) { }

  @Override
  public void addChild(View view) { }

  @Override
  public void addOption(int optionId, String text) {
    if (!hasEntries) {
      getMenu().clear();
      hasEntries = true;
    }
    getMenu().add(Menu.NONE, optionId, Menu.NONE, text);
  }

  @Override
  public void addColumn(String text, int columnType) { }

  @Override
  public void addData(String text, int row, int column, int sheet) { }

  @Override
  public void setValue(String v) { }

  @Override
  public void setBitmap(Bitmap bitmap) { }

  @Override
  public void addImageUrl(String url, int width, int height) { }

  @Override
  public void setValue(int v) { }

  @Override
  public void reshape(int value, int size) { }

  @Override
  public void reshape(int size) { }

  @Override
  public void setViewVisibility(boolean visible) { }

  @Override
  public void setStyle(Selector selector, String key, String value) { }

  @Override
  public void applyStyles() { }

  @Override
  public void setError(boolean hasError, String errorText) { }

  @Override
  public void clear() { }

  @Override
  public void flush() { }

  @Override
  public void deinitialize() {
    dismiss();
  }

  @Override
  public int getElementId() {
    return id;
  }

}


text:
namespace NContainer.AdapterProviders {
    internal interface ReflectionConstruction<T> {
        ReflectionSolver<T> Reflector {get;
        }
    }
}


text:
@implementation NSDate (ATCategory)

+ (NSDate *)dateForAtndDateString:(NSString *)dateString {
    NSDate *date = nil;
    if (dateString && (NSNull *)dateString != [NSNull null] && dateString.length >= 19) {
        NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
        [formatter setLocale:[NSLocale currentLocale]];
        [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"];
        date = [formatter dateFromString:[dateString substringWithRange:NSMakeRange(0, 19)]];
    }
	return date;
}

+ (NSDate *)dateConvertFromPstDate:(NSDate *)sourceDate {
    NSTimeZone* sourceTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"PST"];
    NSTimeZone* destinationTimeZone = [NSTimeZone systemTimeZone];

    NSInteger sourceGMTOffset = [sourceTimeZone secondsFromGMTForDate:sourceDate];
    NSInteger destinationGMTOffset = [destinationTimeZone secondsFromGMTForDate:sourceDate];
    NSTimeInterval interval = sourceGMTOffset - destinationGMTOffset;

    return [[[NSDate alloc] initWithTimeInterval:interval sinceDate:sourceDate] autorelease];
}

+ (NSDate *)dateForRssItemPubDateString:(NSString *)dateString {
    NSDate *date = nil;
    if (dateString && (NSNull *)dateString != [NSNull null]) {
        NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
        [formatter setLocale:[NSLocale currentLocale]];
        [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss z"];
        date = [formatter dateFromString:dateString];
    }
	return date;
}

+ (NSDate *)dateFromYmdString:(NSString *)ymd {
    return [NSDate dateFromYmdString:ymd timeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
}

+ (NSDate *)dateFromYmdString:(NSString *)ymd timeZone:(NSTimeZone *)timeZone {
    NSDate *date = nil;
    if (ymd && ymd.length >= 8) {
        TKDateInformation info;
        info.hour = 0;
        info.minute = 0;
        info.second = 0;
        info.weekday = 0;
        info.year = [[ymd substringWithRange:NSMakeRange(0, 4)] intValue];
        info.month = [[ymd substringWithRange:NSMakeRange(4, 2)] intValue];
        info.day = [[ymd substringWithRange:NSMakeRange(6, 2)] intValue];
        date = [NSDate dateFromDateInformation:info timeZone:timeZone];
    }
    return date;
}

- (NSString *)stringYmd {
    return [self stringYmdWithTimeZone:nil];
}

- (NSString *)stringYmdWithTimeZone:(NSTimeZone *)tz {
    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    if (tz) {
        [dateFormatter setTimeZone:tz];
    }
    [dateFormatter setLocale:[NSLocale currentLocale]];
	[dateFormatter setDateFormat:@"yyyyMMdd"];
    NSString *ymd = [dateFormatter stringFromDate:self];
    return ymd;
}

- (NSString *)stringForDispDateYmw {
    return [self stringForDispDateYmwWithTimeZone:nil];
}

- (NSString *)stringForDispDateYmwWithTimeZone:(NSTimeZone *)tz {
    NSString *string = nil;
    if (self) {
        NSDateFormatter *ymDateFormatter = [[[NSDateFormatter alloc] init] autorelease];
        [ymDateFormatter setLocale:[NSLocale currentLocale]];
        if (tz) {
            [ymDateFormatter setTimeZone:tz];
        }
        [ymDateFormatter setDateFormat:@"MM月dd日"];
        NSCalendar *cal = [NSCalendar currentCalendar];
        if (tz) {
            [cal setTimeZone:tz];
        }
        NSDateComponents* components = [cal components:NSWeekdayCalendarUnit
                                              fromDate:self];
        NSString* wdayjp = [self weekdayJp:[components weekday]];
        string = [NSString stringWithFormat:@"%@(%@)", [ymDateFormatter stringFromDate:self], wdayjp];
    }
    return string;
}

- (NSString *)stringForDispDateHm {
    return [self stringForDispDateHmWithTimeZone:nil];
}

- (NSString *)stringForDispDateHmWithTimeZone:(NSTimeZone *)tz {
    NSString *string = nil;
    if (self) {
        NSDateFormatter *hmDateFormatter = [[[NSDateFormatter alloc] init] autorelease];
        [hmDateFormatter setLocale:[NSLocale currentLocale]];
        if (tz) {
            [hmDateFormatter setTimeZone:tz];
        }
        [hmDateFormatter setDateFormat:@"HH:mm"];
        string = [hmDateFormatter stringFromDate:self];
    }
    return string;
}

- (NSString*)weekdayJp:(NSInteger)weekday {
    switch (weekday) {
        case 1:    return @"日";
        case 2:    return @"月";
        case 3:    return @"火";
        case 4:    return @"水";
        case 5:    return @"木";
        case 6:    return @"金";
        case 7:    return @"土";
        default:;
    }
    return @"";
}

@end


text:
#include "edge.h"
#include "mesh.h"
#include "mesh_delaunay.h"

void recursive_swap_delaunay( Mesh *mesh, HalfEdge *he )
{
    g_debug( "recursive_swap_delaunay: begin" );

    if ( edge_is_delaunay( he->edge ) || ! edge_is_swappable( he->edge ) )
    {
        g_debug( "recursive_swap_delaunay: returning from recursion" );
        g_debug( "recursive_swap_delaunay: end" );
        return;
    }

    HalfEdge *he1 = he->pair->next;
    HalfEdge *he2 = he->pair->previous;

    mesh_swap_edge( mesh, he->edge );

    recursive_swap_delaunay( mesh, he1 );
    recursive_swap_delaunay( mesh, he2 );

    g_debug( "recursive_swap_delaunay: end" );
}

void mesh_make_cdt_by_edge_flipping( Mesh *mesh )
{
    /* for easy and fast indication if an edge is already in the flippable list */
    GHashTable *flippable_edges_hash = g_hash_table_new( NULL, NULL);
    GList *edges_iter;

    /* make a copy of mesh edges and add them to the hash table */
    GList *flippable_edges = g_list_copy( mesh->edges );
    for ( edges_iter = flippable_edges; edges_iter != NULL; edges_iter = g_list_next( edges_iter ) )
    {
        Edge *edge = EDGE(edges_iter->data);
        g_hash_table_insert( flippable_edges_hash, edge, edge );
    }

    /* while there are edges to check */
    while ( flippable_edges != NULL )
    {
        /* get the first edge */
        Edge *edge = EDGE(flippable_edges->data);

        /* we will deal with it now, so remove it from the list and the hash */
        flippable_edges = g_list_delete_link( flippable_edges, flippable_edges );
        g_hash_table_remove( flippable_edges_hash, edge );

        /* if the hash is delaunay or not flippable, go to the next edge */
        if ( edge_is_delaunay( edge ) || ! edge_is_swappable( edge ) )
            continue;

        /* otherwise get the neighbouring half-edges */
        HalfEdge *he = &edge->he[0];
        Edge *e1 = he->next->edge;
        Edge *e2 = he->previous->edge;
        Edge *e3 = he->pair->next->edge;
        Edge *e4 = he->pair->previous->edge;
        /* and add them to the list and hash if they are not already there */
        if ( g_hash_table_lookup( flippable_edges_hash, e1 ) == NULL )
        {
            g_hash_table_insert( flippable_edges_hash, e1, e1 );
            flippable_edges = g_list_prepend( flippable_edges, e1 );
        }
        if ( g_hash_table_lookup( flippable_edges_hash, e2 ) == NULL )
        {
            g_hash_table_insert( flippable_edges_hash, e2, e2 );
            flippable_edges = g_list_prepend( flippable_edges, e2 );
        }
        if ( g_hash_table_lookup( flippable_edges_hash, e3 ) == NULL )
        {
            g_hash_table_insert( flippable_edges_hash, e3, e3 );
            flippable_edges = g_list_prepend( flippable_edges, e3 );
        }
        if ( g_hash_table_lookup( flippable_edges_hash, e4 ) == NULL )
        {
            g_hash_table_insert( flippable_edges_hash, e4, e4 );
            flippable_edges = g_list_prepend( flippable_edges, e4 );
        }
        /* finally, swap the edge to make it Delaunay */
        mesh_swap_edge( mesh, edge );
    }

    /* clean up */
    g_hash_table_destroy( flippable_edges_hash );
}

void mesh_split_encroached_boundary_edges( Mesh *mesh )
{
    GSList *encroached_half_edges = NULL;

    HalfEdge *start_he = mesh_get_boundary_halfedge( mesh );
    HalfEdge *boundary_iter = start_he;
    do
    {
        HalfEdge *he = boundary_iter->pair;
        if ( halfedge_is_encroached_upon_by_point( he, NODE_POSITION(he->previous->origin) ) )
            encroached_half_edges = g_slist_prepend( encroached_half_edges, he );
        boundary_iter = boundary_iter->next;
    }
    while ( boundary_iter != start_he );

    while ( encroached_half_edges != NULL )
    {
        HalfEdge *he = HALFEDGE( encroached_half_edges->data );
        encroached_half_edges = g_slist_delete_link( encroached_half_edges, encroached_half_edges );

        HalfEdge *hen = he->next;
        HalfEdge *hep = he->previous;

        mesh_split_edge( mesh, he->edge, NULL, NULL );

        recursive_swap_delaunay( mesh, hen );
        recursive_swap_delaunay( mesh, hep );

        if ( halfedge_is_encroached_upon_by_point( hen->previous, NODE_POSITION(hen->pair->origin) ) )
            encroached_half_edges = g_slist_prepend( encroached_half_edges, hen->previous );
        if ( halfedge_is_encroached_upon_by_point( hep->next, NODE_POSITION(hep->origin) ) )
            encroached_half_edges = g_slist_prepend( encroached_half_edges, hep->next );
    }
}


text:
package com.example.administrator.aviation.ui.activity.intexpawbhousemanage;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.example.administrator.aviation.R;
import com.example.administrator.aviation.http.HttpCommons;
import com.example.administrator.aviation.http.HttpRoot;
import com.example.administrator.aviation.http.intExportawbofwarehouse.HttpIntawbPrepareHouse;
import com.example.administrator.aviation.model.intawbprepare.Hawb;
import com.example.administrator.aviation.model.intawbprepare.MawbInfo;
import com.example.administrator.aviation.model.intawbprepare.PrepareIntAwbInfo;
import com.example.administrator.aviation.ui.activity.intawbofprepare.AppIntExpChildActivity;
import com.example.administrator.aviation.ui.activity.intawbofprepare.AppIntExpGroupActivity;
import com.example.administrator.aviation.ui.base.NavBar;
import com.example.administrator.aviation.util.AviationCommons;
import com.example.administrator.aviation.util.PreferenceUtils;
import com.example.administrator.aviation.util.PullToRefreshView;

import org.ksoap2.serialization.SoapObject;

import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.example.administrator.aviation.R.id.int_group_detail_tev;

/**
 * 国际出港入库管理it
 */

public class AppIntExpAwbHouseItemActivity extends Activity{
    private String ErrString = "";
    private String userBumen;
    private String userName;
    private String userPass;
    private String loginFlag;

    private List<MawbInfo> groupList;
    private ExpandableListView listView;
    private ExpandableAdapter expandableAdapter;

    private ProgressBar intawbProgressBar;
    private TextView intawbLoadTv;

    // 提示没有数据信息
    private TextView showDataTv;

    private PullToRefreshView pullToRefreshView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_appintexpprepareawb);
        initView();
    }

    private void initView() {
        NavBar navBar = new NavBar(this);
        navBar.setTitle(R.string.int_awb_house_item_title);
        navBar.showRight();
        navBar.hideRight();

        listView = (ExpandableListView) findViewById(R.id.int_exp_listview);
        intawbProgressBar = (ProgressBar) findViewById(R.id.int_awb_pb);
        intawbLoadTv = (TextView) findViewById(R.id.int_awb_load_tv);
        showDataTv = (TextView) findViewById(R.id.int_awb_house_load_tv);
        pullToRefreshView = (PullToRefreshView) findViewById(R.id.awb_refresh);

        userBumen = PreferenceUtils.getUserBumen(this);
        userName = PreferenceUtils.getUserName(this);
        userPass = PreferenceUtils.getUserPass(this);
        loginFlag = PreferenceUtils.getLoginFlag(this);

        new GetIntPrepareAsync().execute();

        // 下拉刷新
        final String searchXml = getIntent().getStringExtra("xml");
        pullToRefreshView.disableScroolUp();
        pullToRefreshView.setOnHeaderRefreshListener(new PullToRefreshView.OnHeaderRefreshListener() {
            @Override
            public void onHeaderRefresh(PullToRefreshView view) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
                Map<String, String> params = new HashMap<String, String>();
                params.put("awbXml", searchXml);
                params.put("ErrString", "");
                HttpRoot.getInstance().requstAync(AppIntExpAwbHouseItemActivity.this, HttpCommons.GET_INT_WARE_HOUSE_NAME,
                        HttpCommons.GET_INT_WARE_HOUSE_ACTION, params, new HttpRoot.CallBack() {
                            @Override
                            public void onSucess(Object result) {
                                SoapObject object = (SoapObject) result;
                                String xmls = object.getProperty(0).toString();
                                groupList = PrepareIntAwbInfo.parseAwbInfoXml(xmls);
                                if (groupList != null && groupList.size() >= 1) {
                                    expandableAdapter = new ExpandableAdapter(AppIntExpAwbHouseItemActivity.this);
                                    listView.setAdapter(expandableAdapter);
                                } else {
                                    showDataTv.setVisibility(View.VISIBLE);
                                }
                                pullToRefreshView.onHeaderRefreshComplete();
                            }

                            @Override
                            public void onFailed(String message) {
                                pullToRefreshView.onHeaderRefreshComplete();
                            }

                            @Override
                            public void onError() {
                                pullToRefreshView.onHeaderRefreshComplete();
                            }
                        });
            }
        });

    }

    // 重新进入此界面重新从服务器获取数据(每次修改完数据信息调用此方法重新获取数据)
    @Override
    protected void onResume() {
        super.onResume();
        new  GetIntHousePrepareAsync().execute();
    }

    // 回传参数(接收更新和添加订单传递过来的值更新列表)
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(requestCode == 3 || requestCode == 4 || requestCode == 5 || requestCode == 6
                || requestCode == 7) {
            expandableAdapter.notifyDataSetChanged();
        }
    }

    // 得到数据的异步请求
    class GetIntPrepareAsync extends AsyncTask<Void, Void, String> {
        @Override
        protected String doInBackground(Void... voids) {
            // 查询界面返回的xml数据
            String result = getIntent().getStringExtra(AviationCommons.INT_AWB_HOUSE);
            groupList = PrepareIntAwbInfo.parseAwbInfoXml(result);
            return result;
        }

        @Override
        protected void onPostExecute(String result) {
            super.onPostExecute(result);
                if (groupList == null || groupList.size() <= 0) {
                    showDataTv.setVisibility(View.VISIBLE);
                    intawbProgressBar.setVisibility(View.GONE);
                    intawbLoadTv.setVisibility(View.GONE);
                } else {
                    expandableAdapter = new ExpandableAdapter(AppIntExpAwbHouseItemActivity.this);
                    listView.setAdapter(expandableAdapter);
                    intawbProgressBar.setVisibility(View.GONE);
                    intawbLoadTv.setVisibility(View.GONE);
                    showDataTv.setVisibility(View.GONE);
                }
        }
    }

    public class ExpandableAdapter extends BaseExpandableListAdapter {
        Activity activity;
        public ExpandableAdapter (Activity activity) {
            this.activity = activity;
        }

        @Override
        public Object getChild(int groupPosition, int childPosition) {
            return groupList.get(groupPosition).getHawb().get(childPosition);
        }

        @Override
        public long getChildId(int groupPosition, int childPosition) {
            return childPosition;
        }

        @Override
        public int getChildrenCount(int groupPosition) {
            if (groupList.get(groupPosition).getHawb() != null && groupList.get(groupPosition).getHawb().size() != 0) {
                return groupList.get(groupPosition).getHawb().size();
            } else {
                return 0;
            }
        }

        @Override
        public Object getGroup(int groupPosition) {
            return groupList.get(groupPosition);
        }

        @Override
        public int getGroupCount() {
            return groupList.size();
        }

        @Override
        public long getGroupId(int groupPosition) {
            return groupPosition;
        }

        @Override
        public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
            ExpandableAdapter.GroupViewHolder groupViewHolder;
            if (convertView == null) {
                convertView = LayoutInflater.from(activity).inflate(R.layout.int_group_item, parent, false);
                groupViewHolder = new ExpandableAdapter.GroupViewHolder();
                groupViewHolder.groupMawbIdTv = (TextView) convertView.findViewById(R.id.int_group_mawb_tv);
                groupViewHolder.groupDetailTv = (TextView) convertView.findViewById(int_group_detail_tev);
                groupViewHolder.groupPc = (TextView) convertView.findViewById(R.id.int_group_pc_tv);
                groupViewHolder.groupWeight = (TextView) convertView.findViewById(R.id.int_group_weight_tv);
                groupViewHolder.groupVolume = (TextView) convertView.findViewById(R.id.int_group_volume_tv);
                groupViewHolder.groupImage = (ImageView) convertView.findViewById(R.id.int_group_imageview);
                convertView.setTag(groupViewHolder);
            } else {
                groupViewHolder = (ExpandableAdapter.GroupViewHolder) convertView.getTag();
            }
            String mawb = groupList.get(groupPosition).getMawb();
            if (mawb != null && !mawb.equals("")) {
                groupViewHolder.groupMawbIdTv.setText(mawb);
            } else {
                groupViewHolder.groupMawbIdTv.setText("");
            }
            String pc = groupList.get(groupPosition).getPC();
            if (pc != null && !pc.equals("")) {
                groupViewHolder.groupPc.setText(pc);
            } else {
                groupViewHolder.groupPc.setText("");
            }
            String weight = groupList.get(groupPosition).getWeight();
            if (weight != null && !weight.equals("")) {
                groupViewHolder.groupWeight.setText(weight);
            } else {
                groupViewHolder.groupWeight.setText("");
            }
            String volume = groupList.get(groupPosition).getVolume();
            if (volume != null && !volume.equals("")) {
                groupViewHolder.groupVolume.setText(volume);
            } else {
                groupViewHolder.groupVolume.setText("");
            }
            groupViewHolder.groupDetailTv.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent intent = new Intent(AppIntExpAwbHouseItemActivity.this, AppIntExpGroupActivity.class);
                    Bundle bundle = new Bundle();
                    MawbInfo mawbInfo = groupList.get(groupPosition);
                    bundle.putSerializable(AviationCommons.INT_GROUP_INFO, mawbInfo);
                    bundle.putString(AviationCommons.HIDE_INT_AWB_UPDATE, "hide");
                    intent.putExtras(bundle);
                    startActivity(intent);
                }
            });
            groupViewHolder.groupImage.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent intent = new Intent(AppIntExpAwbHouseItemActivity.this, AppIntExpGroupActivity.class);
                    Bundle bundle = new Bundle();
                    MawbInfo mawbInfo = groupList.get(groupPosition);
                    bundle.putSerializable(AviationCommons.INT_GROUP_INFO, mawbInfo);
                    bundle.putString(AviationCommons.HIDE_INT_AWB_UPDATE, "hide");
                    intent.putExtras(bundle);
                    startActivity(intent);
                }
            });

            return convertView;
        }

        @Override
        public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
            ExpandableAdapter.ChildViewHolder childViewHolder;
            if (convertView == null) {
                convertView = LayoutInflater.from(activity).inflate(R.layout.int_child_group, parent, false);
                childViewHolder = new ExpandableAdapter.ChildViewHolder();
                childViewHolder.childText = (TextView) convertView.findViewById(R.id.int_child_hawbid_tv);
                childViewHolder.childPC = (TextView) convertView.findViewById(R.id.int_child_pc_tv);
                childViewHolder.childWeight = (TextView) convertView.findViewById(R.id.int_child_weight_tv);
                childViewHolder.childVolume = (TextView) convertView.findViewById(R.id.int_child_volume_tv);
                childViewHolder.childLayout = (LinearLayout) convertView.findViewById(R.id.int_child_layout);
                convertView.setTag(childViewHolder);
            } else {
                childViewHolder = (ExpandableAdapter.ChildViewHolder) convertView.getTag();
            }
            if (!groupList.get(groupPosition).getHawb().get(childPosition).getHno().equals("")) {
                childViewHolder.childText.setText(groupList.get(groupPosition).getHawb().get(childPosition).getHno());

            } else {
                return null;
            }
            String pc = groupList.get(groupPosition).getHawb().get(childPosition).getPC();
            if (pc != null && !pc.equals("")) {
                childViewHolder.childPC.setText(pc);
            } else {
                childViewHolder.childPC.setText("");
            }
            String weight = groupList.get(groupPosition).getHawb().get(childPosition).getWeight();
            if (weight != null && !weight.equals("")) {
                childViewHolder.childWeight.setText(weight);
            } else {
                childViewHolder.childWeight.setText("");
            }
            String volume = groupList.get(groupPosition).getHawb().get(childPosition).getVolume();
            if (volume != null && !volume.equals("")) {
                childViewHolder.childVolume.setText(volume);
            } else {
                childViewHolder.childVolume.setText("");
            }

            childViewHolder.childLayout.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent intent = new Intent(AppIntExpAwbHouseItemActivity.this, AppIntExpChildActivity.class);
                    Hawb hawb = groupList.get(groupPosition).getHawb().get(childPosition);
                    Bundle bundle = new Bundle();
                    bundle.putSerializable(AviationCommons.INT_CHILD_INFO, hawb);
                    bundle.putString("mawbId", groupList.get(groupPosition).getMawbID());
                    bundle.putSerializable(AviationCommons.INT_GROUP_MAWB, groupList.get(groupPosition).getMawb());
                    intent.putExtras(bundle);
                    startActivity(intent);
                }
            });

            return convertView;
        }

        @Override
        public boolean hasStableIds() {
            return false;
        }

        @Override
        public boolean isChildSelectable(int groupPosition, int childPosition) {
            //如果子条目需要响应click事件,必需返回true
            return true;
        }
        class GroupViewHolder{
            TextView groupMawbIdTv;
            TextView groupDetailTv;
            TextView groupPc;
            TextView groupWeight;
            TextView groupVolume;
            ImageView groupImage;
        }
        class ChildViewHolder{
            TextView childText;
            TextView childPC;
            TextView childWeight;
            TextView childVolume;
            LinearLayout childLayout;
        }
    }

    // 得到数据的异步请求
    class GetIntHousePrepareAsync extends AsyncTask<Void, Void, String> {

        @Override
        protected String doInBackground(Void... voids) {
            String mawb = getIntent().getStringExtra(AviationCommons.MANAGE_HOUSE_MAWAB);
            String begainTime = getIntent().getStringExtra(AviationCommons.MANAGE_HOUSE_BEGAIN_TIME);
            String endTime = getIntent().getStringExtra(AviationCommons.MANAGE_HOUSE_END_TIME);
            String xml = HttpIntawbPrepareHouse.getIntWareHouseXml(mawb, begainTime, endTime);
            SoapObject object = HttpIntawbPrepareHouse.getIntWareHouseDetail(userBumen, userName,userPass,loginFlag, xml);
            if (object == null) {
                ErrString = "服务器响应失败";
                return null;
            } else {
                String result = object.getProperty(0).toString();
                if (result.equals("anyType{}")) {
                    ErrString = object.getProperty(1).toString();
                    return result;
                } else {
                    result = object.getProperty(0).toString();
                    groupList = PrepareIntAwbInfo.parseAwbInfoXml(result);
                    return result;
                }
            }
        }

        @Override
        protected void onPostExecute(String result) {
            super.onPostExecute(result);
            if (result == null && !ErrString.equals("")) {
                Toast.makeText(AppIntExpAwbHouseItemActivity.this, ErrString, Toast.LENGTH_LONG).show();
                intawbProgressBar.setVisibility(View.GONE);
                intawbLoadTv.setVisibility(View.GONE);
            } else if (result.equals("anyType{}") && !ErrString.equals("")) {
                Toast.makeText(AppIntExpAwbHouseItemActivity.this, ErrString, Toast.LENGTH_LONG).show();
                intawbProgressBar.setVisibility(View.GONE);
                intawbLoadTv.setVisibility(View.GONE);
            }else {
                if (groupList == null || groupList.size() <= 0) {
                    showDataTv.setVisibility(View.VISIBLE);
                    intawbProgressBar.setVisibility(View.GONE);
                    intawbLoadTv.setVisibility(View.GONE);
                } else {
                    expandableAdapter = new ExpandableAdapter(AppIntExpAwbHouseItemActivity.this);
                    listView.setAdapter(expandableAdapter);
                    intawbProgressBar.setVisibility(View.GONE);
                    intawbLoadTv.setVisibility(View.GONE);
                }
            }
        }
    }
}


text:
package org.jf.dexlib.Code.Format;

import org.jf.dexlib.Code.Instruction;
import org.jf.dexlib.Code.Opcode;
import org.jf.dexlib.Code.OffsetInstruction;
import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
import org.jf.dexlib.Util.NumberUtils;

public class Instruction20t extends Instruction implements OffsetInstruction {
    public static final InstructionFactory Factory = new Factory();
    private int targetAddressOffset;

    public Instruction20t(Opcode opcode, int offA) {
        super(opcode);
        this.targetAddressOffset = offA;

        if (targetAddressOffset == 0) {
            throw new RuntimeException("The address offset cannot be 0. Use goto/32 instead.");
        }

        //allow out of range address offsets here, so we have the option of replacing this instruction
        //with goto/16 or goto/32 later
    }

    private Instruction20t(Opcode opcode, byte[] buffer, int bufferIndex) {
        super(opcode);

        assert buffer[bufferIndex] == opcode.value;

        this.targetAddressOffset = NumberUtils.decodeShort(buffer, bufferIndex+2);
        assert targetAddressOffset != 0;
    }

    protected void writeInstruction(AnnotatedOutput out, int currentCodeAddress) {
        if (targetAddressOffset == 0) {
            throw new RuntimeException("The address offset cannot be 0. Use goto/32 instead");
        }

        if (targetAddressOffset < -32768 || targetAddressOffset > 32767) {
            throw new RuntimeException("The address offset is out of range. It must be in [-32768,-1] or [1, 32768]");
        }

        out.writeByte(opcode.value);
        out.writeByte(0x00);
        out.writeShort(targetAddressOffset);
    }

    public void updateTargetAddressOffset(int targetAddressOffset) {
        this.targetAddressOffset = targetAddressOffset;
    }

    public Format getFormat() {
        return Format.Format20t;
    }

    public int getTargetAddressOffset() {
        return targetAddressOffset;
    }

    private static class Factory implements InstructionFactory {
        public Instruction makeInstruction(DexFile dexFile, Opcode opcode, byte[] buffer, int bufferIndex) {
            return new Instruction20t(opcode, buffer, bufferIndex);
        }
    }
}


text:
package org.wso2.wsf.ide.facet.utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.eclipse.core.runtime.IProgressMonitor;
import org.wso2.developerstudio.eclipse.logging.core.IDeveloperStudioLog;
import org.wso2.developerstudio.eclipse.logging.core.Logger;
import org.wso2.developerstudio.eclipse.server.base.core.ServerController;
import org.wso2.developerstudio.eclipse.utils.file.FileUtils;
import org.wso2.wsf.ide.core.plugin.WebServiceWSASCorePlugin;
import org.wso2.wsf.ide.core.plugin.data.ServerModel;
import org.wso2.wsf.ide.core.plugin.messages.WSASCoreUIMessages;
import org.wso2.wsf.ide.core.utils.WSASCoreUtils;
import org.wso2.wsf.ide.facet.messages.WSASFacetUIMessages;

public class WSASWebappUtils {
	private static IDeveloperStudioLog log=Logger.getLog(WebServiceWSASCorePlugin.PLUGIN_ID);

	private static String tempWarLocation = null;
	private static boolean alreadyWarExist = false;
	private static String previousProject;

	public static String  copyWSASWar(IProgressMonitor monitor, String wsasHome, String project)
										throws FileNotFoundException, IOException{
//		if(!alreadyWarExist || !project.equals(previousProject)){
		if(true){
			previousProject = project;
			File tempWSASDirectory = new File (WSASCoreUtils.tempWSASDirectory());
			if(!tempWSASDirectory.exists()){
				tempWSASDirectory.mkdirs();
			}
			if (tempWSASDirectory.isDirectory()) {
				tempWarLocation = WSASCoreUtils.addAnotherNodeToPath(
						WSASCoreUtils.tempWSASDirectory(),
						WSASCoreUIMessages.DIR_EXPLOADED_TEMPWAR);
				File tempWarLocationFile= new File(tempWarLocation);
				if (tempWarLocationFile.exists()) {
					FileUtils.deleteDirectories(tempWarLocationFile);
				}
				tempWarLocationFile.mkdirs();
				Properties properties = new Properties();
//				properties.load(new FileInputStream(WSASCoreUtils.tempWSASWebappFileLocation()));
//				if (properties.containsKey(WSASCoreUIMessages.PROPERTY_KEY_PATH)){
				if (ServerModel.getWsasServerPath()!=null){
					String wsasHomeLocation = (ServerModel.getWsasServerPath()!=null)
									?ServerModel.getWsasServerPath()
									:properties.getProperty(WSASCoreUIMessages.PROPERTY_KEY_PATH);

					String wsasConfFile = WSASCoreUtils.addAnotherNodeToPath(
							wsasHomeLocation,
					"conf");
					String wsasRepositoryFile = WSASCoreUtils.addAnotherNodeToPath(
							wsasHomeLocation,
					"repository");
					String wsasTempWebInf = WSASCoreUtils.addAnotherNodeToPath(
							tempWarLocation,
					"WEB-INF");
					String wsasTempWebInfLib = WSASCoreUtils.addAnotherNodeToPath(
							wsasTempWebInf,
					"lib");

					File wsasTempWebInfLibFile = new File(wsasTempWebInfLib);
					if (!wsasTempWebInfLibFile.exists()){
						wsasTempWebInfLibFile.mkdirs();
					}

//					String wsasTempWebInfConf = WSASCoreUtils.addAnotherNodeToPath(
//							wsasTempWebInf,
//					"conf");
//
//					File wsasTempWebInfConfFile = new File(wsasTempWebInfConf);
//					if (wsasTempWebInfConfFile.exists()){
//						wsasTempWebInfConfFile.mkdirs();
//					}

					//Copy the webapp content
					String[] libPaths;
					if (ServerModel.getRuntimeId()==null || !ServerController.getInstance().getServerManager().isRuntimeIdPresent(ServerModel.getRuntimeId()))
						libPaths=new String[]{"lib"};
					else{
						try {
							libPaths=ServerController.getInstance().getServerManager().getServerAxis2Libraries(ServerController.getInstance().getServerManager().getServerTypeIdForRuntimeId(ServerModel.getRuntimeId()),wsasHomeLocation);
						} catch (Exception e) {
							libPaths=new String[]{"lib"};
							log.error(e);
						}
					}

					for(String libPath:libPaths){
						File file = new File(libPath);
						FileUtils.copy(file,new File(wsasTempWebInfLibFile,file.getName()));
					}

					//Delete the unwanted tomcat directory in the lib
					//FileUtils.deleteDirectories(FileUtils.addAnotherNodeToPath(wsasTempWebInfLib, "tomcat"));

					//copy conf directory
//					FileUtils.copyDirectory(new File(wsasConfFile),
//											wsasTempWebInfConfFile);

					//Copy modules and services
//					FileUtils.copyDirectory(new File(wsasRepositoryFile),
//											new File(wsasTempWebInf));
					(new File(FileUtils.addAnotherNodeToPath(wsasTempWebInf,"services"))).mkdirs();

					//Filter out the servletapi jars
					FileUtils.filterOutRestrictedFiles(wsasTempWebInfLibFile.getAbsolutePath(),
							                           WSASFacetUIMessages.FILE_SERVLET_API,"jar");

					alreadyWarExist= true;
				}

			} else {
				alreadyWarExist = false;
				//Throws an error message
			}
		}
		return tempWarLocation;
	}

	public static void removeContentInFolder(String path){
		File file = new File(path);
		if (file.exists()){
			if (file.isDirectory()){
				for(String fpath:file.list()){
					File file2 = new File(fpath);
					if (file2.isDirectory()){
						FileUtils.deleteDirectories(file2);
					}else
						file2.delete();
				}
			}else
				file.delete();
		}
	}
}


text:
Small library written in NLTK + Python with tremendous potential.  Categorizes data from various sources of written work and a set of dictionaries into a single comprehensive Markov matrix, and is able to reproduce the tone of the input works with randomly generated text (using probabilities generated from a given dataset). Highly modular design allows for simple modification/augmentation.

## Setup
>> ```Tag you're it!``` -- Galileo

To use, you must have Python 3.x + NLTK - previous version of Python will experience issues with Unicode string handling.  To install NLTK, I recommend using pip3 - run the following:
```
sudo pip3 install nltk
```
Then, simply use the run script to run the program.

## Use
>> ``` Can't put a price on these tags ``` -- Jessie J.

Place data files to be tagged into the training folder.  Run `run.sh` to tag the data and put the results into the dictionaries folder.  The default settings should be good enough for most purposes - the defaults clean most data and keep primarily only actual words.  To customize the type of data recorded, modify the arrays in `tagger_settings.py`.

## Generation
>> ``` Why learn html when this has got your tags covered``` -- Matthew Li

Coming soon!

## Projects that use Tagger

* [**ForkMe**](https://github.com/aliu139/forkme)

In a perfect world, every repository on GitHub would have a clear README, capable of letting visitors know about the purpose, usages, and history behind a project. However, writing a consise yet comprehensive README is an art that takes time and thought. ForkMe is our attempt at disrupting the current ecosystem of READMEs, by automating the process! Even if you aren't familiar with the newest startup jargon, let our product revolutionize the way that you document your product


text:
cask 'openra' do
  version '20180307'
  sha256 'a8cf3a77ff1cccfaa66d973f4abbfa1c30106f39da97ce4d0fd0e823cee86b52'

  # github.com/OpenRA/OpenRA was verified as official when first introduced to the cask
  url "https://github.com/OpenRA/OpenRA/releases/download/release-#{version}/OpenRA-release-#{version}.dmg"
  appcast 'https://github.com/OpenRA/OpenRA/releases.atom',
          checkpoint: 'aec2e5506d2e9ecea45add537487bfbbdbb7ad329ca018f1cdae88a9d7d911b3'
  name 'OpenRA'
  homepage 'http://www.openra.net/'

  depends_on cask: 'mono-mdk'

  app 'OpenRA - Dune 2000.app'
  app 'OpenRA - Red Alert.app'
  app 'OpenRA - Tiberian Dawn.app'
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Data;

namespace SimpleWeather.UWP.Helpers
{
    class InverseBooleanConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            return !(bool)value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}


text:
package com.systematic.trading.simulation.brokerage;

import java.math.BigDecimal;
import java.time.LocalDate;

import com.systematic.trading.model.price.Price;
import com.systematic.trading.simulation.brokerage.exception.InsufficientEquitiesException;
import com.systematic.trading.simulation.order.EquityOrderVolume;

/**
 * The broker performs the trading on a customers behalf, charging for privilege.
 *
 * @author CJ Hare
 */
public interface BrokerageTransaction {

	/**
	 * Calculates the total cost of performing a purchase, no transaction is performed.
	 *
	 * @param price
	 *            mean price paid for the equity.
	 * @param volume
	 *            number of equities being purchased.
	 * @param tradeDate
	 *            date of execution.
	 * @return total cost of the trade that would deducted from the cash account for the
	 *         transaction.
	 */
	BigDecimal cost( Price price, EquityOrderVolume volume, LocalDate tradeDate );

	/**
	 * Performs a purchase, applying the corresponding brokers fees.
	 *
	 * @param price
	 *            mean price paid for the equity.
	 * @param volume
	 *            number of equities being purchased.
	 * @param tradeDate
	 *            date of execution.
	 * @return total cost of the trade to be deducted from the cash account.
	 */
	void buy( Price price, EquityOrderVolume volume, LocalDate tradeDate );

	/**
	 * Performs a liquidation, applying the corresponding brokers fees.
	 *
	 * @param price
	 *            mean price paid for the equity.
	 * @param volume
	 *            number of equities being sold.
	 * @param tradeDate
	 *            date of execution.
	 * @throws InsufficientEquitiesException
	 *             encountered when there are insufficient equities are held.
	 * @return total funds acquired from the liquidation.
	 */
	BigDecimal sell( Price price, EquityOrderVolume volume, LocalDate tradeDate ) throws InsufficientEquitiesException;
}


text:
const test = require('ava')
const fse = require('fs-extra')

const repos2md = require('../')
const path = require('../lib/tools/path')

test('should write data to file', async t => {
  const final_path = path.get_final_path(require('os').homedir())

  const saved_to = await repos2md('frenchbread', { save_to: final_path })

  const exists = await fse.pathExists(saved_to)

  if (exists) await fse.remove(final_path)

  t.true(exists)
})


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wodsoft.Net.Sockets;

namespace Wodsoft.Net.UnitTest
{
    [TestClass]
    public class SocketHandler16Test
    {
        [TestMethod]
        public void WriteTest()
        {
            MemoryStream stream = new MemoryStream();
            SocketStreamHandlerContext<byte[], byte[]> context = new SocketStreamHandlerContext<byte[], byte[]>(stream, null);
            SocketHandler16 handler = new SocketHandler16();
            byte[] data = new byte[10000];
            data[9999] = 255;
            handler.Send(data, context);
            data = stream.ToArray();
            Assert.AreEqual(10002, data.Length);
            Assert.AreEqual(255, data[10001]);
        }

        [TestMethod]
        public async Task WriteAsyncTest()
        {
            MemoryStream stream = new MemoryStream();
            SocketStreamHandlerContext<byte[], byte[]> context = new SocketStreamHandlerContext<byte[], byte[]>(stream, null);
            SocketHandler16 handler = new SocketHandler16();
            byte[] data = new byte[10000];
            data[9999] = 255;
            await handler.SendAsync(data, context);
            data = stream.ToArray();
            Assert.AreEqual(10002, data.Length);
            Assert.AreEqual(255, data[10001]);

            data = new byte[10000];
            data[9999] = 255;
            await Task.Factory.FromAsync<bool>(handler.BeginSend(data, context, null, null), handler.EndSend);
            data = stream.ToArray();
            Assert.AreEqual(20004, data.Length);
            Assert.AreEqual(255, data[20003]);
        }

        [TestMethod]
        public void ReadTest()
        {
            MemoryStream stream = new MemoryStream();
            SocketStreamHandlerContext<byte[], byte[]> context = new SocketStreamHandlerContext<byte[], byte[]>(stream, null);
            SocketHandler16 handler = new SocketHandler16();
            byte[] data = new byte[10000];
            data[9999] = 255;
            handler.Send(data, context);
            stream.Position = 0;
            data = handler.Receive(context);
            Assert.AreEqual(10000, data.Length);
            Assert.AreEqual(255, data[9999]);
        }

        [TestMethod]
        public async Task ReadAsyncTest()
        {
            MemoryStream stream = new MemoryStream();
            SocketStreamHandlerContext<byte[], byte[]> context = new SocketStreamHandlerContext<byte[], byte[]>(stream, null);
            SocketHandler16 handler = new SocketHandler16();
            byte[] data = new byte[100];
            data[99] = 255;
            await handler.SendAsync(data, context);
            data[99] = 200;
            await handler.SendAsync(data, context);
            data[99] = 100;
            await handler.SendAsync(data, context);
            stream.Position = 0;
            data = await handler.ReceiveAsync(context);
            Assert.AreEqual(255, data[99]);
            data = await handler.ReceiveAsync(context);
            Assert.AreEqual(200, data[99]);
            data = await handler.ReceiveAsync(context);
            Assert.AreEqual(100, data[99]);

            stream.Position = 0;
            data = await Task.Factory.FromAsync<byte[]>(handler.BeginReceive(context, null, null), handler.EndReceive);
            Assert.AreEqual(255, data[99]);

            IAsyncResult ar = handler.BeginReceive(context, null, null);
            Assert.AreEqual(true, ar.CompletedSynchronously);
            data = handler.EndReceive(ar);
            Assert.AreEqual(200, data[99]);

            ar = handler.BeginReceive(context, null, null);
            ar.AsyncWaitHandle.WaitOne();
            Assert.AreEqual(true, ar.CompletedSynchronously);
            data = handler.EndReceive(ar);
            Assert.AreEqual(100, data[99]);
        }
    }
}