text:
package com.ws.ch1.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 * Created by martin on 11/25/16.
 * 切面
 */
@Aspect //通过 @Aspect 注解声明一个切面
@Component //通过 @Component 让此切面成为 spring 容器管理的 Bean
public class LogAspect {

    @Pointcut("@annotation(com.ws.ch1.aop.Action)") //通过 @Pointcut 声明切点
    public void annotationPointCut(){};

    @After("annotationPointCut") //通过 @After 声明一个建言,并使用 @Pointcut 定义切点
    public void after(JoinPoint joinPoint){
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
        Method method = signature.getMethod();
        Action action = method.getAnnotation(Action.class);
        System.out.println("注解式拦截:"+action.name()); //通过反射获取注解上的属性,然后做日志相关操作
    }

    @Before("execution(*.com.ws.ch1.aop.DemoMethodService.*(..))") //通过 @Before 声明一个建言,此建言直接使用拦截规则作为参数
    public void before(JoinPoint joinPoint){
        MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
        Method method = methodSignature.getMethod();
        System.out.println("方法规则式拦截:"+method.getName()); //通过反射获取注解上的属性,然后做日志相关操作
    }

}


text:
package com.example.android_image_editing_filters.filter;

import android.graphics.Bitmap;
import android.graphics.Color;

/**
 * Greyscales an image.
 */
public class DoGreyscale extends Filter {

    private Bitmap bitmapIn;

    public DoGreyscale(Bitmap bitmapIn) {
        this.bitmapIn = bitmapIn;
    }

    /**
     * Execute filter.
     *
     * @return the bitmap
     */
    @Override
    public Bitmap executeFilter() {

        final long time = System.currentTimeMillis();
        // Define constant values
        final double constValueRed = 0.299;
        final double constValueGreen = 0.587;
        final double constValueBlue = 0.114;

        // Get the dimensions
        int alpha, red, green, blue;
        final int width = this.getBitmapIn().getWidth();
        final int height = this.getBitmapIn().getHeight();
        final int[] pixels = new int[width * height];
        // Store every pixel into an integer array
        getBitmapIn().getPixels(pixels, 0, width, 0, 0, width, height);

        for (int i = 0; i < pixels.length; i++) {

            alpha = Color.alpha(pixels[i]);
            red = Color.red(pixels[i]);
            green = Color.green(pixels[i]);
            blue = Color.blue(pixels[i]);

            // Apply constant values
            red = green = blue = (int) (constValueRed * red + constValueGreen
                    * green + constValueBlue * blue);
            pixels[i] = Color.argb(alpha, red, green, blue);
        }
        // Write in output Bitmap
        final Bitmap bitmapOut = Bitmap.createBitmap(width, height, this
                .getBitmapIn().getConfig());
        bitmapOut.setPixels(pixels, 0, width, 0, 0, width, height);
        System.out.println("Finished @ " + (System.currentTimeMillis() - time) + "ms");

        return bitmapOut;
    }

    public Bitmap getBitmapIn() {
        return bitmapIn;
    }

