text:
package org.jetbrains.plugins.scala.settings;

import com.intellij.lang.java.JavaLanguage;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.components.*;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.SourceFolder;
import com.intellij.util.xmlb.Converter;
import com.intellij.util.xmlb.XmlSerializerUtil;
import com.intellij.util.xmlb.annotations.MapAnnotation;
import com.intellij.util.xmlb.annotations.OptionTag;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.scala.ScalaBundle;
import org.jetbrains.plugins.scala.ScalaLanguage;
import org.jetbrains.plugins.scala.statistics.FeatureKey;
import org.jetbrains.plugins.scala.statistics.Stats;

import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

@State(
    name = "ScalaProjectSettings",
    storages = {
        @Storage(StoragePathMacros.WORKSPACE_FILE),
        @Storage("scala_settings.xml")
    },
    reportStatistic = true
)
public class ScalaProjectSettings implements PersistentStateComponent<ScalaProjectSettings> {
  @ReportValue
  private int IMPLICIT_PARAMETERS_SEARCH_DEPTH = -1;

  public boolean INHERIT_BASE_PACKAGES = true;

  @MapAnnotation(surroundWithTag = false, entryTagName = "module", keyAttributeName = "name", valueAttributeName = "basePackage")
  public Map<String, String> CUSTOM_BASE_PACKAGES = new HashMap<>();

  private String SCALATEST_DEFAULT_SUPERCLASS = "org.scalatest.FunSuite";

  private boolean SEARCH_ALL_SYMBOLS = false;

  private boolean ENABLE_JAVA_TO_SCALA_CONVERSION = true;
  private boolean ADD_OVERRIDE_TO_IMPLEMENT_IN_CONVERTER = true;
  private boolean DONT_SHOW_CONVERSION_DIALOG = false;
  private boolean SHOW_IMPLICIT_CONVERSIONS = false;
  private boolean SHOW_NOT_FOUND_IMPLICIT_ARGUMENTS = true;
  private boolean SHOW_AMBIGUOUS_IMPLICIT_ARGUMENTS = true;

  private boolean SHOW_ARGUMENTS_TO_BY_NAME_PARAMETERS = false;
  private boolean INCLUDE_BLOCK_EXPRESSIONS = false;
  private boolean INCLUDE_LITERALS = false;

  private boolean CUSTOM_SCALATEST_SYNTAX_HIGHLIGHTING = false;

  private boolean TREAT_DOC_COMMENT_AS_BLOCK_COMMENT = false;
  private boolean DISABLE_LANGUAGE_INJECTION = false;
  private boolean DONT_CACHE_COMPOUND_TYPES = false;
  private boolean AOT_COMPLETION = true;
  private boolean PROJECT_VIEW_HIGHLIGHTING = false;
  private boolean GROUP_PACKAGE_OBJECT_WITH_PACKAGE = false;
  private boolean SCALA_CLASSES_PRIORITY = true;
  private boolean GENERATE_TOSTRING_WITH_FIELD_NAMES = false;

  public enum TrailingCommasMode {Enabled, Disabled, Auto}
  private TrailingCommasMode TRAILING_COMMAS_ENABLED = TrailingCommasMode.Auto;

  //SCALA.META
  public enum ScalaMetaMode {Enabled, Disabled, Manual}
  private ScalaMetaMode scalaMetaMode = ScalaMetaMode.Enabled;
  private boolean metaTrimMethodBodies = true;

  //WORKSHEET
  private int OUTPUT_LIMIT = 35;
  private boolean IN_PROCESS_MODE = true;
  private boolean USE_ECLIPSE_COMPATIBILITY = false;
  private boolean TREAT_SCRATCH_AS_WORKSHEET = true;
  private boolean IS_WORKSHEET_FOLD_COLLAPSED_BY_DEFAULT = true;
  private int AUTORUN_DELAY = 1400;
  public enum ScFileMode {Worksheet, Ammonite, Auto}
  private ScFileMode SC_FILE_MODE = ScFileMode.Worksheet;

  //BREADCRUMBS
  private boolean BREADCRUMBS_CLASS_ENABLED = true;
  private boolean BREADCRUMBS_FUNCTION_ENABLED = true;
  private boolean BREADCRUMBS_LAMBDA_ENABLED = true;
  private boolean BREADCRUMBS_MATCH_ENABLED = false;
  private boolean BREADCRUMBS_VAL_DEF_ENABLED = false;
  private boolean BREADCRUMBS_IF_DO_WHILE_ENABLED = false;

  // LIBRARY EXTENSIONS
  private boolean ENABLE_LIBRARY_EXTENSIONS = true;

  private boolean SCALA_3_DISCLAIMER_SHOWN = false;

  //INDEXING
  public enum Ivy2IndexingMode {Disabled, Metadata, Classes}
  private Ivy2IndexingMode IVY2_INDEXING_MODE = Ivy2IndexingMode.Metadata;

  private Map<String, String> INTERPOLATED_INJECTION_MAPPING = new HashMap<>();

  {
    //NOTE: second value of the pair should have the correct case (it should be equal to the language ID)
    INTERPOLATED_INJECTION_MAPPING.put("html", "HTML");
    INTERPOLATED_INJECTION_MAPPING.put("xhtml", "XHTML");
    INTERPOLATED_INJECTION_MAPPING.put("css", "CSS");
    INTERPOLATED_INJECTION_MAPPING.put("less", "LESS");
    INTERPOLATED_INJECTION_MAPPING.put("js", "JavaScript");
    INTERPOLATED_INJECTION_MAPPING.put("json", "JSON");
    INTERPOLATED_INJECTION_MAPPING.put("json5", "JSON5");
    INTERPOLATED_INJECTION_MAPPING.put("sql", "SQL");
    INTERPOLATED_INJECTION_MAPPING.put("sqlu", "SQL");
    INTERPOLATED_INJECTION_MAPPING.put("xml", "XML");
    INTERPOLATED_INJECTION_MAPPING.put("scala", ScalaLanguage.INSTANCE.getID());
    INTERPOLATED_INJECTION_MAPPING.put("java", JavaLanguage.INSTANCE.getID());
    INTERPOLATED_INJECTION_MAPPING.put("kotlin", "Kotlin");
    INTERPOLATED_INJECTION_MAPPING.put("svg", "SVG");
    INTERPOLATED_INJECTION_MAPPING.put("xpath", "XPath");
    INTERPOLATED_INJECTION_MAPPING.put("yaml", "yaml");
    INTERPOLATED_INJECTION_MAPPING.put("protobuf", "protobuf");
  }

  public enum TypeChecker {BuiltIn, Compiler}

  // https://youtrack.jetbrains.com/issue/SCL-19928
  enum AliasExportSemantics {
    Definition, // Seq is scala.Seq
    Export // Seq is scala.collection.immutable.Seq
  }

  public enum ScalaCollectionHighlightingLevel {None, OnlyNonQualified, All}

  private AliasExportSemantics ALIAS_EXPORT_SEMANTICS = AliasExportSemantics.Export;

  //collection type highlighting settings
  private ScalaCollectionHighlightingLevel COLLECTION_TYPE_HIGHLIGHTING_LEVEL = ScalaCollectionHighlightingLevel.None;

  // This is only needed cause previously collection type setting was integer value
  // now it is a enum, but we want to migrate old integers to enums
  public static class ScalaCollectionHighlightingLevelConverter extends Converter<ScalaCollectionHighlightingLevel> {
    @Nullable
    @Override
    public ScalaCollectionHighlightingLevel fromString(@NotNull String value) {
      try {
        int index = Integer.parseInt(value);
        return ScalaCollectionHighlightingLevel.values()[index];
      } catch (NumberFormatException ex) {
        return ScalaCollectionHighlightingLevel.valueOf(value);
      }
    }

    @Nullable
    @Override
    public String toString(@NotNull ScalaCollectionHighlightingLevel value) {
      return value.toString();
    }
  }

  private boolean TYPE_MISMATCH_HINTS = true;

  private boolean TYPE_AWARE_HIGHLIGHTING_ENABLED = true;
  private boolean COMPILER_HIGHLIGHTING_SCALA2 = false;
  private boolean COMPILER_HIGHLIGHTING_SCALA3 = true;

  public static ScalaProjectSettings in(@NotNull Project project) {
    return getInstance(project);
  }

  public static ScalaProjectSettings getInstance(@NotNull Project project) {
    return project.getService(ScalaProjectSettings.class);
  }

  @Override
  public ScalaProjectSettings getState() {
    return this;
  }

  @Override
  public void loadState(@NotNull ScalaProjectSettings scalaProjectSettings) {
    XmlSerializerUtil.copyBean(scalaProjectSettings, this);
  }

  @NotNull
  public File[] getExportFiles() {
    return new File[]{PathManager.getOptionsFile("scala_project_settings")};
  }

  @NotNull
  public String getPresentableName() {
    return ScalaBundle.message("scala.project.settings");
  }

  public int getImplicitParametersSearchDepth() {
    return IMPLICIT_PARAMETERS_SEARCH_DEPTH;
  }

  public void setImplicitParametersSearchDepth(int value) {
    IMPLICIT_PARAMETERS_SEARCH_DEPTH = value;
  }

  @ReportValue
  public int getOutputLimit() {
    return  OUTPUT_LIMIT;
  }

  public void setOutputLimit(int value) {
    OUTPUT_LIMIT = value;
  }

  public boolean isSearchAllSymbols() {
    return SEARCH_ALL_SYMBOLS;
  }

  public void setSearchAllSymbols(boolean value) {
    SEARCH_ALL_SYMBOLS = value;
  }

  public boolean isEnableJavaToScalaConversion() {
    return ENABLE_JAVA_TO_SCALA_CONVERSION;
  }

  public void setEnableJavaToScalaConversion(boolean value) {
    ENABLE_JAVA_TO_SCALA_CONVERSION = value;
  }

  public boolean isAddOverrideToImplementInConverter() {
    return ADD_OVERRIDE_TO_IMPLEMENT_IN_CONVERTER;
  }

  public void setAddOverrideToImplementInConverter(boolean value) {
    ADD_OVERRIDE_TO_IMPLEMENT_IN_CONVERTER = value;
  }

  public boolean isDontShowConversionDialog() {
    return DONT_SHOW_CONVERSION_DIALOG;
  }

  public void setDontShowConversionDialog(boolean value) {
    DONT_SHOW_CONVERSION_DIALOG = value;
  }

  public boolean isShowImplicitConversions() {
    return SHOW_IMPLICIT_CONVERSIONS;
  }

  // TODO Refresh editors
  public void setShowNotFoundImplicitArguments(boolean value) {
    SHOW_NOT_FOUND_IMPLICIT_ARGUMENTS = value;
  }

  public boolean isShowNotFoundImplicitArguments() {
    return SHOW_NOT_FOUND_IMPLICIT_ARGUMENTS;
  }

  // TODO Refresh editors
  public void setShowAmbiguousImplicitArguments(boolean value) {
    SHOW_AMBIGUOUS_IMPLICIT_ARGUMENTS = value;
  }

  public boolean isShowAmbiguousImplicitArguments() {
    return SHOW_AMBIGUOUS_IMPLICIT_ARGUMENTS;
  }

  public void setShowImplicitConversions(boolean value) {
    SHOW_IMPLICIT_CONVERSIONS = value;
  }

  public boolean isShowArgumentsToByNameParams() {
    return SHOW_ARGUMENTS_TO_BY_NAME_PARAMETERS;
  }

