text:
package gnu.classpath.tools.doclets.debugdoclet;

import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.FieldDoc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.PackageDoc;
import com.sun.javadoc.RootDoc;
import com.sun.javadoc.Tag;

import java.io.PrintStream;

import java.util.Arrays;

public class DebugDoclet
{
   public static boolean start(RootDoc rootDoc)
   {
      new DebugDoclet().run(rootDoc);
      return true;
   }

   private PrintStream out;

   public DebugDoclet()
   {
      out = System.out;
   }

   private void printHeader(String header)
   {
      out.println();
      out.println("******** " + header + " ********");
      out.println();
   }

   private void printSubHeader(String header)
   {
      out.println();
      out.println("======== " + header + " ========");
      out.println();
   }

   private void printSub2Header(String header)
   {
      out.println();
      out.println("-------- " + header + " --------");
      out.println();
   }

   private void run(RootDoc rootDoc)
   {
      printHeader("Overview");

      printSubHeader("Specified Packages");

      PackageDoc[] specifiedPackages = rootDoc.specifiedPackages();
      Arrays.sort(specifiedPackages);
      for (int i=0; i<specifiedPackages.length; ++i) {
         out.println(specifiedPackages[i].name());
      }

      printSubHeader("Specified Classes");

      ClassDoc[] specifiedClasses = rootDoc.specifiedClasses();
      Arrays.sort(specifiedClasses);
      for (int i=0; i<specifiedClasses.length; ++i) {
         out.println(specifiedClasses[i].qualifiedTypeName());
      }
      printSubHeader("Classes");

      ClassDoc[] classes = rootDoc.classes();
      Arrays.sort(classes);
      for (int i=0; i<classes.length; ++i) {
         out.println(classes[i].qualifiedTypeName());
      }

      printHeader("Class Detail");

      for (int i=0; i<classes.length; ++i) {
         printSubHeader(classes[i].qualifiedTypeName());

         printTags(classes[i].firstSentenceTags());

         printSub2Header("Methods");

         MethodDoc[] methods = classes[i].methods();

         for (int j=0; j<methods.length; ++j) {
            out.println("name: \"" + methods[j].name() + "\"");
            out.println("signature: \"" + methods[j].signature() + "\"");
            out.println("modifiers: \"" + methods[j].modifiers() + "\"");
            out.print("throws: ");
            ClassDoc[] thrownExceptions = methods[j].thrownExceptions();
            for (int k=0; k<thrownExceptions.length; ++k) {
               if (k>0) { out.print(", "); }
               out.print(thrownExceptions[k].qualifiedTypeName());
            }
            out.println();
         }

         printSub2Header("Fields");

         FieldDoc[] fields = classes[i].fields();

         for (int j=0; j<fields.length; ++j) {
            out.println("name: \"" + fields[j].name() + "\"");
            out.println("modifiers: \"" + fields[j].modifiers() + "\"");
            out.println();
         }

         printSub2Header("Serializable Fields");

         FieldDoc[] sfields = classes[i].serializableFields();

         for (int j=0; j<sfields.length; ++j) {
            out.println("name: \"" + sfields[j].name() + "\"");
            out.println("modifiers: \"" + sfields[j].modifiers() + "\"");
            out.println();
         }
      }
   }

   private void printTag(Tag tag)
   {
      if (null != tag.text()) {
         System.out.println(tag.text());
      }
   }

   private void printTags(Tag[] tags)
   {
      for (int i=0; i<tags.length; ++i) {
         out.println("Tag #" + (i+1) + ":");
         printTag(tags[i]);
      }
   }
}


text:
import React, { PropTypes, Component } from 'react';
import { createStyleSheet } from 'jss-theme-reactor';
import { LinearProgress } from 'material-ui/Progress';

const styleSheet = createStyleSheet('LinearDeterminate', () => ({
  root: {
    width: '100%',
    marginTop: 30,
  },
}));

export default class LinearDeterminate extends Component {
  state = {
    completed: 0,
  }

  componentDidMount() {
    this.timer = setInterval(this.progress, 500);
  }

  componentWillUnmount() {
    clearInterval(this.timer);
  }

  timer: number

  progress = () => {
    const { completed } = this.state;
    if (completed > 100) {
      this.setState({ completed: 0 });
    } else {
      const diff = Math.random() * 10;
      this.setState({ completed: completed + diff });
    }
  }

  render() {
    const classes = this.context.styleManager.render(styleSheet);
    return (
      <div className={classes.root}>
        <LinearProgress mode="determinate" value={this.state.completed} />
      </div>
    );
  }
}

LinearDeterminate.contextTypes = {
  styleManager: PropTypes.object.isRequired,
};

redpajama_set_name: RedPajamaGithub


text:
package org.kasource.validation.locale.impl;

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