    public void setBitmapIn(Bitmap bitmapIn) {
        this.bitmapIn = bitmapIn;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.intellij.openapi.application.impl;

import com.intellij.openapi.util.Condition;
import com.intellij.util.Processor;
import com.intellij.util.concurrency.BoundedTaskExecutor;
import com.intellij.util.containers.TransferToEDTQueue;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.ide.PooledThreadExecutor;

import java.util.concurrent.Executor;

/**
 * Passes elements for processing in the dedicated thread.
 * Processes elements in batches, no longer than {maxUnitOfWorkThresholdMs}ms per batch, and reschedules processing later for longer batches.
 * Usage: {@link #offer(Object)}} : schedules element for processing in a pooled thread
 */
public class TransferToPooledThreadQueue<T> extends TransferToEDTQueue<T> {
  private final Executor myExecutor;

  public TransferToPooledThreadQueue(@NonNls @NotNull String name,
                                     @NotNull Condition<?> shutUpCondition,
                                     int maxUnitOfWorkThresholdMs,
                                     @NotNull Processor<T> processor) {
    super(name, processor, shutUpCondition, maxUnitOfWorkThresholdMs);
    myExecutor = new BoundedTaskExecutor(PooledThreadExecutor.INSTANCE, 1);
  }

  @Override
  protected void schedule(@NotNull Runnable updateRunnable) {
    myExecutor.execute(updateRunnable);
  }
}


text:
using System;
using System.ComponentModel;

namespace Nettiers.AdventureWorks.Entities
{
	/// <summary>
	///		The data structure representation of the 'ProductCategory' table via interface.
	/// </summary>
	/// <remarks>
	/// 	This struct is generated by a tool and should never be modified.
	/// </remarks>
	public interface IProductCategory
	{
		/// <summary>
		/// ProductCategoryID : Primary key for ProductCategory records.
		/// </summary>
		/// <remarks>Member of the primary key of the underlying table "ProductCategory"</remarks>
		System.Int32 ProductCategoryId { get; set; }

		/// <summary>
		/// Name : Category description.
		/// </summary>
		System.String  Name  { get; set; }

		/// <summary>
		/// rowguid : ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication sample.
		/// </summary>
		System.Guid  Rowguid  { get; set; }

		/// <summary>
		/// ModifiedDate : Date and time the record was last updated.
		/// </summary>
		System.DateTime  ModifiedDate  { get; set; }

		/// <summary>
		/// Creates a new object that is a copy of the current instance.
		/// </summary>
		/// <returns>A new object that is a copy of this instance.</returns>
		System.Object Clone();

		#region Data Properties

		/// <summary>
		///	Holds a collection of entity objects
		///	which are related to this object through the relation _productSubcategoryProductCategoryId
		/// </summary>
		TList<ProductSubcategory> ProductSubcategoryCollection {  get;  set;}

		#endregion Data Properties

	}
}


text:
@interface InterfaceController()

@property (nonatomic, strong) NSArray *labels;

@property (nonatomic, strong) NSDateFormatter *dateFormatter;
@property (nonatomic, strong) NSString *dateString;
@property (nonatomic, strong) NSTimer *timer;

@end

@implementation InterfaceController

- (void)awakeWithContext:(id)context {
    [super awakeWithContext:context];
    // Configure interface objects here.

    _labels = @[_label1, _label2, _label3, _label4, _label5,
                _label6, _label7, _label8, _label9, _label10,
                _label11, _label12, _label13, _label14, _label15,
                _label16, _label17, _label18, _label19, _label20,
                _label21, _label22, _label23, _label24, _label25,
                _label26, _label27, _label28, _label29, _label30];

    _timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(tick) userInfo:nil repeats:YES];

    _dateFormatter = [[NSDateFormatter alloc] init];
    [_dateFormatter setDateFormat:@"HHmm"];
}

- (void)willActivate {
    // This method is called when watch view controller is about to be visible to user
    [super willActivate];
    [_timer fire];
}

- (void)didDeactivate {
    // This method is called when watch view controller is no longer visible
    [super didDeactivate];
    [_timer invalidate];
}

#pragma mark - Iterator

- (void)tick
{
    [self turnOff];
    NSString *string = self.dateString;

    NSInteger firstDigit = [[string substringWithRange:NSMakeRange(0, 1)] integerValue];
    NSInteger secondDigit = [[string substringWithRange:NSMakeRange(1, 1)] integerValue];
    NSInteger thirdDigit = [[string substringWithRange:NSMakeRange(2, 1)] integerValue];
    NSInteger fourthDigit = [[string substringWithRange:NSMakeRange(3, 1)] integerValue];

    [_labels[0] setTextColor:(firstDigit) ? [UIColor whiteColor] : [UIColor darkGrayColor]];    // 열

    if (firstDigit == 0 && secondDigit == 0) {
        [_labels[0] setTextColor:[UIColor whiteColor]]; // 열
        [_labels[5] setTextColor:[UIColor whiteColor]]; // 두
    }

    [_labels[19] setTextColor:(!thirdDigit) ? [UIColor darkGrayColor] : [UIColor whiteColor]];    // 십
    [_labels[29] setTextColor:(!thirdDigit && !fourthDigit) ? [UIColor darkGrayColor] : [UIColor whiteColor]];  // 분

    switch (secondDigit) {
        case 1:
            [_labels[1] setTextColor:[UIColor whiteColor]]; // 한
            break;
        case 2:
            [_labels[5] setTextColor:[UIColor whiteColor]]; // 두
            break;
        case 3:
            [_labels[3] setTextColor:[UIColor whiteColor]]; // 세
            break;
        case 4:
            [_labels[4] setTextColor:[UIColor whiteColor]]; // 네
            break;
        case 5:
            [_labels[2] setTextColor:[UIColor whiteColor]]; // 다
            [_labels[7] setTextColor:[UIColor whiteColor]]; // 섯
            break;
        case 6:
            [_labels[6] setTextColor:[UIColor whiteColor]]; // 여
            [_labels[7] setTextColor:[UIColor whiteColor]]; // 섯
            break;
        case 7:
            [_labels[8] setTextColor:[UIColor whiteColor]]; // 일
            [_labels[9] setTextColor:[UIColor whiteColor]]; // 곱
            break;
        case 8:
            [_labels[10] setTextColor:[UIColor whiteColor]];    // 여
            [_labels[11] setTextColor:[UIColor whiteColor]];    // 덟
            break;
        case 9:
            [_labels[12] setTextColor:[UIColor whiteColor]];    // 아
            [_labels[13] setTextColor:[UIColor whiteColor]];    // 홉
            break;
        default:
            break;
    }

    switch (thirdDigit) {
        case 2:
            [_labels[15] setTextColor:[UIColor whiteColor]];    // 이
            break;
        case 3:
            [_labels[16] setTextColor:[UIColor whiteColor]];    // 삼
            break;
        case 4:
            [_labels[17] setTextColor:[UIColor whiteColor]];    // 사
            break;
        case 5:
            [_labels[18] setTextColor:[UIColor whiteColor]];    // 오
            break;

        default:
            break;
    }

    switch (fourthDigit) {
        case 1:
            [_labels[20] setTextColor:[UIColor whiteColor]];    // 일
            break;
        case 2:
            [_labels[21] setTextColor:[UIColor whiteColor]];    // 이
            break;
        case 3:
            [_labels[22] setTextColor:[UIColor whiteColor]];    // 삼
            break;
        case 4:
            [_labels[23] setTextColor:[UIColor whiteColor]];    // 사
            break;
        case 5:
            [_labels[24] setTextColor:[UIColor whiteColor]];    // 오
            break;
        case 6:
            [_labels[25] setTextColor:[UIColor whiteColor]];    // 육
            break;
        case 7:
            [_labels[26] setTextColor:[UIColor whiteColor]];    // 칠
            break;
        case 8:
            [_labels[27] setTextColor:[UIColor whiteColor]];    // 팔
            break;
        case 9:
            [_labels[28] setTextColor:[UIColor whiteColor]];    // 구
            break;

        default:
            break;
    }
}

- (void)turnOff
{
    for (WKInterfaceLabel *label in _labels) {
        [label setTextColor:[UIColor darkGrayColor]];
    }
    [_labels[14] setTextColor:[UIColor whiteColor]];
}

#pragma mark - Getter

- (NSString *)dateString
{
    _dateString = [_dateFormatter stringFromDate:[NSDate date]];
    if ([_dateString integerValue] >= 1200)
        return [NSString stringWithFormat:@"%ld", [_dateString integerValue]%1200];
    return _dateString;
}

@end


text:
@interface CollectionViewCell : UICollectionViewCell

@property (nonatomic, copy) NSString *cellName;
@property (nonatomic, copy) NSString *place;

@property (nonatomic, assign) NSInteger signNumber;

@end


text:
from django.conf.urls import *
from corehq import AccountingAdminInterfaceDispatcher
from corehq.apps.accounting.views import *

urlpatterns = patterns('corehq.apps.accounting.views',
    url(r'^$', 'accounting_default', name='accounting_default'),
    url(r'^trigger_invoice/$', TriggerInvoiceView.as_view(),
        name=TriggerInvoiceView.urlname),
    url(r'^single_option_filter/$', AccountingSingleOptionResponseView.as_view(),
        name=AccountingSingleOptionResponseView.urlname),
    url(r'^trigger_email/$', TriggerBookkeeperEmailView.as_view(),
        name=TriggerBookkeeperEmailView.urlname),
    url(r'^test_reminders/$', TestRenewalEmailView.as_view(),
        name=TestRenewalEmailView.urlname),
    url(r'^manage_admins/$', ManageAccountingAdminsView.as_view(),
        name=ManageAccountingAdminsView.urlname),
    url(r'^accounts/(\d+)/$', ManageBillingAccountView.as_view(), name=ManageBillingAccountView.urlname),
    url(r'^accounts/new/$', NewBillingAccountView.as_view(), name=NewBillingAccountView.urlname),
    url(r'^subscriptions/(\d+)/$', EditSubscriptionView.as_view(), name=EditSubscriptionView.urlname),
    url(r'^accounts/new_subscription/$', NewSubscriptionViewNoDefaultDomain.as_view(),
        name=NewSubscriptionViewNoDefaultDomain.urlname),
    url(r'^accounts/new_subscription/(\d+)/$', NewSubscriptionView.as_view(), name=NewSubscriptionView.urlname),
    url(r'^software_plans/new/$', NewSoftwarePlanView.as_view(), name=NewSoftwarePlanView.urlname),
    url(r'^software_plans/(\d+)/$', EditSoftwarePlanView.as_view(), name=EditSoftwarePlanView.urlname),
    url(r'^invoices/(\d+)/$', InvoiceSummaryView.as_view(), name=InvoiceSummaryView.urlname),
    url(r'^wire_invoices/(\d+)/$', WireInvoiceSummaryView.as_view(), name=WireInvoiceSummaryView.urlname),
    url(AccountingAdminInterfaceDispatcher.pattern(), AccountingAdminInterfaceDispatcher.as_view(),
        name=AccountingAdminInterfaceDispatcher.name()),
    url(r'^pricing_table/(?P<product>[\w-]+)/(?P<locale>[\w-]+)/$', 'pricing_table_json',
        name='pricing_table_json'),
)


text:
#ifndef __IPTRIPLETTODENSECONVERTER_HPP__
#define __IPTRIPLETTODENSECONVERTER_HPP__

#include "IpUtils.hpp"
#include "IpReferenced.hpp"
namespace SimTKIpopt
{