  public void setShowArgumentsToByNameParams(boolean value) {
    SHOW_ARGUMENTS_TO_BY_NAME_PARAMETERS = value;
  }

  public boolean isCustomScalatestSyntaxHighlighting() {
    return CUSTOM_SCALATEST_SYNTAX_HIGHLIGHTING;
  }

  public void setCustomScalatestSyntaxHighlighting(boolean value) {
    CUSTOM_SCALATEST_SYNTAX_HIGHLIGHTING = value;
  }

  public boolean isIncludeBlockExpressions() {
    return INCLUDE_BLOCK_EXPRESSIONS;
  }

  public void setIncludeBlockExpressions(boolean value) {
    INCLUDE_BLOCK_EXPRESSIONS = value;
  }

  public boolean isIncludeLiterals() {
    return INCLUDE_LITERALS;
  }

  public void setIncludeLiterals(boolean value) {
    INCLUDE_LITERALS = value;
  }

  public boolean isTreatDocCommentAsBlockComment() {
    return TREAT_DOC_COMMENT_AS_BLOCK_COMMENT;
  }

  public void setTreatDocCommentAsBlockComment(boolean value) {
    TREAT_DOC_COMMENT_AS_BLOCK_COMMENT = value;
  }

  public boolean isDontCacheCompoundTypes() {
      return DONT_CACHE_COMPOUND_TYPES;
  }

  public void setDontCacheCompoundTypes(boolean value) {
      DONT_CACHE_COMPOUND_TYPES = value;
  }

  public boolean isDisableLangInjection() {
    return DISABLE_LANGUAGE_INJECTION;
  }

  public void setDisableLangInjection(boolean value) {
    DISABLE_LANGUAGE_INJECTION = value;
  }

  public boolean isAotCompletion() {
    return AOT_COMPLETION;
  }

  public void setAotCOmpletion(boolean value) {
    AOT_COMPLETION = value;
  }

  public boolean isProjectViewHighlighting() {
    return PROJECT_VIEW_HIGHLIGHTING;
  }

  public void setProjectViewHighlighting(boolean value) {
    PROJECT_VIEW_HIGHLIGHTING = value;
  }

  public boolean isGroupPackageObjectWithPackage() {
    return GROUP_PACKAGE_OBJECT_WITH_PACKAGE;
  }

  public void setGroupPackageObjectWithPackage(boolean value) {
    GROUP_PACKAGE_OBJECT_WITH_PACKAGE = value;
  }

  public boolean isScalaPriority() {
    return SCALA_CLASSES_PRIORITY;
  }

  public void setScalaPriority(boolean value) {
    SCALA_CLASSES_PRIORITY = value;
  }

  public boolean isTypeMismatchHints() {
    return TYPE_MISMATCH_HINTS;
  }

  public void setTypeMismatchHints(boolean value) {
    TYPE_MISMATCH_HINTS = value;
  }

  public boolean isCompilerHighlightingScala2() {
    return COMPILER_HIGHLIGHTING_SCALA2;
  }
  public boolean isCompilerHighlightingScala3() {
    return COMPILER_HIGHLIGHTING_SCALA3;
  }

  public void setCompilerHighlightingScala2(boolean value) {
    COMPILER_HIGHLIGHTING_SCALA2 = value;
    var listener = ApplicationManager.getApplication().getMessageBus()
            .syncPublisher(CompilerHighlightingListener$.MODULE$.Topic());
    listener.compilerHighlightingScala2Changed(value);
  }
  public void setCompilerHighlightingScala3(boolean value) {
    COMPILER_HIGHLIGHTING_SCALA3 = value;
    var listener = ApplicationManager.getApplication().getMessageBus()
            .syncPublisher(CompilerHighlightingListener$.MODULE$.Topic());
    listener.compilerHighlightingScala3Changed(value);
  }

  public boolean isTypeAwareHighlightingEnabled() {
    return TYPE_AWARE_HIGHLIGHTING_ENABLED;
  }

  public void toggleTypeAwareHighlighting() {
    TYPE_AWARE_HIGHLIGHTING_ENABLED = !TYPE_AWARE_HIGHLIGHTING_ENABLED;
  }

  AliasExportSemantics getAliasSemantics() {
    return ALIAS_EXPORT_SEMANTICS;
  }

  void setAliasSemantics(AliasExportSemantics semantics) {
    ALIAS_EXPORT_SEMANTICS = semantics;
  }

  public boolean aliasExportsEnabled() {
    return ALIAS_EXPORT_SEMANTICS == AliasExportSemantics.Export;
  }

  @OptionTag(converter = ScalaCollectionHighlightingLevelConverter.class)
  public ScalaCollectionHighlightingLevel getCollectionTypeHighlightingLevel() {
    return COLLECTION_TYPE_HIGHLIGHTING_LEVEL;
  }

  public void setCollectionTypeHighlightingLevel(ScalaCollectionHighlightingLevel level) {
    this.COLLECTION_TYPE_HIGHLIGHTING_LEVEL = level;
  }

  public Map<String, String> getIntInjectionMapping() {
    return INTERPOLATED_INJECTION_MAPPING;
  }

  public String getScalaTestDefaultSuperClass() {
    return SCALATEST_DEFAULT_SUPERCLASS;
  }

  public void setScalaTestDefaultSuperClass(String superClassName) {
    SCALATEST_DEFAULT_SUPERCLASS = superClassName;
  }

  @NotNull
  public String getBasePackageFor(@NotNull Module module) {
    if (INHERIT_BASE_PACKAGES) {
      return Arrays.stream(ModuleRootManager.getInstance(module).getContentEntries())
              .flatMap(it -> Arrays.stream(it.getSourceFolders()))
              .map(SourceFolder::getPackagePrefix)
              .filter(it -> !it.isEmpty())
              .findFirst()
              .orElse("");
    } else {
      return CUSTOM_BASE_PACKAGES.getOrDefault(module.getName(), "");
    }
  }

  public boolean isInheritBasePackages() {
    return INHERIT_BASE_PACKAGES;
  }

  public void setInheritBasePackages(boolean b) {
    INHERIT_BASE_PACKAGES = b;
  }

  @NotNull
  public Map<String, String> getCustomBasePackages() {
    return CUSTOM_BASE_PACKAGES;
  }

  public void setCustomBasePackages(@NotNull Map<String, String> basePackages) {
    CUSTOM_BASE_PACKAGES = basePackages;
  }

  public void setCustomBasePackage(@NotNull String module, @Nullable String basePackages) {
    if (basePackages == null) {
      CUSTOM_BASE_PACKAGES.remove(module);
    } else {
      CUSTOM_BASE_PACKAGES.put(module, basePackages);
    }
    INHERIT_BASE_PACKAGES = CUSTOM_BASE_PACKAGES.isEmpty();
  }

  public void setIntInjectionMapping(Map<String, String> intInjectionMapping) {
    INTERPOLATED_INJECTION_MAPPING = intInjectionMapping;
  }

  public boolean isWorksheetFoldCollapsedByDefault() {
    return IS_WORKSHEET_FOLD_COLLAPSED_BY_DEFAULT;
  }

  public void setWorksheetFoldCollapsedByDefault(boolean isCollapsed) {
    IS_WORKSHEET_FOLD_COLLAPSED_BY_DEFAULT = isCollapsed;
  }

  public boolean isInProcessMode() {
    return IN_PROCESS_MODE;
  }

  public void setInProcessMode(boolean inProcess) {
    this.IN_PROCESS_MODE = inProcess;
  }

  public boolean isUseEclipseCompatibility() {
    return USE_ECLIPSE_COMPATIBILITY;
  }

  public void setUseEclipseCompatibility(boolean USE_ECLIPSE_COMPATIBILITY) {
    this.USE_ECLIPSE_COMPATIBILITY = USE_ECLIPSE_COMPATIBILITY;
  }

  @ReportValue
  public int getAutoRunDelay() {
    return AUTORUN_DELAY;
  }

  public void setAutoRunDelay(int delay) {
    AUTORUN_DELAY = delay;
  }

  public boolean isTreatScratchFilesAsWorksheet() {
    return TREAT_SCRATCH_AS_WORKSHEET;
  }

  public void setTreatScratchFilesAsWorksheet(boolean b) {
    TREAT_SCRATCH_AS_WORKSHEET = b;
  }

  public ScFileMode getScFileMode() {
    return SC_FILE_MODE;
  }

  public void setScFileMode(ScFileMode mode) {
    Stats.trigger(FeatureKey.scFileModeSet(mode.name()));
    SC_FILE_MODE = mode;
  }

  public void setBreadcrumbsClassEnabled(boolean enabled) {
    BREADCRUMBS_CLASS_ENABLED = enabled;
  }

  public void setBreadcrumbsFunctionEnabled(boolean enabled) {
    BREADCRUMBS_FUNCTION_ENABLED = enabled;
  }

  public void setBreadcrumbsLambdaEnabled(boolean enabled) {
    BREADCRUMBS_LAMBDA_ENABLED = enabled;
  }

  public void setBreadcrumbsMatchEnabled(boolean enabled) {
    BREADCRUMBS_MATCH_ENABLED = enabled;
  }

  public void setBreadcrumbsValDefEnabled(boolean enabled) {
    BREADCRUMBS_VAL_DEF_ENABLED = enabled;
  }

  public void setBreadcrumbsIfDoWhileEnabled(boolean enabled) {
    BREADCRUMBS_IF_DO_WHILE_ENABLED = enabled;
  }

  public boolean isBreadcrumbsClassEnabled() {
    return BREADCRUMBS_CLASS_ENABLED;
  }

  public boolean isBreadcrumbsFunctionEnabled() {
    return BREADCRUMBS_FUNCTION_ENABLED;
  }

  public boolean isBreadcrumbsLambdaEnabled() {
    return BREADCRUMBS_LAMBDA_ENABLED;
  }

  public boolean isBreadcrumbsMatchEnabled() {
    return BREADCRUMBS_MATCH_ENABLED;
  }

  public boolean isBreadcrumbsValDefEnabled() {
    return BREADCRUMBS_VAL_DEF_ENABLED;
  }

  public boolean isBreadcrumbsIfDoWhileEnabled() {
    return BREADCRUMBS_IF_DO_WHILE_ENABLED;
  }

  public boolean isGenerateToStringWithPropertiesNames() {
    return GENERATE_TOSTRING_WITH_FIELD_NAMES;
  }

  public void setGenerateToStringWithPropertiesNames(boolean value) {
    GENERATE_TOSTRING_WITH_FIELD_NAMES = value;
  }

  public TrailingCommasMode getTrailingCommasMode() {
    return TRAILING_COMMAS_ENABLED;
  }

  public void setTrailingCommasMode(TrailingCommasMode mode) {
    TRAILING_COMMAS_ENABLED = mode;
  }

  public boolean isEnableLibraryExtensions() {
    return ENABLE_LIBRARY_EXTENSIONS;
  }

  public void setEnableLibraryExtensions(boolean ENABLE_LIBRARY_EXTENSIONS) {
    this.ENABLE_LIBRARY_EXTENSIONS = ENABLE_LIBRARY_EXTENSIONS;
  }

  public boolean isScala3DisclaimerShown() {
    return SCALA_3_DISCLAIMER_SHOWN;
  }

  public void setScala3DisclaimerShown(boolean b) {
    SCALA_3_DISCLAIMER_SHOWN = b;
  }