import javax.validation.ConstraintValidatorContext;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.kasource.commons.reflection.annotation.AnnotationBuilder;
import org.kasource.validation.locale.Language;
import org.unitils.UnitilsJUnit4TestClassRunner;
import org.unitils.easymock.EasyMockUnitils;
import org.unitils.easymock.annotation.Mock;
import org.unitils.inject.annotation.TestedObject;

@RunWith(UnitilsJUnit4TestClassRunner.class)
public class ArrayLanguageValidatorTest {
    @Mock
    private ConstraintValidatorContext context;

    @TestedObject
    private ArrayLanguageValidator validator;

    @Test
    public void testCaseInsensitive() {
       EasyMockUnitils.replay();
       validator.initialize(new AnnotationBuilder<Language>(Language.class).build());

       assertTrue(validator.isValid(new String[]{"en", "sv", "de", "EN"}, context));

       assertFalse(validator.isValid(new String[]{"en", "bu"}, context));

    }

    @Test
    public void testCaseSensitive() {
       EasyMockUnitils.replay();
       validator.initialize(new AnnotationBuilder<Language>(Language.class).attr("caseSensetive", true).build());

       assertTrue(validator.isValid(new String[]{"en", "sv", "de"}, context));

       assertFalse(validator.isValid(new String[]{"en", "EN"}, context));

    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Coelomycetous Anamorphs with Appendage-bearing Conidia (Ontario) 291 (1993)

#### Original name
Coryneum monochaetoides Speg.

### Remarks
null


text:
package com.linecorp.armeria.server.composition;

import static java.util.Objects.requireNonNull;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

import javax.annotation.Nullable;

import com.linecorp.armeria.common.Request;
import com.linecorp.armeria.common.RequestContext;
import com.linecorp.armeria.common.Response;
import com.linecorp.armeria.common.util.SafeCloseable;
import com.linecorp.armeria.server.PathMapped;
import com.linecorp.armeria.server.PathMapping;
import com.linecorp.armeria.server.PathMappings;
import com.linecorp.armeria.server.ResourceNotFoundException;
import com.linecorp.armeria.server.Service;
import com.linecorp.armeria.server.ServiceCallbackInvoker;
import com.linecorp.armeria.server.ServiceConfig;
import com.linecorp.armeria.server.ServiceRequestContext;
import com.linecorp.armeria.server.ServiceRequestContextWrapper;

/**
 * A skeletal {@link Service} implementation that enables composing multiple {@link Service}s into one.
 * Extend this class to build your own composite {@link Service}. e.g.
 *
{@code
 * public class MyService extends AbstractCompositeService<HttpRequest, HttpResponse> {
 *     public MyService() {
 *         super(CompositeServiceEntry.ofPrefix("/foo/"), new FooService()),
 *               CompositeServiceEntry.ofPrefix("/bar/"), new BarService()),
 *               CompositeServiceEntry.ofCatchAll(), new OtherService()));
 *     }
 * }
 * }

 *
 * @param  the {@link Request} type
 * @param <O> the {@link Response} type
 *
 * @see AbstractCompositeServiceBuilder
 * @see CompositeServiceEntry
 */
public abstract class AbstractCompositeService implements Service {

    private final List<CompositeServiceEntry<? super I, ? extends O>> services;
    private final PathMappings<Service<? super I, ? extends O>> serviceMapping = new PathMappings<>();

    /**
     * Creates a new instance with the specified {@link CompositeServiceEntry}s.
     */
    @SafeVarargs
    protected AbstractCompositeService(CompositeServiceEntry<? super I, ? extends O>... services) {
        this(Arrays.asList(requireNonNull(services, "services")));
    }

    /**
     * Creates a new instance with the specified {@link CompositeServiceEntry}s.
     */
    protected AbstractCompositeService(Iterable<CompositeServiceEntry<? super I, ? extends O>> services) {
        requireNonNull(services, "services");

        final List<CompositeServiceEntry<? super I, ? extends O>> servicesCopy = new ArrayList<>();
        for (CompositeServiceEntry<? super I, ? extends O> e : services) {
            servicesCopy.add(e);
            serviceMapping.add(e.pathMapping(), e.service());
        }

        this.services = Collections.unmodifiableList(servicesCopy);

        serviceMapping.freeze();
    }

    @Override
    public void serviceAdded(ServiceConfig cfg) throws Exception {
        for (CompositeServiceEntry<? super I, ? extends O> e : services()) {
            ServiceCallbackInvoker.invokeServiceAdded(cfg, e.service());
        }
    }

    /**
     * Returns the list of {@link CompositeServiceEntry}s added to this composite {@link Service}.
     */
    protected List<CompositeServiceEntry<? super I, ? extends O>> services() {
        return services;
    }

    /**
     * Returns the {@code index}-th {@link Service} in this composite {@link Service}. The index of the
     * {@link Service} added first is {@code 0}, and so on.
     */
    @SuppressWarnings("unchecked")
    protected <T extends Service<? super I, ? extends O>> T serviceAt(int index) {
        return (T) services().get(index).service();
    }

    /**
     * Finds the {@link Service} whose {@link PathMapping} matches the {@code path}.
     *
     * @param path an absolute path, as defined in RFC3986
     * @param query a query, as defined in RFC3986.
     *              {@code null} if query does not exist.
     *
     * @return the {@link Service} wrapped by {@link PathMapped} if there's a match.
     *         {@link PathMapped#empty()} if there's no match.
     */
    protected PathMapped<Service<? super I, ? extends O>> findService(String path, @Nullable String query) {
        return serviceMapping.apply(path, query);
    }

    @Override
    public O serve(ServiceRequestContext ctx, I req) throws Exception {
        final PathMapped<Service<? super I, ? extends O>> mapped = findService(ctx.pathWithoutPrefix(),
                                                                               ctx.query());
        if (!mapped.isPresent()) {
            throw ResourceNotFoundException.get();
        }

        final Optional<String> childPrefix = mapped.mapping().prefix();
        if (childPrefix.isPresent()) {
            final PathMapping newMapping = PathMapping.ofPrefix(ctx.pathMapping().prefix().get() +
                                                                childPrefix.get().substring(1));

            final ServiceRequestContext newCtx = new CompositeServiceRequestContext(ctx, newMapping);
            try (SafeCloseable ignored = RequestContext.push(newCtx, false)) {
                return mapped.value().serve(newCtx, req);
            }
        } else {
            return mapped.value().serve(ctx, req);
        }
    }

    private static final class CompositeServiceRequestContext extends ServiceRequestContextWrapper {

        private final PathMapping pathMapping;

        CompositeServiceRequestContext(ServiceRequestContext delegate, PathMapping pathMapping) {
            super(delegate);
            this.pathMapping = pathMapping;
        }

        @Override
        public PathMapping pathMapping() {
            return pathMapping;
        }
    }
}


text:
/* tslint:disable */
import { WebAPICallResult } from '../WebClient';
export type ChatMeMessageResponse = WebAPICallResult & {
  channel?:  string;
  ts?:       string;
  ok?:       boolean;
  error?:    string;
  needed?:   string;
  provided?: string;
};


text:
using System;
using System.IO;
using System.Text;

namespace Discord.Commands
{
    public static class DiscordBotLog
    {
        #region Internal Variables

        private static string logFilePath;

        private static string logPath;

        #endregion Internal Variables

        #region Constructor

        public static void Init(string logDirectory)
        {
            if (!Directory.Exists(logDirectory))
            {
                logDirectory = Path.Combine(Environment.CurrentDirectory, "files");
            }
            logPath = logDirectory;
            logFilePath = Path.Combine(logDirectory, "log.txt");
            if (!File.Exists(logFilePath))
                File.Create(logFilePath);
        }

        #endregion Constructor

        #region Methods

        public static void AppendLog(string message)
        {
            File.AppendAllText(logFilePath, message, Encoding.Unicode);
        }

        public static void WriteSingleLog(string message, string fileName)
        {
            if (Path.Combine(logPath, fileName).Equals(logFilePath))
                return;

            string singleFilePath = Path.Combine(logPath, fileName);

            File.WriteAllText(singleFilePath, message);
        }

        public static string BuildCommandExceptionMessage(Exception ex, CommandEventArgs command)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("Exception thrown at ");
            sb.AppendLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
            sb.Append("Command: ");
            sb.AppendLine(command.Message.RawText);
            sb.Append("User: ");
            sb.Append(command.User.Name);
            sb.Append("<@");
            sb.Append(command.User.Id);
            sb.AppendLine(">");
            if(command.Channel.IsPrivate)
            {
                sb.AppendLine("In private chat");
            }
            else
            {
                sb.Append("On ");
                sb.AppendLine(command.Server.Name + " #" + command.Channel.Name);
            }

            sb.Append("Message: ");
            sb.AppendLine(ex.Message);
            sb.AppendLine(ex.StackTrace);
            sb.AppendLine("---------------------------------------------------------------------------------------------");
            return sb.ToString();
        }

        public static string BuildRuntimeExceptionMessage(Exception ex)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("- RuntimeException -");
            sb.Append("Exception thrown at ");
            sb.AppendLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
            sb.Append("Message: ");
            sb.AppendLine(ex.Message);
            sb.AppendLine(ex.StackTrace);
            sb.AppendLine("---------------------------------------------------------------------------------------------");
            return sb.ToString();
        }

        public static string BuildErrorMessage(Exception ex)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("- Critical error -");
            sb.Append("Exception thrown at ");
            sb.AppendLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
            sb.Append("Message: ");
            sb.AppendLine(ex.Message);
            sb.AppendLine(ex.StackTrace);
            sb.AppendLine("---------------------------------------------------------------------------------------------");
            return sb.ToString();
        }

        #endregion Methods
    }
}