  /** Class for converting symmetric matrices given in triplet format
   *  to matrices in dense format
   */
  class TripletToDenseConverter: public ReferencedObject
  {
    /** Class for one triplet position entry. */
    class TripletEntry
    {
    public:
      /** @name Constructor/Destructor */
      //@{
      /** Constructor. */
      TripletEntry()
      {}

      /** Destructor */
      ~TripletEntry()
      {}

      /** Dummy copy constructor.  Note that nothing is really copied!
       *  This is just implemented to that the std::list can be
       *  created with uninitialized entries.  The values are
       *  afterwards set with the Set method. */
      TripletEntry(const TripletEntry&)
      {}
      //@}

      /** Set the values of an entry */
      void Set(Index i_row, Index j_col, Index i_pos_triplet)
      {
        if (i_row>j_col) {
          i_row_ = j_col;
          j_col_ = i_row;
        }
        else {
          i_row_ = i_row;
          j_col_ = j_col;
        }
        i_pos_triplet_ = i_pos_triplet;
      }

      /** @name Accessor methods. */
      //@{
      /** Row position. */
      Index IRow() const
      {
        return i_row_;
      }
      /** Column position. */
      Index JCol() const
      {
        return j_col_;
      }
      /** Index in original triplet matrix. */
      Index PosTriplet() const
      {
        return i_pos_triplet_;
      }
      //@}