  public ScalaMetaMode getScalaMetaMode() {
    return scalaMetaMode;
  }

  public void setScalaMetaMode(ScalaMetaMode scalaMetaMode) {
    this.scalaMetaMode = scalaMetaMode;
  }

  public boolean isMetaTrimMethodBodies() {
    return metaTrimMethodBodies;
  }

  public void setMetaTrimMethodBodies(boolean metaTrimMethodBodies) {
    this.metaTrimMethodBodies = metaTrimMethodBodies;
  }

  public Ivy2IndexingMode getIvy2IndexingMode() {
    return IVY2_INDEXING_MODE;
  }

  public void setIvy2IndexingMode(Ivy2IndexingMode IVY2_INDEXING_MODE) {
    this.IVY2_INDEXING_MODE = IVY2_INDEXING_MODE;
  }

}


text:
package highlevel;

import common.Helper;
import common.Message;
import org.rapidoid.commons.Err;
import org.rapidoid.config.Conf;
import org.rapidoid.env.Env;
import org.rapidoid.http.MediaType;
import org.rapidoid.jdbc.JDBC;
import org.rapidoid.jdbc.JdbcClient;
import org.rapidoid.log.Log;
import org.rapidoid.setup.App;
import org.rapidoid.setup.On;

public class Main {

	public static void main(String[] args) {
		App.run(args);

		Conf.HTTP.set("maxPipeline", 128);
		Conf.HTTP.set("timeout", 0);
		Conf.HTTP.sub("mandatoryHeaders").set("connection", false);

		On.port(8080);

		if (Env.hasAnyProfile("mysql", "postgres")) {
			setupDbHandlers();
		} else {
			setupSimpleHandlers();
		}
	}

	private static void setupSimpleHandlers() {
		On.get("/plaintext").managed(false).contentType(MediaType.TEXT_PLAIN).serve("Hello, world!");
		On.get("/json").managed(false).json(() -> new Message("Hello, world!"));
	}

	private static void setupDbHandlers() {
		String dbHost = Conf.ROOT.entry("dbhost").or("localhost");
		Log.info("Database hostname is: " + dbHost);

		JdbcClient jdbc = JDBC.api();

		if (Env.hasProfile("mysql")) {
			jdbc.url("jdbc:mysql://" + dbHost + ":3306/hello_world?" + Helper.MYSQL_CONFIG);

		} else if (Env.hasProfile("postgres")) {
			jdbc.url("jdbc:postgresql://" + dbHost + ":5432/hello_world?" + Helper.POSTGRES_CONFIG);

		} else {
			throw Err.notExpected();
		}

		On.get("/fortunes").managed(false).html(new FortunesHandler(jdbc));
	}

}

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Droid\Plugin\Fs\Command;

use RuntimeException;

use Droid\Lib\Plugin\Command\CheckableTrait;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

use Droid\Lib\Plugin\Model\File\FileFactory;
use Droid\Lib\Plugin\Model\File\NameValueLine;
use Droid\Lib\Plugin\Model\File\UnusableFileException;
use Droid\Plugin\Fs\Utils;

class FsSetlineCommand extends Command
{
    use CheckableTrait;

    protected $fileFactory;

    public function __construct(
        FileFactory $fileFactory,
        $name = null
    ) {
        $this->fileFactory = $fileFactory;
        return parent::__construct($name);
    }

    public function configure()
    {
        $this->setName('fs:setline')
            ->setDescription('Add a (name, value) pair to a line based file, or update an existing (name, value) pair.')
            ->addArgument(
                'file',
                InputArgument::REQUIRED,
                'The path to a line based file'
            )
            ->addArgument(
                'option-name',
                InputArgument::REQUIRED,
                'The name in a (name, value) pair'
            )
            ->addArgument(
                'option-value',
                InputArgument::REQUIRED,
                'The value in a (name, value) pair'
            )
            ->addOption(
                '--separator',
                's',
                InputOption::VALUE_REQUIRED,
                'Characters which separate the name from the value in a (name, value) pair.'
            )
            ->addOption(
                '--compare-values',
                'm',
                InputOption::VALUE_NONE,
                'Prevent duplicate lines as normal, but compare the contents of the "value" field instead of the "name" field.'
            )
        ;
        $this->configureCheckMode();
    }

    public function execute(InputInterface $input, OutputInterface $output)
    {
        $this->activateCheckMode($input);

        $filepath = Utils::normalizePath($input->getArgument('file'));

        if (! file_exists($filepath)) {
            throw new RuntimeException(
                sprintf('The file "%s" does not exist.', $filepath)
            );
        }

        if ($input->getOption('separator')) {
            $this
                ->fileFactory
                ->getLineFactory()
                ->setFieldSeparator($input->getOption('separator'))
            ;
        }
        if ($input->getOption('compare-values')) {
            $this
                ->fileFactory
                ->getLineFactory()
                ->setMappingFields(array(NameValueLine::FIELD_VALUE))
            ;
        }

        $file = $this->fileFactory->makeFile($filepath);
        $line = $this->fileFactory->getLineFactory()->makeLine();

        $line
            ->setFieldValue(
                NameValueLine::FIELD_NAME,
                $input->getArgument('option-name')
            )
            ->setFieldValue(
                NameValueLine::FIELD_VALUE,
                $input->getArgument('option-value')
            )
        ;

        try {
            $file->setLine($line);
        } catch (UnusableFileException $e) {
            throw new RuntimeException(
                'I cannot set a line in the file',
                null,
                $e
            );
        }

        if (! $file->changed()) {
            $output->WriteLn(
                sprintf(
                    'I am not making any changes to the file "%s"; it already has the line "%s%s%s".',
                    $filepath,
                    $input->getArgument('option-name'),
                    $this->fileFactory->getLineFactory()->getFieldSeparator(),
                    $input->getArgument('option-value')
                )
            );
            $this->reportChange($output);
            return 0;
        } elseif ($this->checkMode()) {
            $this->markChange();
            $output->WriteLn(
                sprintf(
                    'I would make a change to the file "%s".',
                    $filepath
                )
            );
            $this->reportChange($output);
            return 0;
        }

        $this->markChange();
        $output->WriteLn(
            sprintf(
                'I am making your changes to the file "%s".',
                $filepath
            )
        );
        $file
            ->backup($this->backupName($filepath))
            ->finish()
        ;
        $this->reportChange($output);
    }

    private function backupName($originalName)
    {
        return sprintf('%s.%s.backup', $originalName, date('Y-m-d_H-i-s'));
    }
}


text:
package configo

import (
	"errors"
	"strings"
	"testing"
)

type testConfig struct {
	User     string
	Password string
	Age      int
}

var expectedConfig = testConfig{
	User:     "myself",
	Password: "my_password",
	Age:      28,
}

var testConfigFiles = map[string]string{
	"json": `{"user": "myself", "password": "my_password", "age": 28}`,
	"xml":  `<?xml version="1.0"?><config><User>myself</User><Password>my_password</Password><Age>28</Age></config>`,
	"yml":  "user: myself\npassword: my_password\nage: 28",
}

func TestJson(t *testing.T) {
	testLoad(t, "json")
}

func TestXml(t *testing.T) {
	testLoad(t, "xml")
}

func TestYml(t *testing.T) {
	testLoad(t, "yml")
}

func TestYmlNode(t *testing.T) {
	fileNotExist = func(filename string) bool {
		return false
	}
	readFile = func(filename string) ([]byte, error) {
		return []byte("node1:\n  user: not_me\n" +
			"\nnode2:\n  " +
			strings.Replace(testConfigFiles["yml"], "\n", "\n  ", -1) +
			"\n\nnode3:\n  user: not_me\n"), nil
	}

	var config testConfig
	if err := LoadNode("config.yml", "node2", &config); err != nil {
		t.Fatal(err)
	}

	if config != expectedConfig {
		t.Errorf("Invalid config, got: %#v, expected: %#v", config, expectedConfig)
	}
}

func TestNotFound(t *testing.T) {
	if IsNotFound(errors.New("Test error")) {
		t.Error("IsNotFound(errors.New()) should be false")
	}

	fileNotExist = func(filename string) bool {
		return true
	}

	var conf struct{}
	err := Load("/fake/file.json", conf)
	if !IsNotFound(err) {
		t.Errorf(`IsNotFound(Load("/fake/file")) should be true, err = %v`, err)
	}
}

func testLoad(t *testing.T, extension string) {
	fileNotExist = func(filename string) bool {
		return false
	}
	readFile = func(filename string) ([]byte, error) {
		return []byte(testConfigFiles[extension]), nil
	}

	var config testConfig
	if err := Load("config."+extension, &config); err != nil {
		t.Fatal(err)
	}

	if config != expectedConfig {
		t.Errorf("Invalid config, got: %#v, expected: %#v", config, expectedConfig)
	}
}


text:
package net.javacrumbs.smock.axis2.server;

import net.javacrumbs.smock.common.server.CommonSmockServer;

import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.springframework.core.io.Resource;
import org.springframework.util.Assert;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;

/**
 * Adds extra functionality to Spring WS server test support.
 * @author Lukas Krecan
 *
 */
public class SmockServer extends CommonSmockServer {

	public static Axis2MockWebServiceClient createClient(ConfigurationContext configurationContext, ClientInterceptor[] interceptors) {
		return new Axis2MockWebServiceClient(configurationContext, interceptors);
	}

	public static Axis2MockWebServiceClient createClient(ConfigurationContext configurationContext) {
		return createClient(configurationContext, null);
	}

	public static ConfigurationContext createConfigurationContextFromResource(Resource axis2Repository) {
		try {
			Assert.notNull(axis2Repository, "axis2Repository can not be null");
			return ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2Repository.getFile().getAbsolutePath());
		} catch (Exception e) {
			throw new IllegalStateException("Can not load Axis2 repository.",e);
		}
	}
}


text:
import * as React from "react";
import FormGroup from "@material-ui/core/FormGroup";
import { ApiCheckbox } from "../../react_components/ApiCheckbox";
import { SettingsGroup } from "../commonPublish/PublishScreenBaseComponents";
import { useL10n } from "../../react_components/l10nHooks";
import { BloomApi } from "../../utils/bloomApi";

export const PublishFeaturesGroup: React.FunctionComponent<{
    onChange?: () => void;
}> = props => {
    const [motionEnabled] = BloomApi.useApiBoolean(
        "publish/android/canHaveMotionMode",
        false
    );

    return (
        <SettingsGroup
            label={useL10n("Features", "PublishTab.Android.Features")}
        >
            <FormGroup>
                {/* <ApiCheckbox label="Talking Book" /> */}
                <ApiCheckbox
                    english="Motion Book"
                    l10nKey="PublishTab.Android.MotionBookMode"
                    // tslint:disable-next-line:max-line-length
                    l10nComment="Motion Books are Talking Books in which the picture fills the screen, then pans and zooms while you hear the voice recording. This happens only if you turn the book sideways."
                    apiEndpoint="publish/android/motionBookMode"
                    onChange={props.onChange}
                    disabled={!motionEnabled}
                />
                {/* <ApiCheckbox label="Sign Language" />
            <ApiCheckbox label="Image Descriptions" /> */}
            </FormGroup>
        </SettingsGroup>
    );
};


text:
namespace str_tools {

std::string strip(const std::string& ret);
void split(std::string& s, char delim, std::vector<std::string>& ret);
int prefix_and_digits(const struct dirent *dptr);
int prefix_and_digits_node(const struct dirent *dptr);
int prefix_and_digits_vcpu(const struct dirent *dptr);
void get_dirs(std::string dir, std::string dir_prefix, std::vector<std::string>* node_dirs);

}

#endif


text:
module OneviewCookbook
  module API1000
    module C7000
      # FcNetwork API1000 C7000 provider
      class FCNetworkProvider < OneviewCookbook::API800::C7000::FCNetworkProvider
      end
    end
  end
end


text:
import json
import logging

import requests
from requests.exceptions import SSLError
from requests.exceptions import Timeout

from .exceptions import FBConnectionException
from .exceptions import FBException
from .exceptions import FBHTTPException
from .exceptions import FBJSONException

BASE_GRAPH_URL = "https://graph.facebook.com"
BATCH_QUERY_LIMIT = 50
TIMEOUT = 60.0
VERIFY_SSL = False

log = logging.getLogger(__name__)

def GetRequestFactory(relative_url, **params):
    ''' Returns a properly formed GET request dictionary. '''

    params['method'] = 'GET'
    params['relative_url'] = relative_url

    return params

class FBGraph(object):
    def __init__(self, access_token='', timeout=TIMEOUT,
                 pre_hook=None, post_hook=None):
        """
        :param access_token: A valid Facebook access token.
        :param timeout: Per-request HTTP timeout. Default is 60.0 seconds.
        :param pre_hook: Callable that will run before a request is made.
        :param post_hook: Callable that will run after a request is made.
        :return: FBGraph instance.
        """

        self._access_token = access_token
        self._response_fmt = 'json'
        self._timeout = timeout
        self.pre_hook = pre_hook
        self.post_hook = post_hook

    def get(self, relative_url, params=None):
        """
        Query facebook's graph api at relative_url with
        query string parameters params, where params is a python dict.
        """
        params = params or {}
        params['access_token'] = self._access_token

        data = self._issue_request('get', relative_url, params=params,
            timeout=self._timeout)

        return data

    def post(self, relative_url, payload=None):
        """
        Publish to the graph.
        Returns a deserialized python object, see
        `Graph API<https://developers.facebook.com/docs/reference/api/>`_

        Note: this method requires a valid access token to work.

        Example 1::
           data = fbg.post('me/feed', {'message': 'Hello, Facebook World!'})
           print data
           # {u'id': u'537208670_111222333444555666777'}

        Example 2::

           new_pic = open('my_pic.png', 'rb')
           data = fbg.post('me/photos', {
              'source': new_pic,
              'message': 'Hey, I\'m posting a picture on Facebook!'})
           print data
           # {u'id': u'123456789012', u'post_id': u'537208670_123456789012'}
        """
        if not isinstance(payload, dict):
            raise FBException('Must specify payload as dict.')

        files = {}
        for k in payload.keys():
            if isinstance(payload[k], file):
                files[k] = payload[k]
                del payload[k]

        payload = payload or {}
        payload['access_token'] = self._access_token

        data = self._issue_request('post', relative_url, data=payload,
            files=files, timeout=self._timeout)

        return data

    def delete(self, relative_url, payload=None):
        """
        Publish a DELETE to the graph.
        Returns a deserialized python object, see
        `Graph API<https://developers.facebook.com/docs/reference/api/>`_

        Note: this method requires a valid access token to work.

        Example 1::
            data = fbg.delete('537208670_111222333444555666777')
            print data
            # True or False
        """
        payload = payload or {}
        payload['access_token'] = self._access_token

        data = self._issue_request('delete', relative_url, data=payload,
                                   timeout=self._timeout)

        return data

    def batch(self, batch):
        """
        Query's facebook's graph api in batches. batch is a list of dicts,
        where each dict is of the form::

           {'method': 'GET', 'relative_url': 'someurl', ...}.

        There are optional params available, see:
        https://developers.facebook.com/docs/reference/api/batch/

        Returns a list of completely deserialized python data structures for
        each batch response, of the form:
            [
                {
                    "headers": [{ ... }],
                    "code": 200,
                    "body": { ... }
                },
                ...
            ]

        If there was an error in an individual response, the "body" will
        contain the deserialized Facebook error response.
        See: https://developers.facebook.com/docs/reference/api/batch/
        """
        payload = {
            'batch': json.dumps(batch),
            'access_token': self._access_token
        }

        data = self._issue_request('post', '', data=payload,
            timeout=self._timeout)

        # deserialize the body of each batch response, need to make sure it
        # is deserializable, thanks to this bug:
        # https://developers.facebook.com/bugs/295201867209494
        for d in data:
            if isinstance(d, dict) and 'body' in d:
                try:
                    d['body'] = json.loads(d['body'])
                except Exception as e:
                    log.warn("Error decoding JSON in batched request: {0}".format(e.message))
                    d['body'] = {'data': []} # default in case deserialization fails
                    pass

        return data

    def _issue_request(self, method, relative_url, **kwargs):
        """
        Generic method for making requests to the Graph API and deserializing
        the response. Here we aggregate all general error-handling & exception
        catching/raising.

        Returns: deserialized JSON as native Python data structures.
        """
        url = BASE_GRAPH_URL + ('/%s' % relative_url)
        kwargs['timeout'] = kwargs.get('timeout', TIMEOUT)
        kwargs['verify'] = kwargs.get('verify', VERIFY_SSL)

        self._exec_hook('pre')
        try:
            r = requests.request(method, url, **kwargs)
        except (SSLError, Timeout) as e:
            raise FBConnectionException(e.message)
        self._exec_hook('post')

        if r.status_code != requests.codes.ok:
            raise FBHTTPException(r.status_code, r.text)

        try:
            data = json.loads(r.text)
        except ValueError as e:
            log.warn("Error decoding JSON: {0}. JSON={1}".format(e.message, r.text))
            raise FBJSONException("%s (%s)" % (e.message, r.text))

        return data

    def _exec_hook(self, hook_type):
        hook = None

        if hook_type == 'pre':
            hook = self.pre_hook
        elif hook_type == 'post':
            hook = self.post_hook

        if callable(hook):
            try:
                hook()
            except Exception as e:
                log.warning('Warning: pre_hook raised %s', e.message)


text:
+++
City = "Boston"
Year = "2016"
date = "2016-06-20T18:00:00-05:00"
title = "Spencer Krum"
type = "talk"
aliases = ["/events/2016-boston/program/spencer-krum/"]
+++

Title:
  Code Review for Operations

Description:

   Code review has always been used by developers, recently operations has started as well. How is it different when operators are reviewing code that has an operations impact? How can it be optimized? Our team has been reviewing ops code for years, and I'm here to share the lessons we learned.


text:
Imports SistFoncreagro.BussinessEntities

Public Interface IPermisosRepository
    Function GetAllFromPermisos() As List(Of Permisos)
    Function GetPermisosByDescripcion(ByVal descripcion As String) As Permisos
    Function PASolicitaAprobacion(ByVal IdPersonal As Int32) As Int32
End Interface


text:
<?php

declare(strict_types=1);

namespace Sylius\Bundle\ShippingBundle;

use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
use Sylius\Bundle\ShippingBundle\DependencyInjection\Compiler\CompositeShippingMethodEligibilityCheckerPass;
use Sylius\Bundle\ShippingBundle\DependencyInjection\Compiler\RegisterCalculatorsPass;
use Sylius\Bundle\ShippingBundle\DependencyInjection\Compiler\RegisterRuleCheckersPass;
use Sylius\Bundle\ShippingBundle\DependencyInjection\Compiler\RegisterShippingMethodsResolversPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;

final class SyliusShippingBundle extends AbstractResourceBundle
{
    public function getSupportedDrivers(): array
    {
        return [
            SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
        ];
    }

    public function build(ContainerBuilder $container): void
    {
        parent::build($container);

        $container->addCompilerPass(new CompositeShippingMethodEligibilityCheckerPass());
        $container->addCompilerPass(new RegisterCalculatorsPass());
        $container->addCompilerPass(new RegisterRuleCheckersPass());
        $container->addCompilerPass(new RegisterShippingMethodsResolversPass());
    }

    /**
     * @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345
     */
    protected function getModelNamespace(): string
    {
        return 'Sylius\Component\Shipping\Model';
    }
}


text:
@interface DRDAPIPutCall : DRDBaseAPI

@end


text:
`@most/multicast` is deprecated.

Support and maintenance will cease when `@most/core` 1.0 is released. Meanwhile, only critical bug fixes will be released.