      /** Comparison operator.  This is required for the sort function. */
      bool operator< (const TripletEntry& Tentry) const
      {
        return ((i_row_ < Tentry.i_row_) ||
                (i_row_==Tentry.i_row_ && j_col_<Tentry.j_col_));
      }

    private:
      /**@name Default Compiler Generated Methods
       * (Hidden to avoid implicit creation/calling).
       * These methods are not implemented and
       * we do not want the compiler to implement
       * them for us, so we declare them private
       * and do not define them. This ensures that
       * they will not be implicitly created/called. */
      //@{
      /** Default Constructor */
      //TripletEntry();

      /** Copy Constructor */
      /*
      TripletEntry(const TripletEntry&);
      */

      /** Overloaded Equals Operator */
      void operator=(const TripletEntry&);
      //@}

      /** @name Entry content. */
      //@{
      Index i_row_;
      Index j_col_;
      Index i_pos_triplet_;
      //@}
    };

  public:
    /** @name Constructor/Destructor */
    //@{
    /* Constructor.  If offset is 0, then the counting of indices in
       the compressed format starts a 0 (C-style numbering); if offset
       is 1, then the counting starts at 1 (Fortran-type
       numbering). */
    TripletToDenseConverter(Index offset);

    /** Destructor */
    virtual ~TripletToDenseConverter();
    //@}

    /** Initialize the converter, given the fixed structure of the
     *  matrix.  There, ndim gives the number of rows and columns of
     *  the matrix, nonzeros give the number of nonzero elements, and
     *  airn and acjn give the positions of the nonzero elements.  The
     *  return value is the number of nonzeros in the condensed
     *  matrix.  (Since nonzero elements can be listed several times
     *  in the triplet format, it is possible that this value is
     *  different from the input value nonzeros.)  This method must be
     *  called before the GetIA, GetJA, GetValues methods are called.
     */
    Index InitializeConverter(Index dim, Index nonzeros,
                              const Index* airn,
                              const Index* ajcn);

    /** Return the IA array for the condensed format. */
    const Index* IA() const
    {
      DBG_ASSERT(initialized_);
      return ia_;
    }

    /** Return the JA array for the condensed format. */
    const Index* JA() const
    {
      DBG_ASSERT(initialized_);
      return ja_;
    }

    /** Convert the values of the nonzero elements.  Given the values
     *  a_triplet for the triplet format, return the array of values
     *  for the condensed format in a_condensed. nonzeros_condensed is
     *  the length of the array a_condensed and must be identical to
     *  the return value of InitializeConverter. */
    void ConvertValues(Index nonzeros_triplet, const Number* a_triplet,
                       Index nonzeros_compressed, Number* a_compressed);

  private:
    /**@name Default Compiler Generated Methods
     * (Hidden to avoid implicit creation/calling).
     * These methods are not implemented and
     * we do not want the compiler to implement
     * them for us, so we declare them private
     * and do not define them. This ensures that
     * they will not be implicitly created/called. */
    //@{
    /** Default Constructor */
    TripletToDenseConverter();

    /** Copy Constructor */
    TripletToDenseConverter(const TripletToDenseConverter&);

    /** Overloaded Equals Operator */
    void operator=(const TripletToDenseConverter&);
    //@}

    /** Offset for Dense numbering. */
    Index offset_;

    /** Array storing the values for IA in the condensed format */
    Index* ia_;

    /** Array storing the values for JA in the condensed format */
    Index* ja_;

    /** Dimension of the matrix. */
    Index dim_;

    /** Number of nonzeros in the triplet format. */
    Index nonzeros_triplet_;

    /** Number of nonzeros in the compressed format. */
    Index nonzeros_compressed_;

    /** Flag indicating if initialize method had been called. */
    bool initialized_;