Its functionality is currently available in [@most/core](http://mostcore.readthedocs.io/en/latest/api.html#multicast) and will also be available in most 2.0.

# @most/multicast

Efficient source sharing of an underlying stream to multiple observers.

## API

### multicast :: Stream a → Stream a
Returns a stream equivalent to the original, but which can be shared more efficiently among multiple consumers.

```
stream:             -a-b-c-d->
multicast(stream):  -a-b-c-d->
```

Using multicast allows you to build up a stream of maps, filters, and other transformations, and then share it efficiently with multiple observers.


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>

<?php echo $heading ?>

<?php if(($results)): ?>

			<?php foreach($results as $row): ?>

<?php echo $row->report_name; ?>

<?php echo $row->report; ?>

					<a href="<?php echo base_url() ?>reports/detail/<?php echo $row->report_id; ?>" class="btn btn-primary">Details

			<?php endforeach; ?>

<?php endif; ?>


text:
// First Ground version: 1.3.1
// Author: Gold Experience Team (http://www.ge-team.com/)
// Support: geteamdev@gmail.com
// Please direct any bugs/comments/suggestions to geteamdev@gmail.com

#region Namespaces

using UnityEngine;
using System.Collections;

using UnityEngine.UI;

#endregion //Namespaces

/***************
* FirstGroundUIController class
* This class handles user key inputs.
**************/

public class FirstGroundUIController : MonoBehaviour {

	#region Variables

		// Canvas
		public Canvas		m_Canvas									= null;

		// SelectDemo
		public Button		m_SelectDemo_Button							= null;
		public GameObject	m_SelectDemo_Window							= null;

		// Help
		public Button		m_Help_Button								= null;
		public GameObject	m_Help_Window								= null;

		// HowTo
		public GameObject	m_HowTo										= null;

	#endregion

	// ######################################################################
	// MonoBehaviour Functions
	// ######################################################################

	#region MonoBehaviour

	// Use this for initialization
	void Awake () {
		//////////////////////////////////////////////////////////////////////
		// If GUIAnimSystemFREE.Instance.m_AutoAnimation is false, all GEAnim elements in the scene will be controlled by scripts.
		// Otherwise, they will be animated automatically.
		//////////////////////////////////////////////////////////////////////
		if (enabled)
		{
			GUIAnimSystemFREE.Instance.m_GUISpeed = 4.0f;
			GUIAnimSystemFREE.Instance.m_AutoAnimation = false;
		}
	}

	// Use this for initialization
	void Start () {

		// Play UI move-in animations
		StartCoroutine(ShowUIs());

	}

	// Update is called once per frame
	void Update () {

	}

	#endregion //MonoBehaviour

	// ######################################################################
	// Functions Functions
	// ######################################################################

	#region Functions

	// Play UI move-in animations
	IEnumerator ShowUIs()
	{
		GUIAnimSystemFREE.Instance.SetGraphicRaycasterEnable(m_Canvas, false);

		yield return new WaitForSeconds(0.5f);

		GUIAnimSystemFREE.Instance.MoveIn(m_SelectDemo_Button.transform, true);

		yield return new WaitForSeconds(0.25f);

		GUIAnimSystemFREE.Instance.MoveIn(m_Help_Button.transform, true);

		yield return new WaitForSeconds(0.25f);

		GUIAnimSystemFREE.Instance.MoveIn(m_HowTo.transform, true);

		GUIAnimSystemFREE.Instance.SetGraphicRaycasterEnable(m_Canvas, true);
	}

	#endregion //Functions

	// ######################################################################
	// UI Respond Functions
	// ######################################################################

	#region UI Respond Functions

		public void Button_SelectDemo()
		{
			GUIAnimSystemFREE.Instance.MoveOut(m_SelectDemo_Button.transform, true);
			GUIAnimSystemFREE.Instance.MoveIn(m_SelectDemo_Window.transform, true);
		}

		public void Button_SelectDemo_Minimize()
		{
			GUIAnimSystemFREE.Instance.MoveIn(m_SelectDemo_Button.transform, true);
			GUIAnimSystemFREE.Instance.MoveOut(m_SelectDemo_Window.transform, true);
		}

		public void Button_SelectDemo_Arctic()
		{
			GUIAnimSystemFREE.Instance.LoadLevel("Arctic",0.1f);
		}

		public void Button_SelectDemo_Grassland()
		{
			GUIAnimSystemFREE.Instance.LoadLevel("Grassland",0.1f);
		}

		public void Button_SelectDemo_Volcano()
		{
			GUIAnimSystemFREE.Instance.LoadLevel("Volcano",0.1f);
		}

		public void Button_SelectDemo_Wasteland()
		{
			GUIAnimSystemFREE.Instance.LoadLevel("Wasteland",0.1f);
		}

		public void Button_Help()
		{
			GUIAnimSystemFREE.Instance.MoveOut(m_Help_Button.transform, true);
			GUIAnimSystemFREE.Instance.MoveIn(m_Help_Window.transform, true);
		}

		public void Button_Help_Minimize()
		{
			GUIAnimSystemFREE.Instance.MoveIn(m_Help_Button.transform, true);
			GUIAnimSystemFREE.Instance.MoveOut(m_Help_Window.transform, true);
		}

		public void Button_Help_Support()
		{
			Application.OpenURL("mailto:geteamdev@gmail.com");
		}

		public void Button_Help_Products()
		{
			Application.ExternalEval("window.open('http://ge-team.com/pages/unity-3d/','GOLD EXPERIENCE TEAM')");
		}

	#endregion //UI Respond Functions
}


text:
<?php

namespace ByJG\Serializer;

/**
 * Description of DumpToArrayInterface
 *
 * @author jg
 */
interface DumpToArrayInterface
{
    public function toArray();
}


text:
make CC=$CC INCLUDES="-I$PREFIX/include" CFLAGS+="-g -Wall -O2 -L$PREFIX/lib"
chmod +x srnaMapper
mkdir -p ${PREFIX}/bin
cp -f srnaMapper ${PREFIX}/bin


text:
import { TestBed, inject } from '@angular/core/testing';

import { ProductcodeService } from './productcode.service';

describe('ProductcodeService', () => {
  beforeEach(() => {
    TestBed.configureTestingModule({
      providers: [ProductcodeService]
    });
  });

  it('should ...', inject([ProductcodeService], (service: ProductcodeService) => {
    expect(service).toBeTruthy();
  }));
});


text:
import {babel} from '@rollup/plugin-babel';
import {terser} from 'rollup-plugin-terser';

/**
 * @external RollupConfig
 * @type {PlainObject}
 * @see {@link https://rollupjs.org/guide/en#big-list-of-options}
 */

/**
 * @param {PlainObject} [config={}]
 * @param {boolean} [config.minifying]
 * @param {string} [config.format="umd"]
 * @returns {external:RollupConfig}
 */
function getRollupObject ({minifying, format = 'umd'} = {}) {
    const nonMinified = {
        input: 'typeson.js',
        output: {
            file: `dist/typeson${
                format === 'cjs' ? '' : `.${format}`
            }${minifying ? '.min' : ''}.${
                format === 'cjs' ? 'c' : ''
            }js`,
            format,
            name: 'Typeson'
        },
        plugins: [
            babel({
                babelHelpers: 'bundled'
            })
        ]
    };
    if (minifying) {
        nonMinified.plugins.push(
            terser({
                // Needed for `Typeson.Undefined` and other constructor
                //   detection
                keep_fnames: true,
                // Keep in case implementing above as classes
                keep_classnames: true
            })
        );
    }
    return nonMinified;
}

export default [
    getRollupObject({minifying: true, format: 'umd'}),
    getRollupObject({minifying: false, format: 'umd'}),
    getRollupObject({minifying: false, format: 'cjs'}),
    getRollupObject({minifying: true, format: 'esm'}),
    getRollupObject({minifying: false, format: 'esm'})
];


text:
package org.lwjgl.vulkan;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * See {@link VkSamplerYcbcrConversionCreateInfo}.
 *
 *
Layout

 *
 *

 * struct VkSamplerYcbcrConversionCreateInfoKHR {
 *     VkStructureType sType;
 *     void const * pNext;
 *     VkFormat format;
 *     VkSamplerYcbcrModelConversion ycbcrModel;
 *     VkSamplerYcbcrRange ycbcrRange;
 *     {@link VkComponentMapping VkComponentMapping} components;
 *     VkChromaLocation xChromaOffset;
 *     VkChromaLocation yChromaOffset;
 *     VkFilter chromaFilter;
 *     VkBool32 forceExplicitReconstruction;
 * }

 */
public class VkSamplerYcbcrConversionCreateInfoKHR extends VkSamplerYcbcrConversionCreateInfo {

    /**
     * Creates a {@code VkSamplerYcbcrConversionCreateInfoKHR} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
     * visible to the struct instance and vice versa.
     *
     *
The created instance holds a strong reference to the container object.

     */
    public VkSamplerYcbcrConversionCreateInfoKHR(ByteBuffer container) {
        super(container);
    }

    /** Sets the specified value to the {@code sType} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR sType(@NativeType("VkStructureType") int value) { nsType(address(), value); return this; }
    /** Sets the {@link VK11#VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO} value to the {@code sType} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR sType$Default() { return sType(VK11.VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO); }
    /** Sets the specified value to the {@code pNext} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR pNext(@NativeType("void const *") long value) { npNext(address(), value); return this; }
    /** Sets the specified value to the {@code format} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR format(@NativeType("VkFormat") int value) { nformat(address(), value); return this; }
    /** Sets the specified value to the {@code ycbcrModel} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR ycbcrModel(@NativeType("VkSamplerYcbcrModelConversion") int value) { nycbcrModel(address(), value); return this; }
    /** Sets the specified value to the {@code ycbcrRange} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR ycbcrRange(@NativeType("VkSamplerYcbcrRange") int value) { nycbcrRange(address(), value); return this; }
    /** Copies the specified {@link VkComponentMapping} to the {@code components} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR components(VkComponentMapping value) { ncomponents(address(), value); return this; }
    /** Passes the {@code components} field to the specified {@link java.util.function.Consumer Consumer}. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR components(java.util.function.Consumer<VkComponentMapping> consumer) { consumer.accept(components()); return this; }
    /** Sets the specified value to the {@code xChromaOffset} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR xChromaOffset(@NativeType("VkChromaLocation") int value) { nxChromaOffset(address(), value); return this; }
    /** Sets the specified value to the {@code yChromaOffset} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR yChromaOffset(@NativeType("VkChromaLocation") int value) { nyChromaOffset(address(), value); return this; }
    /** Sets the specified value to the {@code chromaFilter} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR chromaFilter(@NativeType("VkFilter") int value) { nchromaFilter(address(), value); return this; }
    /** Sets the specified value to the {@code forceExplicitReconstruction} field. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR forceExplicitReconstruction(@NativeType("VkBool32") boolean value) { nforceExplicitReconstruction(address(), value ? 1 : 0); return this; }

    /** Initializes this struct with the specified values. */
    @Override
    public VkSamplerYcbcrConversionCreateInfoKHR set(
        int sType,
        long pNext,
        int format,
        int ycbcrModel,
        int ycbcrRange,
        VkComponentMapping components,
        int xChromaOffset,
        int yChromaOffset,
        int chromaFilter,
        boolean forceExplicitReconstruction
    ) {
        sType(sType);
        pNext(pNext);
        format(format);
        ycbcrModel(ycbcrModel);
        ycbcrRange(ycbcrRange);
        components(components);
        xChromaOffset(xChromaOffset);
        yChromaOffset(yChromaOffset);
        chromaFilter(chromaFilter);
        forceExplicitReconstruction(forceExplicitReconstruction);

        return this;
    }

    /**
     * Copies the specified struct data to this struct.
     *
     * @param src the source struct
     *
     * @return this struct
     */
    public VkSamplerYcbcrConversionCreateInfoKHR set(VkSamplerYcbcrConversionCreateInfoKHR src) {
        memCopy(src.address(), address(), SIZEOF);
        return this;
    }

    // -----------------------------------

    /** Returns a new {@code VkSamplerYcbcrConversionCreateInfoKHR} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
    public static VkSamplerYcbcrConversionCreateInfoKHR malloc() {
        return wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, nmemAllocChecked(SIZEOF));
    }

    /** Returns a new {@code VkSamplerYcbcrConversionCreateInfoKHR} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
    public static VkSamplerYcbcrConversionCreateInfoKHR calloc() {
        return wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, nmemCallocChecked(1, SIZEOF));
    }

    /** Returns a new {@code VkSamplerYcbcrConversionCreateInfoKHR} instance allocated with {@link BufferUtils}. */
    public static VkSamplerYcbcrConversionCreateInfoKHR create() {
        ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
        return wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, memAddress(container), container);
    }

    /** Returns a new {@code VkSamplerYcbcrConversionCreateInfoKHR} instance for the specified memory address. */
    public static VkSamplerYcbcrConversionCreateInfoKHR create(long address) {
        return wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, address);
    }

    /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static VkSamplerYcbcrConversionCreateInfoKHR createSafe(long address) {
        return address == NULL ? null : wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, address);
    }

    /**
     * Returns a new {@link VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer malloc(int capacity) {
        return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
    }

    /**
     * Returns a new {@link VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer calloc(int capacity) {
        return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity);
    }

    /**
     * Returns a new {@link VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance allocated with {@link BufferUtils}.
     *
     * @param capacity the buffer capacity
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer create(int capacity) {
        ByteBuffer container = __create(capacity, SIZEOF);
        return wrap(Buffer.class, memAddress(container), capacity, container);
    }

    /**
     * Create a {@link VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance at the specified memory.
     *
     * @param address  the memory address
     * @param capacity the buffer capacity
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer create(long address, int capacity) {
        return wrap(Buffer.class, address, capacity);
    }

    /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer createSafe(long address, int capacity) {
        return address == NULL ? null : wrap(Buffer.class, address, capacity);
    }

    // -----------------------------------

    /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR mallocStack() { return malloc(stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR callocStack() { return calloc(stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR mallocStack(MemoryStack stack) { return malloc(stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR callocStack(MemoryStack stack) { return calloc(stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer mallocStack(int capacity) { return malloc(capacity, stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer callocStack(int capacity) { return calloc(capacity, stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer mallocStack(int capacity, MemoryStack stack) { return malloc(capacity, stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */
    @Deprecated public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer callocStack(int capacity, MemoryStack stack) { return calloc(capacity, stack); }

    /**
     * Returns a new {@code VkSamplerYcbcrConversionCreateInfoKHR} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack the stack from which to allocate
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR malloc(MemoryStack stack) {
        return wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, stack.nmalloc(ALIGNOF, SIZEOF));
    }

    /**
     * Returns a new {@code VkSamplerYcbcrConversionCreateInfoKHR} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack the stack from which to allocate
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR calloc(MemoryStack stack) {
        return wrap(VkSamplerYcbcrConversionCreateInfoKHR.class, stack.ncalloc(ALIGNOF, 1, SIZEOF));
    }

    /**
     * Returns a new {@link VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack    the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer malloc(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
    }

    /**
     * Returns a new {@link VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack    the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static VkSamplerYcbcrConversionCreateInfoKHR.Buffer calloc(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
    }

    // -----------------------------------

    /** An array of {@link VkSamplerYcbcrConversionCreateInfoKHR} structs. */
    public static class Buffer extends VkSamplerYcbcrConversionCreateInfo.Buffer {

        private static final VkSamplerYcbcrConversionCreateInfoKHR ELEMENT_FACTORY = VkSamplerYcbcrConversionCreateInfoKHR.create(-1L);

        /**
         * Creates a new {@code VkSamplerYcbcrConversionCreateInfoKHR.Buffer} instance backed by the specified container.
         *
         * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
         * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
         * by {@link VkSamplerYcbcrConversionCreateInfoKHR#SIZEOF}, and its mark will be undefined.
         *
         *
The created buffer instance holds a strong reference to the container object.

         */
        public Buffer(ByteBuffer container) {
            super(container);
        }

        public Buffer(long address, int cap) {
            super(address, null, -1, 0, cap, cap);
        }

        Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
            super(address, container, mark, pos, lim, cap);
        }

        @Override
        protected Buffer self() {
            return this;
        }

        @Override
        protected VkSamplerYcbcrConversionCreateInfoKHR getElementFactory() {
            return ELEMENT_FACTORY;
        }

        /** Sets the specified value to the {@code sType} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer sType(@NativeType("VkStructureType") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nsType(address(), value); return this; }
        /** Sets the {@link VK11#VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO} value to the {@code sType} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer sType$Default() { return sType(VK11.VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO); }
        /** Sets the specified value to the {@code pNext} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer pNext(@NativeType("void const *") long value) { VkSamplerYcbcrConversionCreateInfoKHR.npNext(address(), value); return this; }
        /** Sets the specified value to the {@code format} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer format(@NativeType("VkFormat") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nformat(address(), value); return this; }
        /** Sets the specified value to the {@code ycbcrModel} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer ycbcrModel(@NativeType("VkSamplerYcbcrModelConversion") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nycbcrModel(address(), value); return this; }
        /** Sets the specified value to the {@code ycbcrRange} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer ycbcrRange(@NativeType("VkSamplerYcbcrRange") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nycbcrRange(address(), value); return this; }
        /** Copies the specified {@link VkComponentMapping} to the {@code components} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer components(VkComponentMapping value) { VkSamplerYcbcrConversionCreateInfoKHR.ncomponents(address(), value); return this; }
        /** Passes the {@code components} field to the specified {@link java.util.function.Consumer Consumer}. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer components(java.util.function.Consumer<VkComponentMapping> consumer) { consumer.accept(components()); return this; }
        /** Sets the specified value to the {@code xChromaOffset} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer xChromaOffset(@NativeType("VkChromaLocation") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nxChromaOffset(address(), value); return this; }
        /** Sets the specified value to the {@code yChromaOffset} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer yChromaOffset(@NativeType("VkChromaLocation") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nyChromaOffset(address(), value); return this; }
        /** Sets the specified value to the {@code chromaFilter} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer chromaFilter(@NativeType("VkFilter") int value) { VkSamplerYcbcrConversionCreateInfoKHR.nchromaFilter(address(), value); return this; }
        /** Sets the specified value to the {@code forceExplicitReconstruction} field. */
        @Override
        public VkSamplerYcbcrConversionCreateInfoKHR.Buffer forceExplicitReconstruction(@NativeType("VkBool32") boolean value) { VkSamplerYcbcrConversionCreateInfoKHR.nforceExplicitReconstruction(address(), value ? 1 : 0); return this; }

    }

}


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Xml;