    /** @name Arrays for cross-positions for the conversion of values. */
    //@{
    /** First elements assignement. For i with 0 <= i <=
     *  nonzeros_compressed-1, the i-th element in the compressed
     *  format is obtained from copying the ipos_filter_[i]-th element
     *  from the triplet format.  */
    Index* ipos_first_;
    /** Position of multiple elements in triplet matrix.  For i =
     *  0,..,nonzeros_triplet_-nonzeros_compressed_, the
     *  ipos_double_triplet_[i]-th element in the triplet matrix has
     *  to be added to the ipos_double_compressed_[i]-th element in
     *  the compressed matrix. */
    Index* ipos_double_triplet_;
    /** Position of multiple elements in compressed matrix. */
    Index* ipos_double_compressed_;
    //@}
  };

} // namespace Ipopt

#endif


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>objconfig.util.countable — ObjConfig 1.2.0 documentation</title>

    <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />

Navigation

          index

          modules |

ObjConfig 1.2.0 documentation »

Module code »

objconfig »

Source code for objconfig.util.countable

"""
IGNORE:
    Author: Asher Wolfstein Copyright 2017
    Blog: http://wunk.me/
    E-Mail: asherwunk@gmail.com
    Twitter: https://twitter.com/asherwolfstein Send Me Some Love!
    Package Homepage: http://wunk.me/programming-projects/objconfig-python/
    GitHub: http://github.com/asherwunk/objconfig for the source repository
    DevPost: https://devpost.com/software/objconfig
    Buy Me A Coffee: https://ko-fi.com/A18224XC
    Support Me On Patreon: https://www.patreon.com/asherwolfstein
IGNORE
"""

from objconfig.exception.runtimeexception import RuntimeException

[docs]class Countable():
    """Emulates the Countable "interface" as a class in Python"""

    def __len__(self):
        """How many items are in this collection?"""

        raise RuntimeException("Countable: __len__ not implemented in child class")

[docs]    def count(self):
        """This is the method PHP calls it."""

        return self.__len__

Quick search

    <form class="search" action="../../../search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          modules |

ObjConfig 1.2.0 documentation »

Module code »

objconfig »

        © Copyright 2017, Asher Wolfstein.
      Created using Sphinx 1.6.2.


text:
<platform name="ios">
    <config-file target="config.xml" parent="/*">
        <feature name="IPCardScanner">
            <param name="ios-package" value="IPCardScanner" />
        </feature>
    </config-file>
</platform>


text:
package com.pacinetes.dom.reportes;

import java.util.ArrayList;
import java.util.List;

import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRField;

public class PolizaPorCompaniaDataSource implements JRDataSource{

private List<PolizaPorCompaniaReporte> listado=new ArrayList<PolizaPorCompaniaReporte>();

	private int indiceActual = -1;

	@Override
	public Object getFieldValue(JRField jrf) throws JRException {

		Object valor = null;

		if("polizaNumero".equals(jrf.getName())){

			valor=listado.get(indiceActual).getPolizaNumero();

		}else if ("polizaCliente".equals(jrf.getName())){

			valor=listado.get(indiceActual).getPolizaCliente();

		}else if ("polizaFechaEmision".equals(jrf.getName())){

			valor=listado.get(indiceActual).getPolizaFechaEmision();
		}else if ("polizaFechaVigencia".equals(jrf.getName())){

			valor=listado.get(indiceActual).getPolizaFechaVigencia();
		}else if ("polizaFechaVencimiento".equals(jrf.getName())){

			valor=listado.get(indiceActual).getPolizaFechaVencimiento();
		}else if ("polizaImporteTotal".equals(jrf.getName())){

			valor=listado.get(indiceActual).getPolizaImporteTotal();
		}
		return valor;
	}

	@Override
	public boolean next() throws JRException {

		return ++indiceActual<listado.size();

	}

	public void addParticipante(PolizaPorCompaniaReporte polizaPorCompania) {
		this.listado.add(polizaPorCompania);
	}

}


text:
package nl.hannahsten.texifyidea.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.psi.LiteralTextEscaper;

public interface LatexParameter extends PsiLanguageInjectionHost {

  @Nullable
  LatexAngleParam getAngleParam();

  @Nullable
  LatexOptionalParam getOptionalParam();

  @Nullable
  LatexPictureParam getPictureParam();

  @Nullable
  LatexRequiredParam getRequiredParam();

  boolean isValidHost();

  PsiLanguageInjectionHost updateText(@NotNull String text);

  @NotNull LiteralTextEscaper<LatexParameter> createLiteralTextEscaper();

}


text:
package rmblworx.tools.timey.gui;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;

/**
 * Hilfsmethoden zum Umgang mit Datum/Zeit-Werten.
 * @author Christian Raue {@literal <christian.raue@gmail.com>}
 */
public final class DateTimeUtil {

	public static final long MILLI_TO_NANO = 1000L * 1000L;

	private static final String PATTERN_DATE_TIME = "dd.MM.yyyy HH:mm:ss";
	private static final String PATTERN_DATE = "dd.MM.yyyy";
	private static final String PATTERN_TIME = "HH:mm:ss";

	/**
	 * @param dateTime Datum-/Zeit-Wert
	 * @return Datumsanteil
	 */
	public static LocalDate getDatePart(final LocalDateTime dateTime) {
		return dateTime.toLocalDate();
	}

	/**
	 * @param dateTime Datum-/Zeit-Wert
	 * @return Zeitanteil
	 */
	public static LocalTime getTimePart(final LocalDateTime dateTime) {
		return dateTime.toLocalTime();
	}

	/**
	 * @param string Datum/Zeit-Wert
	 * @return {@link LocalDateTime}-Objekt mit entsprechendem Datum/Zeit-Wert
	 */
	public static LocalDateTime getLocalDateTimeForString(final String string) {
		return LocalDateTime.parse(string, DateTimeFormatter.ofPattern(PATTERN_DATE_TIME));
	}

	/**
	 * @param string Datum-Wert
	 * @return {@link LocalDate}-Objekt mit entsprechendem Datum-Wert
	 */
	public static LocalDate getLocalDateForString(final String string) {
		return LocalDate.parse(string, DateTimeFormatter.ofPattern(PATTERN_DATE));
	}

	/**
	 * @param string Zeit-Wert
	 * @return {@link LocalTime}-Objekt mit entsprechendem Zeit-Wert
	 */
	public static LocalTime getLocalTimeForString(final String string) {
		return LocalTime.parse(string, DateTimeFormatter.ofPattern(PATTERN_TIME));
	}

	/**
	 * @param dateTime Datum/Zeit-Wert
	 * @return UTC-basierter Datum/Zeit-Wert in ms
	 */
	public static long getLocalDateTimeInMillis(final LocalDateTime dateTime) {
		return LocalDateTime.of(1970, 1, 1, 0, 0, 0).until(dateTime, ChronoUnit.MILLIS);
	}

	/**
	 * @param millis UTC-basierter Datum/Zeit-Wert in ms
	 * @return Datum/Zeit-Wert
	 */
	public static LocalDateTime getLocalDateTimeFromMillis(final long millis) {
		return LocalDateTime.of(1970, 1, 1, 0, 0, 0).plus(millis, ChronoUnit.MILLIS);
	}