namespace FlickrNet
{
    public partial class Flickr
    {
        /// <summary>
        /// Gets the currently authenticated users default content type.
        /// </summary>
        /// <returns></returns>
        public ContentType PrefsGetContentType()
        {
            CheckRequiresAuthentication();

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("method", "flickr.prefs.getContentType");

            UnknownResponse response = GetResponseCache<UnknownResponse>(parameters);

            System.Xml.XmlNode nav = response.GetXmlDocument().SelectSingleNode("*/@content_type");
            if (nav == null)
                throw new ParsingException("Unable to find content type preference in returned XML.");

            return (ContentType)int.Parse(nav.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
        }

        /// <summary>
        /// Returns the default privacy level for geographic information attached to the user's photos and whether or not the user has chosen to use geo-related EXIF information to automatically geotag their photos.
        /// </summary>
        public UserGeoPermissions PrefsGetGeoPerms()
        {
            CheckRequiresAuthentication();

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("method", "flickr.prefs.getGeoPerms");

            return GetResponseCache<UserGeoPermissions>(parameters);
        }

        /// <summary>
        /// Gets the currently authenticated users default hidden from search setting.
        /// </summary>
        /// <returns></returns>
        public HiddenFromSearch PrefsGetHidden()
        {
            CheckRequiresAuthentication();

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("method", "flickr.prefs.getHidden");

            UnknownResponse response = GetResponseCache<UnknownResponse>(parameters);

            System.Xml.XmlNode nav = response.GetXmlDocument().SelectSingleNode("*/@hidden");
            if (nav == null)
                throw new ParsingException("Unable to find hidden preference in returned XML.");

            return (HiddenFromSearch)int.Parse(nav.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
        }

        /// <summary>
        /// Returns the default privacy level preference for the user.
        /// </summary>
        /// <returns></returns>
        public PrivacyFilter PrefsGetPrivacy()
        {
            CheckRequiresAuthentication();

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("method", "flickr.prefs.getPrivacy");

            UnknownResponse response = GetResponseCache<UnknownResponse>(parameters);

            System.Xml.XmlNode nav = response.GetXmlDocument().SelectSingleNode("*/@privacy");
            if (nav == null)
                throw new ParsingException("Unable to find safety level in returned XML.");

            return (PrivacyFilter)int.Parse(nav.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
        }

        /// <summary>
        /// Gets the currently authenticated users default safety level.
        /// </summary>
        /// <returns></returns>
        public SafetyLevel PrefsGetSafetyLevel()
        {
            CheckRequiresAuthentication();

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("method", "flickr.prefs.getSafetyLevel");

            UnknownResponse response = GetResponseCache<UnknownResponse>(parameters);

            System.Xml.XmlNode nav = response.GetXmlDocument().SelectSingleNode("*/@safety_level");
            if (nav == null)
                throw new ParsingException("Unable to find safety level in returned XML.");

            return (SafetyLevel)int.Parse(nav.Value, System.Globalization.NumberFormatInfo.InvariantInfo);
        }

    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context="com.jimulabs.samples.timely.MainActivity">
    <item
            android:id="@+id/add_alarm"
            android:title="Add alarm"
            android:icon="@drawable/ic_menu_add_alarm"
            android:orderInCategory="100"
            android:showAsAction="always|withText"/>
    <item
            android:id="@+id/refresh"
            android:title="Refresh"
            android:orderInCategory="100"
            android:showAsAction="never"/>
    <item
            android:id="@+id/change_themes"
            android:title="Change themes"
            android:orderInCategory="100"
            android:showAsAction="never"/>
    <item
            android:id="@+id/action_settings"
            android:title="@string/action_settings"
            android:orderInCategory="100"
            android:showAsAction="never"/>
</menu>


text:
using System;
using System.Collections.Generic;
using System.Net;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using ShareFile.Api.Client.Extensions;
using ShareFile.Api.Client.Exceptions;

namespace ShareFile.Api.Client.Models
{
	public class ItemInfo : ODataObject
	{
		public AccessControl CurrentAccessControl { get; set; }
		public bool? HasVroot { get; set; }
		public bool? IsSystemRoot { get; set; }
		public bool? IsAccountRoot { get; set; }
		public bool? IsVRoot { get; set; }
		public bool? IsMyFolders { get; set; }
		public bool? IsAHomeFolder { get; set; }
		public bool? IsMyHomeFolder { get; set; }
		public bool? IsAStartFolder { get; set; }
		public bool? IsSharedFolder { get; set; }
		public bool? IsPassthrough { get; set; }
		public bool? IsVersioned { get; set; }
		public bool? CanAddFolder { get; set; }
		public bool? CanAddNode { get; set; }
		public bool? CanView { get; set; }
		public bool? CanDownload { get; set; }
		public bool? CanWatermarkDownload { get; set; }
		public bool? CanDocViewerPrint { get; set; }
		public bool? CanUpload { get; set; }
		public bool? CanSend { get; set; }
		public bool? CanDeleteCurrentItem { get; set; }
		public bool? CanDeleteChildItems { get; set; }
		public bool? CanManagePermissions { get; set; }
		public bool? CanEditFolderOpts { get; set; }
		/// <summary>
		/// Indicates whether the current user has permission to change folder retention policies (ExpirationDays)
		/// </summary>
		public bool? CanEditRetentionPolicy { get; set; }
		public bool? CanEditFolderExpirationDays { get; set; }
		public bool? CanEditFolderExpirationDate { get; set; }
		public bool? CanEditFolderMaxVersions { get; set; }
		public bool? CanEditFolderVersioning { get; set; }
		public bool? CanCreateOfficeDocuments { get; set; }
		public string FolderPayID { get; set; }
		public bool? ShowFolderPayBuyButton { get; set; }
		public SafeEnum<TreeMode> TreeMode { get; set; }
		public SafeEnum<Versioning> Versioning { get; set; }
		public bool? TreeModeOperationAllowed { get; set; }
		public string TreeModeSourceId { get; set; }
		public SafeEnum<SortField> ForcedSortField { get; set; }
		public SafeEnum<SortDirection> ForcedSortOrder { get; set; }
		public int? MaxVersions { get; set; }
		public SafeEnum<DocumentViewerPrinting> DocumentViewerPrinting { get; set; }
		public SafeEnum<WatermarkedDownloads> WatermarkedDownloads { get; set; }
		public IEnumerable<SafeEnum<FolderOption>> OptionPropagation { get; set; }
		public string ViewOnlyWatermarkText { get; set; }
		public SafeEnum<SortField> SortField { get; set; }
		public SafeEnum<SortDirection> SortDirection { get; set; }
		/// <summary>
		/// Info on a folder to create a request list bundle
		/// </summary>
		public bool? CanCreateRequestList { get; set; }

		public override void Copy(ODataObject source, JsonSerializer serializer)
		{
			if(source == null || serializer == null) return;
			base.Copy(source, serializer);

			var typedSource = source as ItemInfo;
			if(typedSource != null)
			{
				CurrentAccessControl = typedSource.CurrentAccessControl;
				HasVroot = typedSource.HasVroot;
				IsSystemRoot = typedSource.IsSystemRoot;
				IsAccountRoot = typedSource.IsAccountRoot;
				IsVRoot = typedSource.IsVRoot;
				IsMyFolders = typedSource.IsMyFolders;
				IsAHomeFolder = typedSource.IsAHomeFolder;
				IsMyHomeFolder = typedSource.IsMyHomeFolder;
				IsAStartFolder = typedSource.IsAStartFolder;
				IsSharedFolder = typedSource.IsSharedFolder;
				IsPassthrough = typedSource.IsPassthrough;
				IsVersioned = typedSource.IsVersioned;
				CanAddFolder = typedSource.CanAddFolder;
				CanAddNode = typedSource.CanAddNode;
				CanView = typedSource.CanView;
				CanDownload = typedSource.CanDownload;
				CanWatermarkDownload = typedSource.CanWatermarkDownload;
				CanDocViewerPrint = typedSource.CanDocViewerPrint;
				CanUpload = typedSource.CanUpload;
				CanSend = typedSource.CanSend;
				CanDeleteCurrentItem = typedSource.CanDeleteCurrentItem;
				CanDeleteChildItems = typedSource.CanDeleteChildItems;
				CanManagePermissions = typedSource.CanManagePermissions;
				CanEditFolderOpts = typedSource.CanEditFolderOpts;
				CanEditRetentionPolicy = typedSource.CanEditRetentionPolicy;
				CanEditFolderExpirationDays = typedSource.CanEditFolderExpirationDays;
				CanEditFolderExpirationDate = typedSource.CanEditFolderExpirationDate;
				CanEditFolderMaxVersions = typedSource.CanEditFolderMaxVersions;
				CanEditFolderVersioning = typedSource.CanEditFolderVersioning;
				CanCreateOfficeDocuments = typedSource.CanCreateOfficeDocuments;
				FolderPayID = typedSource.FolderPayID;
				ShowFolderPayBuyButton = typedSource.ShowFolderPayBuyButton;
				TreeMode = typedSource.TreeMode;
				Versioning = typedSource.Versioning;
				TreeModeOperationAllowed = typedSource.TreeModeOperationAllowed;
				TreeModeSourceId = typedSource.TreeModeSourceId;
				ForcedSortField = typedSource.ForcedSortField;
				ForcedSortOrder = typedSource.ForcedSortOrder;
				MaxVersions = typedSource.MaxVersions;
				DocumentViewerPrinting = typedSource.DocumentViewerPrinting;
				WatermarkedDownloads = typedSource.WatermarkedDownloads;
				OptionPropagation = typedSource.OptionPropagation;
				ViewOnlyWatermarkText = typedSource.ViewOnlyWatermarkText;
				SortField = typedSource.SortField;
				SortDirection = typedSource.SortDirection;
				CanCreateRequestList = typedSource.CanCreateRequestList;
			}
			else
			{
				JToken token;
				if(source.TryGetProperty("CurrentAccessControl", out token) && token.Type != JTokenType.Null)
				{
					CurrentAccessControl = (AccessControl)serializer.Deserialize(token.CreateReader(), typeof(AccessControl));
				}
				if(source.TryGetProperty("HasVroot", out token) && token.Type != JTokenType.Null)
				{
					HasVroot = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsSystemRoot", out token) && token.Type != JTokenType.Null)
				{
					IsSystemRoot = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsAccountRoot", out token) && token.Type != JTokenType.Null)
				{
					IsAccountRoot = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsVRoot", out token) && token.Type != JTokenType.Null)
				{
					IsVRoot = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsMyFolders", out token) && token.Type != JTokenType.Null)
				{
					IsMyFolders = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsAHomeFolder", out token) && token.Type != JTokenType.Null)
				{
					IsAHomeFolder = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsMyHomeFolder", out token) && token.Type != JTokenType.Null)
				{
					IsMyHomeFolder = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsAStartFolder", out token) && token.Type != JTokenType.Null)
				{
					IsAStartFolder = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsSharedFolder", out token) && token.Type != JTokenType.Null)
				{
					IsSharedFolder = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsPassthrough", out token) && token.Type != JTokenType.Null)
				{
					IsPassthrough = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("IsVersioned", out token) && token.Type != JTokenType.Null)
				{
					IsVersioned = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanAddFolder", out token) && token.Type != JTokenType.Null)
				{
					CanAddFolder = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanAddNode", out token) && token.Type != JTokenType.Null)
				{
					CanAddNode = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanView", out token) && token.Type != JTokenType.Null)
				{
					CanView = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanDownload", out token) && token.Type != JTokenType.Null)
				{
					CanDownload = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanWatermarkDownload", out token) && token.Type != JTokenType.Null)
				{
					CanWatermarkDownload = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanDocViewerPrint", out token) && token.Type != JTokenType.Null)
				{
					CanDocViewerPrint = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanUpload", out token) && token.Type != JTokenType.Null)
				{
					CanUpload = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanSend", out token) && token.Type != JTokenType.Null)
				{
					CanSend = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanDeleteCurrentItem", out token) && token.Type != JTokenType.Null)
				{
					CanDeleteCurrentItem = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanDeleteChildItems", out token) && token.Type != JTokenType.Null)
				{
					CanDeleteChildItems = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanManagePermissions", out token) && token.Type != JTokenType.Null)
				{
					CanManagePermissions = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanEditFolderOpts", out token) && token.Type != JTokenType.Null)
				{
					CanEditFolderOpts = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanEditRetentionPolicy", out token) && token.Type != JTokenType.Null)
				{
					CanEditRetentionPolicy = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanEditFolderExpirationDays", out token) && token.Type != JTokenType.Null)
				{
					CanEditFolderExpirationDays = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanEditFolderExpirationDate", out token) && token.Type != JTokenType.Null)
				{
					CanEditFolderExpirationDate = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanEditFolderMaxVersions", out token) && token.Type != JTokenType.Null)
				{
					CanEditFolderMaxVersions = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanEditFolderVersioning", out token) && token.Type != JTokenType.Null)
				{
					CanEditFolderVersioning = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("CanCreateOfficeDocuments", out token) && token.Type != JTokenType.Null)
				{
					CanCreateOfficeDocuments = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("FolderPayID", out token) && token.Type != JTokenType.Null)
				{
					FolderPayID = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("ShowFolderPayBuyButton", out token) && token.Type != JTokenType.Null)
				{
					ShowFolderPayBuyButton = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("TreeMode", out token) && token.Type != JTokenType.Null)
				{
					TreeMode = (SafeEnum<TreeMode>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<TreeMode>));
				}
				if(source.TryGetProperty("Versioning", out token) && token.Type != JTokenType.Null)
				{
					Versioning = (SafeEnum<Versioning>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<Versioning>));
				}
				if(source.TryGetProperty("TreeModeOperationAllowed", out token) && token.Type != JTokenType.Null)
				{
					TreeModeOperationAllowed = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
				if(source.TryGetProperty("TreeModeSourceId", out token) && token.Type != JTokenType.Null)
				{
					TreeModeSourceId = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("ForcedSortField", out token) && token.Type != JTokenType.Null)
				{
					ForcedSortField = (SafeEnum<SortField>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<SortField>));
				}
				if(source.TryGetProperty("ForcedSortOrder", out token) && token.Type != JTokenType.Null)
				{
					ForcedSortOrder = (SafeEnum<SortDirection>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<SortDirection>));
				}
				if(source.TryGetProperty("MaxVersions", out token) && token.Type != JTokenType.Null)
				{
					MaxVersions = (int?)serializer.Deserialize(token.CreateReader(), typeof(int?));
				}
				if(source.TryGetProperty("DocumentViewerPrinting", out token) && token.Type != JTokenType.Null)
				{
					DocumentViewerPrinting = (SafeEnum<DocumentViewerPrinting>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<DocumentViewerPrinting>));
				}
				if(source.TryGetProperty("WatermarkedDownloads", out token) && token.Type != JTokenType.Null)
				{
					WatermarkedDownloads = (SafeEnum<WatermarkedDownloads>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<WatermarkedDownloads>));
				}
				if(source.TryGetProperty("OptionPropagation", out token) && token.Type != JTokenType.Null)
				{
					OptionPropagation = (IEnumerable<SafeEnum<FolderOption>>)serializer.Deserialize(token.CreateReader(), typeof(IEnumerable<SafeEnum<FolderOption>>));
				}
				if(source.TryGetProperty("ViewOnlyWatermarkText", out token) && token.Type != JTokenType.Null)
				{
					ViewOnlyWatermarkText = (string)serializer.Deserialize(token.CreateReader(), typeof(string));
				}
				if(source.TryGetProperty("SortField", out token) && token.Type != JTokenType.Null)
				{
					SortField = (SafeEnum<SortField>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<SortField>));
				}
				if(source.TryGetProperty("SortDirection", out token) && token.Type != JTokenType.Null)
				{
					SortDirection = (SafeEnum<SortDirection>)serializer.Deserialize(token.CreateReader(), typeof(SafeEnum<SortDirection>));
				}
				if(source.TryGetProperty("CanCreateRequestList", out token) && token.Type != JTokenType.Null)
				{
					CanCreateRequestList = (bool?)serializer.Deserialize(token.CreateReader(), typeof(bool?));
				}
			}
		}
	}
}


text:
package main

import repo "github.com/unexistent/repository"

func main(){
    repo.WhoAmI()
}


text:
<?php
namespace AppBundle\Twig;

use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

class AppExtension extends AbstractExtension
{
}


text:
package io.descoped.container.module;

import io.descoped.container.module.factory.DefaultInstanceFactory;
import io.descoped.container.module.factory.InstanceHandler;

/**
 * Created by oranheim on 27/01/2017.
 */
public interface DescopedPrimitive {

    void init();

    void start();

    void stop();

    void destroy();

    default boolean isRunning() {
        return isRunning(this);
    }

    static boolean isRunning(DescopedPrimitive descopedPrimitive) {
        InstanceHandler<? extends DescopedPrimitive> instance = DefaultInstanceFactory.findInstance(descopedPrimitive.getClass());
        try {
            return (instance != null ? instance.isRunning() : false);
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

}


text:
set -e

absolute_filename() {
  typeset file="$1"
  typeset dir=$(cd "$(dirname "$file")" && pwd)
  typeset basename=${file##*/}
  echo "$dir/$basename"
}

create_migration_script() {
  typeset output_file="$1"
  typeset f
  typeset basename_f
  typeset absolute_f

  exec 6>$output_file

  # Load library

  f=lib/lib.js
  basename_f=${f##*/}
  absolute_f=$(absolute_filename "$f")

  echo '// Loading library' >&6
  echo 'load("'"$absolute_f"'");' >&6
  echo >&6

  # Load migration scripts

  find migrations -type f -name '*.js' | sort | while read f; do
    basename_f=${f##*/}
    absolute_f=$(absolute_filename "$f")

    echo "// Loading migration $basename_f" >&6
    echo "migrationContext.filename = '$basename_f';" >&6
    echo 'load("'"$absolute_f"'");' >&6
    echo >&6
  done

  exec 6>&-
}

echo 'Build the migration file...'

temp_dir=${TMPDIR:-${TEMP:-${TMP}}}
concat_filename="$temp_dir/mongo-migration-$$.js"

create_migration_script $concat_filename

echo

# No argument : show the generated file
if [[ "$#" -eq 0 ]]; then
  echo 'Generated migration file:'
  echo
  cat $concat_filename
  exit
fi

# Run mongo command with input arguments
echo 'Running Mongo command...'
mongo $@ $concat_filename


text:
package apple.usernotifications;

import apple.NSObject;
import apple.foundation.NSArray;
import apple.foundation.NSCoder;
import apple.foundation.NSDictionary;
import apple.foundation.NSError;
import apple.foundation.NSMethodSignature;
import apple.foundation.NSSet;
import apple.foundation.NSURL;
import apple.foundation.protocol.NSCopying;
import apple.foundation.protocol.NSSecureCoding;
import org.moe.natj.c.ann.FunctionPtr;
import org.moe.natj.general.NatJ;
import org.moe.natj.general.Pointer;
import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.Library;
import org.moe.natj.general.ann.Mapped;
import org.moe.natj.general.ann.MappedReturn;
import org.moe.natj.general.ann.NInt;
import org.moe.natj.general.ann.NUInt;
import org.moe.natj.general.ann.Owned;
import org.moe.natj.general.ann.ReferenceInfo;
import org.moe.natj.general.ann.Runtime;
import org.moe.natj.general.ptr.Ptr;
import org.moe.natj.general.ptr.VoidPtr;
import org.moe.natj.objc.Class;
import org.moe.natj.objc.ObjCRuntime;
import org.moe.natj.objc.SEL;
import org.moe.natj.objc.ann.ObjCClassBinding;
import org.moe.natj.objc.ann.ProtocolClassMethod;
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.map.ObjCObjectMapper;

@Generated
@Library("UserNotifications")
@Runtime(ObjCRuntime.class)
@ObjCClassBinding
public class UNNotificationAttachment extends NSObject implements NSCopying, NSSecureCoding {
    static {
        NatJ.register();
    }

    @Generated
    protected UNNotificationAttachment(Pointer peer) {
        super(peer);
    }

    @Generated
    @Selector("accessInstanceVariablesDirectly")
    public static native boolean accessInstanceVariablesDirectly();

    @Generated
    @Owned
    @Selector("alloc")
    public static native UNNotificationAttachment alloc();

    @Owned
    @Generated
    @Selector("allocWithZone:")
    public static native UNNotificationAttachment allocWithZone(VoidPtr zone);

    /**
     * Creates an attachment for the data at URL with an optional options dictionary. URL must be a file URL. Returns
     * nil if the data at URL is not supported.
     */
    @Generated
    @Selector("attachmentWithIdentifier:URL:options:error:")
    public static native UNNotificationAttachment attachmentWithIdentifierURLOptionsError(String identifier, NSURL URL,
            NSDictionary<?, ?> options, @ReferenceInfo(type = NSError.class) Ptr<NSError> error);

    @Generated
    @Selector("automaticallyNotifiesObserversForKey:")
    public static native boolean automaticallyNotifiesObserversForKey(String key);

    @Generated
    @Selector("cancelPreviousPerformRequestsWithTarget:")
    public static native void cancelPreviousPerformRequestsWithTarget(@Mapped(ObjCObjectMapper.class) Object aTarget);

    @Generated
    @Selector("cancelPreviousPerformRequestsWithTarget:selector:object:")
    public static native void cancelPreviousPerformRequestsWithTargetSelectorObject(
            @Mapped(ObjCObjectMapper.class) Object aTarget, SEL aSelector,
            @Mapped(ObjCObjectMapper.class) Object anArgument);

    @Generated
    @Selector("classFallbacksForKeyedArchiver")
    public static native NSArray<String> classFallbacksForKeyedArchiver();

    @Generated
    @Selector("classForKeyedUnarchiver")
    public static native Class classForKeyedUnarchiver();

    @Generated
    @Selector("debugDescription")
    public static native String debugDescription_static();

    @Generated
    @Selector("description")
    public static native String description_static();

    @Generated
    @Selector("hash")
    @NUInt
    public static native long hash_static();

    @Generated
    @Selector("instanceMethodForSelector:")
    @FunctionPtr(name = "call_instanceMethodForSelector_ret")
    public static native NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(SEL aSelector);

    @Generated
    @Selector("instanceMethodSignatureForSelector:")
    public static native NSMethodSignature instanceMethodSignatureForSelector(SEL aSelector);

    @Generated
    @Selector("instancesRespondToSelector:")
    public static native boolean instancesRespondToSelector(SEL aSelector);

    @Generated
    @Selector("isSubclassOfClass:")
    public static native boolean isSubclassOfClass(Class aClass);

    @Generated
    @Selector("keyPathsForValuesAffectingValueForKey:")
    public static native NSSet<String> keyPathsForValuesAffectingValueForKey(String key);

    @Generated
    @Owned
    @Selector("new")
    public static native UNNotificationAttachment new_objc();

    @Generated
    @Selector("resolveClassMethod:")
    public static native boolean resolveClassMethod(SEL sel);

    @Generated
    @Selector("resolveInstanceMethod:")
    public static native boolean resolveInstanceMethod(SEL sel);

    @Generated
    @Selector("setVersion:")
    public static native void setVersion_static(@NInt long aVersion);

    @Generated
    @Selector("superclass")
    public static native Class superclass_static();

    @Generated
    @Selector("supportsSecureCoding")
    public static native boolean supportsSecureCoding();

    @Generated
    @Selector("version")
    @NInt
    public static native long version_static();

    /**
     * The URL to the attachment's data. If you have obtained this attachment from UNUserNotificationCenter then the URL
     * will be security-scoped.
     */
    @Generated
    @Selector("URL")
    public native NSURL URL();

    @Generated
    @Owned
    @Selector("copyWithZone:")
    @MappedReturn(ObjCObjectMapper.class)
    public native Object copyWithZone(VoidPtr zone);

    @Generated
    @Selector("encodeWithCoder:")
    public native void encodeWithCoder(NSCoder coder);

    /**
     * The identifier of this attachment
     */
    @Generated
    @Selector("identifier")
    public native String identifier();

    @Generated
    @Selector("init")
    public native UNNotificationAttachment init();

    @Generated
    @Selector("initWithCoder:")
    public native UNNotificationAttachment initWithCoder(NSCoder coder);

    @Generated
    @ProtocolClassMethod("supportsSecureCoding")
    public boolean _supportsSecureCoding() {
        return supportsSecureCoding();
    }

    /**
     * The UTI of the attachment.
     */
    @Generated
    @Selector("type")
    public native String type();
}


text:
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))

describe RTurk::ApproveRejectedAssignment do

  before(:all) do
    aws = YAML.load(File.open(File.join(SPEC_ROOT, 'mturk.yml')))
    RTurk.setup(aws['AWSAccessKeyId'], aws['AWSAccessKey'], :sandbox => true)
    faker('approve_rejected_assignment', :operation => 'ApproveRejectedAssignment')
  end

  it "should ensure required params" do
    lambda{RTurk::ApproveRejectedAssignment()}.should raise_error RTurk::MissingParameters
  end

  it "should successfully request the operation" do
    RTurk::Requester.should_receive(:request).once.with(
      hash_including('Operation' => 'ApproveRejectedAssignment'))
    RTurk::ApproveRejectedAssignment(:assignment_id => "123456789") rescue RTurk::InvalidRequest
  end

  it "should parse and return the result" do
    RTurk::ApproveRejectedAssignment(:assignment_id => "123456789").elements.should eql(
      {"ApproveRejectedAssignmentResult"=>{"Request"=>{"IsValid"=>"True"}}}
    )
  end

end


text:
require 'shutterstock/api/util'
require 'shutterstock/api/images'
require 'shutterstock/api/subscriptions'
require 'shutterstock/api/auth'

module Shutterstock
  class Client
    include Shutterstock::Configurable
    include Shutterstock::API::Images
    include Shutterstock::API::Subscriptions
    include Shutterstock::API::Auth

    def initialize(options={})
      Shutterstock::Configurable.keys.each do |key|
        instance_variable_set(:"@#{key}", options[key] || Shutterstock.instance_variable_get(:"@#{key}"))
      end
    end

  end
end


text:
namespace Wexflow.Server.Contracts
{
    public class Version
    {
        public string Id { get; set; }
        public string FilePath { get; set; }
        public string FileName { get; set; }
        public string FileSize { get; set; }
        public string RecordId { get; set; }
        public string CreatedOn { get; set; }
    }
}


text:
namespace mx
{
    namespace core
    {

        MX_FORWARD_DECLARE_ATTRIBUTES( TiedAttributes )
        MX_FORWARD_DECLARE_ELEMENT( Tied )

        inline TiedPtr makeTied() { return std::make_shared<Tied>(); }

        class Tied : public ElementInterface
        {
        public:
            Tied();

            virtual bool hasAttributes() const;
            virtual bool hasContents() const;
            virtual std::ostream& streamAttributes( std::ostream& os ) const;
            virtual std::ostream& streamName( std::ostream& os ) const;
            virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const;
            TiedAttributesPtr getAttributes() const;
            void setAttributes( const TiedAttributesPtr& attributes );

            private:
            virtual bool fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement );

        private:
            TiedAttributesPtr myAttributes;
        };
    }
}


text:
/**
 * Nereo
 *
 * Glue together the logic and API calls.
 */

import moment from "moment";

import { getTimedAccounts, getLeaveRequests, getBalances } from "./nereo-api";
import {
  computePrimaryTimedAccounts,
  computeBalancesForPrimayTimedAccounts
} from "./nereo-service";
import { getFirstDayOfMonth, getLastDayOfMonth } from "./utils";

export const getPrimaryTimedAccountsBalances = date => {
  if (date === undefined) {
    date = moment();
  } else if (!moment(date).isValid()) {
    throw new Error("Invalid date");
  } else {
    date = moment(date);
  }
  return new Promise((resolve, reject) => {
    Promise.all([getTimedAccounts(), getLeaveRequests(date), getBalances(date)])
      .then(([timedAccountsResults, leaveRequestsResults, balancesResults]) => {
        const timedAccounts = timedAccountsResults.data.results;
        const leaveRequests = leaveRequestsResults.data.results;
        const balances = balancesResults.data.balance_user_accounts;
        const primaryTimedAccounts = computePrimaryTimedAccounts(
          timedAccounts,
          leaveRequests,
          date
        );
        const primaryTimedAccountsBalances = computeBalancesForPrimayTimedAccounts(
          primaryTimedAccounts,
          balances,
          date
        );
        resolve(primaryTimedAccountsBalances);
      })
      .catch(error => {
        console.log(error);
        reject(new Error(error));
      });
  });
};


text:
RNG::RNG()
    : m_seed( 0 )
    , m_generator( std::default_random_engine() )
    , m_distribution( std::uniform_real_distribution< float >( 0.0, 1.0 ) )
{
    reset();
}

void RNG::setSeed( uint i_seed )
{
    m_seed = i_seed;
    reset();
}

void RNG::reset()
{
    m_generator.seed( m_seed );
}

float RNG::sample1D() const
{
    return m_distribution( m_generator );
}

glm::vec2 RNG::sample2D() const
{
    const float r1 = m_distribution( m_generator );
    const float r2 = m_distribution( m_generator );

    return glm::vec2( r1, r2 );
}

glm::vec3 RNG::sample3D() const
{
    const float r1 = m_distribution( m_generator );
    const float r2 = m_distribution( m_generator );
    const float r3 = m_distribution( m_generator );

    return glm::vec3( r1, r2, r3 );
}


text:
class LocationSerializer < ActiveModel::Serializer
  attributes :va_accepted, :address1, :address2, :city, :state, :zip
end