	/**
	 * Instanziierung verhindern.
	 */
	private DateTimeUtil() {
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
   ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   ====================================================================

   This software consists of voluntary contributions made by many
   individuals on behalf of the Apache Software Foundation.  For more
   information on the Apache Software Foundation, please see
   <http://www.apache.org />.
 -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpcomponents-client</artifactId>
    <version>4.0.4-SNAPSHOT</version>
  </parent>
  <artifactId>httpclient-benchmark</artifactId>
  <name>HttpClient Benchmarks</name>
  <description>
   HttpComponents HttpClient - Benchmarks
  </description>
  <url>http://hc.apache.org/httpcomponents-client</url>
  <packaging>jar</packaging>

  <licenses>
    <license>
      <name>Apache License</name>
      <url>../LICENSE.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${pom.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.1</version>
    </dependency>
  </dependencies>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compile.source>1.5</maven.compile.source>
    <maven.compile.target>1.5</maven.compile.target>
    <maven.compile.optimize>true</maven.compile.optimize>
    <maven.compile.deprecation>true</maven.compile.deprecation>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${maven.compile.source}</source>
          <target>${maven.compile.target}</target>
          <optimize>${maven.compile.optimize}</optimize>
          <showDeprecations>${maven.compile.deprecation}</showDeprecations>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
require 'rdoc/test_case'

class TestRDocParserMarkdown < RDoc::TestCase

  def setup
    super

    @RP = RDoc::Parser

    @tempfile = Tempfile.new self.class.name
    filename = @tempfile.path

    @top_level = @store.add_file filename
    @fn = filename
    @options = RDoc::Options.new
    @stats = RDoc::Stats.new @store, 0
  end

  def teardown
    super

    @tempfile.close
  end

  def test_file
    assert_kind_of RDoc::Parser::Text, util_parser('')
  end

  def test_class_can_parse
    temp_dir do
      FileUtils.touch 'foo.md'
      assert_equal @RP::Markdown, @RP.can_parse('foo.md')
      FileUtils.touch 'foo.md.ja'
      assert_equal @RP::Markdown, @RP.can_parse('foo.md.ja')

      FileUtils.touch 'foo.markdown'
      assert_equal @RP::Markdown, @RP.can_parse('foo.markdown')
      FileUtils.touch 'foo.markdown.ja'
      assert_equal @RP::Markdown, @RP.can_parse('foo.markdown.ja')
    end
  end

  def test_scan
    parser = util_parser 'it *really* works'

    expected =
      @RM::Document.new(
        @RM::Paragraph.new('it _really_ works'))
    expected.file = @top_level

    parser.scan

    assert_equal expected, @top_level.comment.parse
  end

  def util_parser content
    RDoc::Parser::Markdown.new @top_level, @fn, content, @options, @stats
  end

end


text:
<?php
// No direct access, please
if ( ! defined( 'ABSPATH' ) ) exit;

if ( ! function_exists( 'generate_copyright_customize_register' ) ) :

add_action( 'customize_register', 'generate_copyright_customize_register' );
function generate_copyright_customize_register( $wp_customize )
{
	// Get our custom control
	require_once GP_LIBRARY_DIRECTORY . 'customizer-helpers.php';

	// Register our custom control
	if ( method_exists( $wp_customize,'register_control_type' ) ) {
		$wp_customize->register_control_type( 'GeneratePress_Copyright_Customize_Control' );
	}

	// Add our section
	$wp_customize->add_section( 'generate_copyright' , array(
		'title' => __( 'Copyright', 'generate-copyright' ),
		'priority' => 60
	) );

	// Copyright
	$wp_customize->add_setting(
		'generate_copyright',
		array(
			'default' => '',
			'type' => 'theme_mod',
			'sanitize_callback' => 'wp_kses_post',
			'transport' => 'postMessage'
		)
	);

	$wp_customize->add_control(
		new GeneratePress_Copyright_Customize_Control(
		$wp_customize,
		'generate_copyright',
		array(
			'label'      => '',
			'section'    => 'generate_copyright',
			'settings'   => 'generate_copyright'
		) )
	);

	// Initiate selective refresh
	if ( isset( $wp_customize->selective_refresh ) ) {
		$wp_customize->selective_refresh->add_partial( 'generate_copyright', array(
			'selector' => '.copyright-bar',
			'settings' => array( 'generate_copyright' ),
			'render_callback' => 'generate_copyright_selective_refresh',
		) );
	}
}
endif;

if ( ! function_exists( 'generate_copyright_selective_refresh' ) ) :
/**
 * Return our copyright on selective refresh
 */
function generate_copyright_selective_refresh()
{
	$options = array(
		'%current_year%',
		'%copy%'
	);
	$replace = array(
		date('Y'),
		'©'
	);

	$new_copyright = get_theme_mod( 'generate_copyright' );
	$new_copyright = str_replace( $options, $replace, get_theme_mod( 'generate_copyright' ) );

	return do_shortcode( $new_copyright );
}
endif;

if ( ! function_exists( 'generate_copyright_remove_default' ) ) :
/**
 * Remove the default copyright
 * @since 0.1
 * @deprecated GP 1.3.42
 */
add_action('wp','generate_copyright_remove_default');
function generate_copyright_remove_default()
{
	// As of 1.3.42, we no longer need to do this
	// We use a nice little filter instead
	if ( ! function_exists( 'generate_add_login_attribution' ) )
		return;

	if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) :
		remove_action( 'generate_credits', 'generate_add_footer_info' );
		remove_action( 'generate_copyright_line','generate_add_login_attribution' );
	endif;
}
endif;

if ( ! function_exists( 'generate_copyright_add_custom' ) ) :
/**
 * Add the custom copyright
 * @since 0.1
 * @deprecated GP 1.3.42
 */
add_action('generate_credits','generate_copyright_add_custom');
function generate_copyright_add_custom()
{
	// As of 1.3.42, we no longer need to do this
	// We use a nice little filter instead
	if ( ! function_exists( 'generate_add_login_attribution' ) )
		return;

	$options = array(
		'%current_year%',
		'%copy%'
	);
	$replace = array(
		date('Y'),
		'©'
	);

	$new_copyright = get_theme_mod( 'generate_copyright' );
	$new_copyright = str_replace( $options, $replace, get_theme_mod( 'generate_copyright' ) );

	if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) :
		echo do_shortcode( $new_copyright );
	endif;

}
endif;

if ( ! function_exists( 'generate_apply_custom_copyright' ) ) :
/**
 * Add the custom copyright
 * @since 1.2.92
 */
add_filter('generate_copyright','generate_apply_custom_copyright');
function generate_apply_custom_copyright( $copyright )
{
	// This will only work if GP >= 1.3.42 and the below function doesn't exist
	if ( function_exists( 'generate_add_login_attribution' ) )
		return;

	$options = array(
		'%current_year%',
		'%copy%'
	);
	$replace = array(
		date('Y'),
		'©'
	);

	$new_copyright = get_theme_mod( 'generate_copyright' );
	$new_copyright = str_replace( $options, $replace, get_theme_mod( 'generate_copyright' ) );

	if ( get_theme_mod( 'generate_copyright' ) && '' !== get_theme_mod( 'generate_copyright' ) ) :
		return do_shortcode( $new_copyright );
	endif;

	return $copyright;

}
endif;

if ( ! function_exists( 'generate_copyright_customizer_live_preview' ) ) :
/**
 * Add our live preview
 */
add_action( 'customize_preview_init', 'generate_copyright_customizer_live_preview' );
function generate_copyright_customizer_live_preview()
{
	wp_enqueue_script(
		  'generate-copyright-customizer',
		  plugin_dir_url( __FILE__ ) . 'js/customizer.js',
		  array( 'jquery','customize-preview' ),
		  GENERATE_COPYRIGHT_VERSION,
		  true
	);
}
endif;

if ( ! function_exists( 'generate_update_copyright' ) ) :
/**
 * Our copyright use to have it's own setting
 * If we have the old setting, move it into our theme_mod
 */
add_action( 'admin_init', 'generate_update_copyright' );
function generate_update_copyright()
{
	// If we already have a custom logo, bail.
	if ( get_theme_mod( 'generate_copyright' ) )
		return;

	// Get the old logo value.
	$old_value = get_option( 'gen_custom_copyright' );

	// If there's no old value, bail.
	if ( empty( $old_value ) )
		return;

	// Now let's update the new logo setting with our ID.
	set_theme_mod( 'generate_copyright', $old_value );

	// Got our custom logo? Time to delete the old value
	if ( get_theme_mod( 'generate_copyright' ) ) :
		delete_option( 'gen_custom_copyright' );
	endif;
}
endif;


text:
package com.jme3.gde.core.sceneexplorer.nodes.animation;

import com.jme3.animation.Bone;
import com.jme3.gde.core.icons.IconList;
import com.jme3.gde.core.scene.SceneApplication;
import com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode;
import com.jme3.gde.core.sceneexplorer.nodes.ClipboardSpatial;
import com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode;
import java.awt.Image;
import java.awt.datatransfer.DataFlavor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import javax.swing.Action;
import org.openide.awt.Actions;
import org.openide.loaders.DataObject;
import org.openide.nodes.Sheet;
import org.openide.util.Exceptions;

/**
 *
 * @author normenhansen
 */
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
@SuppressWarnings({"unchecked", "rawtypes"})
public class JmeBone extends AbstractSceneExplorerNode {

    private static Image smallImage = IconList.bone.getImage();
    private Bone bone;
    private JmeSkeletonControl jmeSkeletonControl;
    protected final DataFlavor BONE_FLAVOR = new DataFlavor(ClipboardSpatial.class, "Bone");

    public JmeBone() {
    }

    public JmeBone(JmeSkeletonControl jmeSkeletonControl, Bone bone, JmeBoneChildren children) {
        super(children);
        this.jmeSkeletonControl = jmeSkeletonControl;
        getLookupContents().add(bone);
        getLookupContents().add(this);
        super.setName(bone.getName());
        this.bone = bone;
    }

    @Override
    public Image getIcon(int type) {
        return smallImage;
    }

    @Override
    public Image getOpenedIcon(int type) {
        return smallImage;
    }

    @Override
    protected Sheet createSheet() {
        //TODO: multithreading..
        Sheet sheet = super.createSheet();
        Sheet.Set set = Sheet.createPropertiesSet();
        set.setDisplayName("Bone");
        set.setName(Bone.class.getName());
        Bone obj = bone;//getLookup().lookup(Spatial.class);
        if (obj == null) {
            return sheet;
        }
        sheet.put(set);
        return sheet;

    }

    @Override
    public Action[] getActions(boolean context) {

        return new Action[]{
                    Actions.alwaysEnabled(new AttachementNodeActionListener(), "Get attachement Node", "", false),};
    }

    private class AttachementNodeActionListener implements ActionListener {

        public void actionPerformed(ActionEvent e) {
            fireSave(true);
            try {
                SceneApplication.getApplication().enqueue(new Callable<Void>() {

                    public Void call() throws Exception {
                        jmeSkeletonControl.getSkeletonControl().getAttachmentsNode(bone.getName());
                        return null;
                    }
                }).get();
                ((AbstractSceneExplorerNode) jmeSkeletonControl.getParentNode()).refresh(false);
            } catch (InterruptedException ex) {
                Exceptions.printStackTrace(ex);
            } catch (ExecutionException ex) {
                Exceptions.printStackTrace(ex);
            }

        }
    }

    public Class getExplorerObjectClass() {
        return Bone.class;
    }

    @Override
    public Class getExplorerNodeClass() {
        return JmeBone.class;
    }

    @Override
    public org.openide.nodes.Node[] createNodes(Object key, DataObject key2, boolean cookie) {
        JmeBoneChildren children = new JmeBoneChildren(jmeSkeletonControl, (Bone) key);
        children.setReadOnly(cookie);
        children.setDataObject(key2);
        return new org.openide.nodes.Node[]{new JmeBone(jmeSkeletonControl, (Bone) key, children).setReadOnly(cookie)};
    }
}


text:
package cleo.search;

import java.io.Serializable;

import cleo.search.network.Proximity;

/**
 * Hit
 *
 * @author jwu
 * @since 02/11, 2011
 *
 * @param <E> Element
 */
public interface Hit<E extends Element> extends Score, Serializable, Comparable<Hit<? super E>> {

  public void clear();

  public String getSource();

  public void setSource(String source);

  public E getElement();

  public void setElement(E element);

  public Proximity getProximity();

  public void setProximity(Proximity proximity);
}


text:
"use strict";

// npm install express --save
const express=require('express');

const port   =process.env.PORT || 3000;
const ip_addr=process.env.IP   || "0.0.0.0";

const app=express();

app.get('/', (request,response)=> {
  response.send('Express: ' + request.url + "\nTime: "+ new Date());
});

app.use(express.static('../WWW'));

app.listen(port,ip_addr,() => {
  console.log('The express server started.');
});


text:
struct StructName {
  int member[];
};

struct StructName SN;