text:
package com.arm.hackbri.landmoney.view.viewComponent;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.OvershootInterpolator;

import com.arm.hackbri.landmoney.Utils;

public class FeedContextMenuManager extends RecyclerView.OnScrollListener
        implements View.OnAttachStateChangeListener {

    private static FeedContextMenuManager instance;

    private FeedContextMenu contextMenuView;

    private boolean isContextMenuDismissing;
    private boolean isContextMenuShowing;

    public static FeedContextMenuManager getInstance() {
        if (instance == null) {
            instance = new FeedContextMenuManager();
        }
        return instance;
    }

    private FeedContextMenuManager() {

    }

public void toggleContextMenuFromView(View openingView, int feedItem,
                                      FeedContextMenu.OnFeedContextMenuItemClickListener listener) {
    if (contextMenuView == null) {
        showContextMenuFromView(openingView, feedItem, listener);
    } else {
        hideContextMenu();
    }
}

    private void showContextMenuFromView(
            final View openingView,
            int feedItem,
            FeedContextMenu.OnFeedContextMenuItemClickListener listener) {

        if (!isContextMenuShowing) {
            isContextMenuShowing = true;
            contextMenuView = new FeedContextMenu(openingView.getContext());
            contextMenuView.bindToItem(feedItem);
            contextMenuView.addOnAttachStateChangeListener(this);
            contextMenuView.setOnFeedMenuItemClickListener(listener);

            ((ViewGroup) openingView.getRootView().findViewById(android.R.id.content)).addView(contextMenuView);

            contextMenuView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                @Override
                public boolean onPreDraw() {
                    contextMenuView.getViewTreeObserver().removeOnPreDrawListener(this);
                    setupContextMenuInitialPosition(openingView);
                    performShowAnimation();
                    return false;
                }
            });
        }
    }

    private void setupContextMenuInitialPosition(View openingView) {
        final int[] openingViewLocation = new int[2];
        openingView.getLocationOnScreen(openingViewLocation);
        int additionalBottomMargin = Utils.dpToPx(16);
        contextMenuView.setTranslationX(openingViewLocation[0] - contextMenuView.getWidth() / 3);
        contextMenuView.setTranslationY(openingViewLocation[1] - contextMenuView.getHeight() - additionalBottomMargin);
    }

    private void performShowAnimation() {
        contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
        contextMenuView.setPivotY(contextMenuView.getHeight());
        contextMenuView.setScaleX(0.1f);
        contextMenuView.setScaleY(0.1f);
        contextMenuView.animate()
                .scaleX(1f).scaleY(1f)
                .setDuration(150)
                .setInterpolator(new OvershootInterpolator())
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        isContextMenuShowing = false;
                    }
                });
    }

    public void hideContextMenu() {
        if (!isContextMenuDismissing) {
            isContextMenuDismissing = true;
            performDismissAnimation();
        }
    }

    private void performDismissAnimation() {
        contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
        contextMenuView.setPivotY(contextMenuView.getHeight());
        contextMenuView.animate()
                .scaleX(0.1f).scaleY(0.1f)
                .setDuration(150)
                .setInterpolator(new AccelerateInterpolator())
                .setStartDelay(100)
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        if (contextMenuView != null) {
                            contextMenuView.dismiss();
                        }
                        isContextMenuDismissing = false;
                    }
                });
    }

    public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
        if (contextMenuView != null) {
            hideContextMenu();
            contextMenuView.setTranslationY(contextMenuView.getTranslationY() - dy);
        }
    }

    @Override
    public void onViewAttachedToWindow(View v) {

    }

    @Override
    public void onViewDetachedFromWindow(View v) {
        contextMenuView = null;
    }
}


text:
package uk.gov.dvla.services.transform;

import org.junit.Assert;
import org.junit.Test;
import uk.gov.dvla.domain.Address;
import uk.gov.dvla.domain.portal.PortalDTO;

import java.util.Arrays;

public class TestAddressTransformation {
    @Test
    public void testUnstructured() {
        Address address = new Address();
        address.setType("UN");
        address.setuLine(Arrays.asList("123", "White Lane", "Swansea"));
        address.setuPostCode("SA2 8JK");

        PortalDTO.Address result = AddressTransformer.apply(address);
        Assert.assertEquals("address line", "123 White Lane Swansea", result.getAddrLine());
        Assert.assertEquals("post code", "SA2 8JK", result.getPostCode());
    }

    @Test
    public void testStructured() {
        Address address = new Address();
        address.setType("UK");
        address.setSubBuildingName("Flat 6");
        address.setBuildingName("Ocean Towers");
        address.setBuildingNumber("1");
        address.setDtfare("Gorse View");
        address.setTfare("School Road");
        address.setDdLocality("Netherthong");
        address.setPostTown("HUDDERSFIELD");
        address.setPostCode("HD7 2UQ");

        PortalDTO.Address result = AddressTransformer.apply(address);
        Assert.assertEquals("Flat 6 Ocean Towers 1 Gorse View School Road Netherthong HUDDERSFIELD", result.getAddrLine());
        Assert.assertEquals("post code", "HD7 2UQ", result.getPostCode());
    }
}

redpajama_set_name: RedPajamaGithub


text: echo "install jffs2 /bin/true" > /etc/modprobe.d/jffs2.conf


text:
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");

var port = 3001;

module.exports = {
	devtool: '#inline-source-map',
	entry: [
		'eventsource-polyfill', // necessary for hot reloading with IE
		'webpack-dev-server/client?http://0.0.0.0:' + port,
		'webpack/hot/only-dev-server',
		'./src/scripts/index'
	],
	output: {
		filename: 'js/app.js',
		path: path.join(__dirname, 'dist')
	},
	plugins: [
		new ExtractTextPlugin('css/style.css'),
		new webpack.HotModuleReplacementPlugin(),
		new webpack.NoErrorsPlugin(),
		new HtmlWebpackPlugin({
			title: 'GitHubble',
			filename: 'index.html',
			template: 'src/index.tpl',
			favicon: path.join(__dirname, 'src', 'images', 'favicon.ico')
		})
	],
	module: {
		loaders: [
			{ test: /\.js$/, loaders: ['babel'], include: path.join(__dirname, 'src/scripts') },
			{ test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css', {publicPath: "../"}) },
			{ test: /\.(png|jpg)$/, loader: 'file?name=images/[name].[hash].[ext]' },
			{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?name=fonts/[name].[hash].[ext]&mimetype=application/font-woff'},
			{ test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,loader: 'file?name=fonts/[name].[hash].[ext]&mimetype=application/font-woff'},
			{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?name=fonts/[name].[hash].[ext]&mimetype=application/octet-stream'},
			{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?name=fonts/[name].[hash].[ext]'},
			{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'file?name=images/[name].[hash].[ext]&mimetype=image/svg+xml' }
		]
	},
	devServer: {
		historyApiFallback: true,
		stats: { colors: true },
		proxy: {
			"/sse": "http://localhost:3000"
		},
		hot: true,
		port: port
	}
};


text:
<?php

namespace vierbergenlars\CliCentral\Command\Application;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\ProcessBuilder;
use vierbergenlars\CliCentral\Exception\File\NotAFileException;
use vierbergenlars\CliCentral\Exception\File\UnreadableFileException;
use vierbergenlars\CliCentral\FsUtil;
use vierbergenlars\CliCentral\Helper\ExtractHelper;
use vierbergenlars\CliCentral\Helper\GlobalConfigurationHelper;
use vierbergenlars\CliCentral\Helper\ProcessHelper;
use vierbergenlars\CliCentral\Util;

class OverrideCommand extends Command
{
    protected function configure()
    {
        $this->setName('application:override')
            ->addArgument('application', InputArgument::REQUIRED, 'The application to add an override to')
            ->addArgument('config-file', InputArgument::REQUIRED, 'The configuration file to use for the application')
            ->addOption('type', null, InputOption::VALUE_REQUIRED, 'The type of the config-file argument (file,http,git)')
            ->setDescription('Changes the configuration file for an application')
            ->setHelp(<<<'EOF'
The <info>%command.name%</info> command changes the configuration file for the application,
effectively overriding all settings in the packaged <comment>.cliconfig.json</comment>:

  <info>%command.full_name% authserver ~/clic-overrides/authserver/cliconfig.json</info>

Automatically downloading the override files from an url is also possible with git, or by downloading an archive over http(s):

  <info>%command.full_name% owncloud https://gist.github.com/vierbergenlars/9fcbad1a0f8025b98d7e875f614fdaae</info>
  <info>%command.full_name% owncloud https://gist.github.com/vierbergenlars/9fcbad1a0f8025b98d7e875f614fdaae/archive/f371b4ad7130e1d528e99e2f888bb7e6d36b129e.zip

An attempt is made to automatically detect the type of configuration file.
Use the <comment>--type</comment> option to explicitly set the type.

Accepted archive formats are: zip, rar, tar, tar.gz, tar.bz2, tar.xz, tar.Z.

Resetting the configuration file back to the defaults is done by passing an empty second argument:

  <info>%command.full_name% authserver ''</info>
EOF
            )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $configHelper = $this->getHelper('configuration');
        /* @var $configHelper GlobalConfigurationHelper */
        $extractHelper = $this->getHelper('extract');
        /* @var $extractHelper ExtractHelper */

        $globalConfiguration = $configHelper->getConfiguration();
        $application = $globalConfiguration->getApplication($input->getArgument('application'));
        $configFile = $input->getArgument('config-file');

        if($configFile) {
            if(!$input->getOption('type')) {
                // Attempt to detect the type of config-file if none is given
                if (is_file($input->getArgument('config-file'))) {
                    $input->setOption('type', 'file');
                } else {
                    try {
                        $repoParts = Util::parseRepositoryUrl($input->getArgument('config-file'));
                        if (in_array($repoParts['protocol'], ['git', 'ssh', 'rsync']))
                            $input->setOption('type', 'git');
                    } catch (\InvalidArgumentException $ex) {
                        $input->setOption('type', 'http');
                    }
                }
            }
            switch($input->getOption('type')?:'git') {
                case 'git':
                    try {
                        $configFile = $this->downloadGit($output, $configFile);
                    } catch(ProcessFailedException $ex) {
                        if($input->getOption('type'))
                            throw $ex;
                        $errorOutput = $ex->getProcess()->getErrorOutput();
                        if (preg_match('/fatal: repository .*not found/i', $errorOutput)) {
                            // "No such repository" when trying to clone a normal http url. Try downloading the file
                            $configFile = $extractHelper->downloadFile($configFile, $output);
                        } else {
                            throw $ex;
                        }
                    }
                    break;
                case 'http':
                    $configFile = $extractHelper->downloadFile($configFile, $output);
                    break;
                case 'file':
                    break;
                default:
                    throw new \InvalidArgumentException('--type must be one of git, http, file');
            }

            $configFile = $this->extractFile($output, $configFile);

            $configFile = new \SplFileInfo($configFile);
            if(!$configFile->isFile())
                throw new NotAFileException($configFile);
            if(!$configFile->isReadable())
                throw new UnreadableFileException($configFile);
            $configFile = $configFile->getRealPath();
        }

        $application->setConfigurationFileOverride($configFile);

        $globalConfiguration->write();

        $output->writeln(sprintf('Registered <comment>%s</comment> as override file for <info>%s</info>', $configFile, $application->getName()));

    }

    private function extractFile(OutputInterface $output, $configFile)
    {
        if (is_file($configFile)) {
            // Try to JSON decode the file first
            $data = @json_decode(file_get_contents($configFile));
            if($data !== null)
                return $configFile;
            // And then extract if it is not valid json
            $configHelper = $this->getHelper('configuration');
            /* @var $configHelper GlobalConfigurationHelper */
            $extractHelper = $this->getHelper('extract');
            /* @var $extractHelper ExtractHelper */
            $overridesDir = $configHelper->getConfiguration()->getOverridesDirectory();
            $overridesDir.='/'.sha1($configFile).'-'.basename($configFile);
            $extractHelper->extractArchive($configFile, $overridesDir, $output);
            FsUtil::unlink($configFile);
            $configFile = $overridesDir;
        }

        if(is_dir($configFile)) {
            return $this->findConfigJsonInDirectory($configFile);
        }

        throw new \RuntimeException(sprintf('Could not identify the override file, please add it manually. Files are in %s', $configFile));
    }

    private function findConfigJsonInDirectory($directory)
    {
        /*
         * Find override file
         */
        $jsonFiles = Finder::create()
            ->files()
            ->ignoreDotFiles(false)
            ->depth(0)
            ->name('/\.json$/i')
            ->in($directory);

        switch(count($jsonFiles)) {
            case 0:
                break;
            case 1:
                foreach($jsonFiles as $f)
                    return (string)$f;
                break;
            default:
                $clicFiles = $jsonFiles->name('clic');
                switch(count($clicFiles)) {
                    case 1:
                        foreach($jsonFiles as $f)
                            return (string)$f;
                }
        }
        throw new \RuntimeException(sprintf('Could not determine correct override file in %s', $directory));
    }

    /**
     * @param OutputInterface $output
     * @param $configFile
     * @return string
     */
    protected function downloadGit(OutputInterface $output, $configFile)
    {
        $configHelper = $this->getHelper('configuration');
        /* @var $configHelper GlobalConfigurationHelper */
        $processHelper = $this->getHelper('process');
        /* @var $processHelper ProcessHelper */

        $globalConfiguration = $configHelper->getConfiguration();
        $overridesDirectory = $globalConfiguration->getOverridesDirectory();
        $configDir = $overridesDirectory . '/' . sha1($configFile) . '-' . basename($configFile, '.git');
        if (!is_dir($configDir)) {
            FsUtil::mkdir($configDir);

            /*
             * Run a git clone for the application
             */
            $gitClone = ProcessBuilder::create([
                'git',
                'clone',
                $configFile,
                $configDir
            ])->setTimeout(null)->getProcess();
            $processHelper->mustRun($output, $gitClone, null, null, OutputInterface::VERBOSITY_NORMAL, OutputInterface::VERBOSITY_NORMAL);
        } else {
            /*
             * Run a git pull for the application
             */
            $gitPull = ProcessBuilder::create([
                'git',
                'pull',
            ])->setTimeout(null)->setWorkingDirectory($configDir)->getProcess();
            $processHelper->mustRun($output, $gitPull, null, null, OutputInterface::VERBOSITY_NORMAL, OutputInterface::VERBOSITY_NORMAL);
        }
        $configFile = $configDir;
        return $configFile;
    }
}


text:
use std::collections::HashSet;

use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::quote;
use syn::{parse_quote, DeriveInput, Generics, Ident, Result, Type};

use crate::convert::util::WhitePointSource;
use crate::meta::{
    parse_field_attributes, parse_namespaced_attributes, FieldAttributes, IdentOrIndex,
    TypeItemAttributes,
};
use crate::util;

use crate::COLOR_TYPES;

use super::util::{component_type, find_nearest_color, get_convert_color_type, white_point_type};

pub fn derive(item: TokenStream) -> ::std::result::Result<TokenStream, Vec<::syn::parse::Error>> {
    let DeriveInput {
        ident,
        generics: original_generics,
        data,
        attrs,
        ..
    } = syn::parse(item).map_err(|error| vec![error])?;
    let generics = original_generics.clone();

    let mut item_meta: TypeItemAttributes = parse_namespaced_attributes(attrs)?;

    let fields_meta: FieldAttributes = if let syn::Data::Struct(struct_data) = data {
        parse_field_attributes(struct_data.fields)?
    } else {
        return Err(vec![syn::Error::new(
            Span::call_site(),
            "only structs are supported",
        )]);
    };

    let component = component_type(item_meta.component.clone());
    let (white_point, white_point_source) = white_point_type(
        item_meta.white_point.as_ref(),
        item_meta.rgb_standard.as_ref(),
        item_meta.luma_standard.as_ref(),
        item_meta.internal,
    );

    let alpha_field = fields_meta.alpha_property;

    // Assume conversion from Xyz by default
    if item_meta.skip_derives.is_empty() {
        item_meta.skip_derives.insert("Xyz".into());
    }

    let all_from_impl_params = prepare_from_impl(
        &item_meta.skip_derives,
        &component,
        &white_point,
        &item_meta,
        &generics,
        white_point_source,
    )
    .map_err(|error| vec![error])?;

    let mut implementations =
        generate_from_implementations(&ident, &generics, &item_meta, &all_from_impl_params);

    if let Some((alpha_property, alpha_type)) = alpha_field {
        implementations.push(generate_from_alpha_implementation_with_internal(
            &ident,
            &generics,
            &item_meta,
            &alpha_property,
            &alpha_type,
        ));
    } else {
        implementations.push(generate_from_alpha_implementation(
            &ident, &generics, &item_meta,
        ));
    }

    Ok(TokenStream::from(quote! {
        #(#implementations)*
    }))
}

fn prepare_from_impl(
    skip: &HashSet<String>,
    component: &Type,
    white_point: &Type,
    meta: &TypeItemAttributes,
    generics: &Generics,
    white_point_source: Option<WhitePointSource>,
) -> Result<Vec<FromImplParameters>> {
    let included_colors = COLOR_TYPES.iter().filter(|&&color| !skip.contains(color));
    let linear_path = util::path(&["encoding", "Linear"], meta.internal);

    let mut parameters = Vec::new();

    for &color_name in included_colors {
        let nearest_color_name = find_nearest_color(color_name, skip)?;

        let mut generics = generics.clone();

        let (color_ty, mut used_input) = get_convert_color_type(
            color_name,
            white_point,
            component,
            meta.rgb_standard.as_ref(),
            meta.luma_standard.as_ref(),
            &mut generics,
            meta.internal,
        );

        let nearest_color_path = util::color_path(nearest_color_name, meta.internal);
        let target_color_rgb_standard = match color_name {
            "Rgb" | "Hsl" | "Hsv" | "Hwb" => Some(parse_quote!(_S)),
            _ => None,
        };

        let nearest_color_ty: Type = match nearest_color_name {
            "Rgb" | "Hsl" | "Hsv" | "Hwb" => {
                let rgb_standard = meta.rgb_standard
                    .clone()
                    .or(target_color_rgb_standard)
                    .ok_or_else(|| {
                        syn::parse::Error::new(
                            Span::call_site(),
                            format!(
                                "could not determine which RGB standard to use when converting to and from `{}` via `{}`",
                                color_name,
                                nearest_color_name
                            ),
                        )
                    })?;

                parse_quote!(#nearest_color_path::<#rgb_standard, #component>)
            }
            "Luma" => {
                if let Some(luma_standard) = meta.luma_standard.as_ref() {
                    parse_quote!(#nearest_color_path::<#luma_standard, #component>)
                } else {
                    used_input.white_point = true;
                    parse_quote!(#nearest_color_path::<#linear_path<#white_point>, #component>)
                }
            }
            "Oklab" | "Oklch" => {
                parse_quote!(#nearest_color_path::<#component>)
            }
            _ => {
                used_input.white_point = true;
                parse_quote!(#nearest_color_path::<#white_point, #component>)
            }
        };

        if used_input.white_point {
            match white_point_source {
                Some(WhitePointSource::WhitePoint) => {
                    let white_point_path =
                        util::path(&["white_point", "WhitePoint"], meta.internal);
                    generics
                        .make_where_clause()
                        .predicates
                        .push(parse_quote!(#white_point: #white_point_path<#component>))
                }
                Some(WhitePointSource::RgbStandard) => {
                    let rgb_standard_path = util::path(&["rgb", "RgbStandard"], meta.internal);
                    let rgb_standard = meta.rgb_standard.as_ref();
                    generics
                        .make_where_clause()
                        .predicates
                        .push(parse_quote!(#rgb_standard: #rgb_standard_path));
                }
                Some(WhitePointSource::LumaStandard) => {
                    let luma_standard_path = util::path(&["luma", "LumaStandard"], meta.internal);
                    let luma_standard = meta.luma_standard.as_ref();
                    generics
                        .make_where_clause()
                        .predicates
                        .push(parse_quote!(#luma_standard: #luma_standard_path));
                }
                None => {}
            }
        }

        parameters.push(FromImplParameters {
            generics,
            color_ty,
            nearest_color_ty,
        });
    }

    Ok(parameters)
}

struct FromImplParameters {
    generics: Generics,
    color_ty: Type,
    nearest_color_ty: Type,
}

fn generate_from_implementations(
    ident: &Ident,
    generics: &Generics,
    meta: &TypeItemAttributes,
    all_parameters: &[FromImplParameters],
) -> Vec<TokenStream2> {
    let from_trait_path = util::path(&["convert", "FromColorUnclamped"], meta.internal);
    let into_trait_path = util::path(&["convert", "IntoColorUnclamped"], meta.internal);

    let (_, type_generics, _) = generics.split_for_impl();

    let mut implementations = Vec::with_capacity(all_parameters.len());

    for parameters in all_parameters {
        let FromImplParameters {
            color_ty,
            generics,
            nearest_color_ty,
        } = parameters;

        {
            let mut generics = generics.clone();

            {
                let where_clause = generics.make_where_clause();
                where_clause
                    .predicates
                    .push(parse_quote!(#nearest_color_ty: #from_trait_path<#color_ty>));
                where_clause
                    .predicates
                    .push(parse_quote!(#nearest_color_ty: #into_trait_path<Self>));
            }

            let (impl_generics, _, where_clause) = generics.split_for_impl();

            implementations.push(quote! {
                #[automatically_derived]
                impl #impl_generics #from_trait_path<#color_ty> for #ident #type_generics #where_clause {
                    fn from_color_unclamped(color: #color_ty) -> Self {
                        use #from_trait_path;
                        use #into_trait_path;
                        #nearest_color_ty::from_color_unclamped(color).into_color_unclamped()
                    }
                }
            });
        }

        if !meta.internal || meta.internal_not_base_type {
            let mut generics = generics.clone();

            {
                let where_clause = generics.make_where_clause();
                where_clause
                    .predicates
                    .push(parse_quote!(#nearest_color_ty: #from_trait_path<#ident #type_generics>));
                where_clause
                    .predicates
                    .push(parse_quote!(#nearest_color_ty: #into_trait_path<Self>));
            }

            let (impl_generics, _, where_clause) = generics.split_for_impl();

            implementations.push(quote! {
                #[automatically_derived]
                impl #impl_generics #from_trait_path<#ident #type_generics> for #color_ty #where_clause {
                    fn from_color_unclamped(color: #ident #type_generics) -> Self {
                        use #from_trait_path;
                        use #into_trait_path;
                        #nearest_color_ty::from_color_unclamped(color).into_color_unclamped()
                    }
                }
            });
        }
    }

    implementations
}

fn generate_from_alpha_implementation(
    ident: &Ident,
    generics: &Generics,
    meta: &TypeItemAttributes,
) -> TokenStream2 {
    let from_trait_path = util::path(&["convert", "FromColorUnclamped"], meta.internal);
    let into_trait_path = util::path(&["convert", "IntoColorUnclamped"], meta.internal);
    let alpha_path = util::path(&["Alpha"], meta.internal);

    let mut impl_generics = generics.clone();
    impl_generics.params.push(parse_quote!(_C));
    impl_generics.params.push(parse_quote!(_A));
    {
        let where_clause = impl_generics.make_where_clause();
        where_clause
            .predicates
            .push(parse_quote!(_C: #into_trait_path<Self>));
    }

    let (_, type_generics, _) = generics.split_for_impl();
    let (self_impl_generics, _, self_where_clause) = impl_generics.split_for_impl();

    quote! {
        #[automatically_derived]
        impl #self_impl_generics #from_trait_path<#alpha_path<_C, _A>> for #ident #type_generics #self_where_clause {
            fn from_color_unclamped(color: #alpha_path<_C, _A>) -> Self {
                color.color.into_color_unclamped()
            }
        }
    }
}

fn generate_from_alpha_implementation_with_internal(
    ident: &Ident,
    generics: &Generics,
    meta: &TypeItemAttributes,
    alpha_property: &IdentOrIndex,
    alpha_type: &Type,
) -> TokenStream2 {
    let from_trait_path = util::path(&["convert", "FromColorUnclamped"], meta.internal);
    let into_trait_path = util::path(&["convert", "IntoColorUnclamped"], meta.internal);
    let alpha_path = util::path(&["Alpha"], meta.internal);

    let (_, type_generics, _) = generics.split_for_impl();
    let mut impl_generics = generics.clone();
    impl_generics.params.push(parse_quote!(_C));
    {
        let where_clause = impl_generics.make_where_clause();
        where_clause
            .predicates
            .push(parse_quote!(_C: #into_trait_path<Self>));
    }
    let (impl_generics, _, where_clause) = impl_generics.split_for_impl();

    quote! {
        #[automatically_derived]
        impl #impl_generics #from_trait_path<#alpha_path<_C, #alpha_type>> for #ident #type_generics #where_clause {
            fn from_color_unclamped(color: #alpha_path<_C, #alpha_type>) -> Self {
                use #from_trait_path;
                use #into_trait_path;

                let #alpha_path { color, alpha } = color;

                let mut result: Self = color.into_color_unclamped();
                result.#alpha_property = alpha;

                result
            }
        }
    }
}


text:
import { DOMParser } from '@xmldom/xmldom';
import isBefore from 'date-fns/isBefore';
import isEqual from 'date-fns/isEqual';
import parseISO from 'date-fns/parseISO';
import { Tag } from './constants';

export const getContentFromFirstTag = (post: string, tag: Tag) => {
  if (!post) {
    return '';
  }

  const tags = new DOMParser().parseFromString(post, 'text/html');
  return tags.getElementsByTagName(tag)[0]
    ? (tags.getElementsByTagName(tag)[0].textContent as string)
    : '';
};

export const compareDate = (a: string, b: string) => {
  const date1 = parseISO(a);
  const date2 = parseISO(b);

  if (isEqual(date1, date2)) {
    return 0;
  }

  return isBefore(date1, date2) ? 1 : -1;
};


text:
/* Includes ------------------------------------------------------------------*/
#include "HAL_adc.h"
#include "HAL_rcc.h"

/** @addtogroup StdPeriph_Driver
* @{
*/

/** @defgroup ADC
* @brief ADC driver modules
* @{
*/

/** @defgroup ADC_Private_TypesDefinitions
* @{
*/

/**
* @}
*/

/** @defgroup ADC_Private_Defines
* @{
*/

/* ADCR register Mask */
#define ADCR_CLEAR_Mask              ((uint32_t)0xFFFFF183)

/* ADCFG register Mask */
#define ADCFG_CLEAR_Mask             ((uint32_t)0xFFFFFF8F)

/* ADC ADEN mask */
#define ADCFG_ADEN_Set                ((uint32_t)0x00000001)
#define ADCFG_ADEN_Reset              ((uint32_t)0xFFFFFFFE)

/* ADC DMA mask */
#define ADCR_DMA_Set                 ((uint32_t)0x00000008)
#define ADCR_DMA_Reset               ((uint32_t)0xFFFFFFF7)

/* ADC Software start mask */
#define ADCR_SWSTART_Set     ((uint32_t)0x00000100)
#define ADCR_SWSTART_Reset   ((uint32_t)0xFFFFFEFF)

/* ADC EXTTRIG mask */
#define ADCR_EXTTRIG_Set             ((uint32_t)0x00000004)
#define ADCR_EXTTRIG_Reset            ((uint32_t)0xFFFFFFFB)

/*seletec channle enable */
#define CHEN0_ENABLE								((uint32_t)0x00000001)
#define CHEN1_ENABLE								((uint32_t)0x00000002)
#define CHEN2_ENABLE								((uint32_t)0x00000004)
#define CHEN3_ENABLE								((uint32_t)0x00000008)
#define CHEN4_ENABLE								((uint32_t)0x00000010)
#define CHEN5_ENABLE								((uint32_t)0x00000020)
#define CHEN6_ENABLE								((uint32_t)0x00000040)
#define CHEN7_ENABLE								((uint32_t)0x00000080)
#define CHEN8_ENABLE								((uint32_t)0x00000100)
#define CHALL_ENABLE                				((uint32_t)0x000001ff)

#define CHEN_DISABLE								((uint32_t)0xFFFFFE00)

/* ADC EXTSEL mask */
#define ADCR_EXTSEL_Reset           				((uint32_t)0xFFFFFF8F)

/* ADC Analog watchdog enable mode mask */
#define ADCFG_AWDMode_Reset           				((uint32_t)0xFFFFFFFD)

/* ADC AWDCH mask */
#define ADCR_AWDCH_Reset             				((uint32_t)0xFFFF0FFF)

/* ADC TSPD mask */
#define ADCHS_TSVREFE_Set            				((uint32_t)0x00000100)
#define ADCHS_TSVREFE_Reset            				((uint32_t)0xFFFFFEFF)

/* ADC1 DATA register base address */
#define ADDATA_ADDRESS                  			((uint32_t)0x40012400)
/**
* @}
*/

/** @defgroup ADC_Private_Macros
* @{
*/

/**
* @}
*/

/** @defgroup ADC_Private_Variables
* @{
*/

/**
* @}
*/

/** @defgroup ADC_Private_FunctionPrototypes
* @{
*/

/**
* @}
*/

/** @defgroup ADC_Private_Functions
* @{
*/

/**
* @brief  Deinitializes the ADCx peripheral registers to their default
*   reset values.
* @param ADCx: where x can be 1, 2  to select the ADC peripheral.
* @retval : None
*/
void ADC_DeInit(ADC_TypeDef* ADCx)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    switch (*(uint32_t*)&ADCx)
    {
    case ADC1_BASE:
        /* Enable ADC1 reset state */
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1, ENABLE);
        /* Release ADC1 from reset state */
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1, DISABLE);
        break;

    case ADC2_BASE:
        /* Enable ADC2 reset state */
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC2, ENABLE);
        /* Release ADC2 from reset state */
        RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC2, DISABLE);
        break;

    default:
        break;
    }
}

/**
* @brief  Initializes the ADCx peripheral according to the specified parameters
*   in the ADC_InitStruct.
* @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* @param ADC_InitStruct: pointer to an ADC_InitTypeDef structure that
*   contains the configuration information for the specified
*   ADC peripheral.
* @retval : None
*/
void ADC_Init(ADC_TypeDef* ADCx, ADC_InitTypeDef* ADC_InitStruct)
{
    uint32_t tmpreg1 = 0;

    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_MODE(ADC_InitStruct->ADC_Mode));
    assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ScanConvMode));
    assert_param(IS_FUNCTIONAL_STATE(ADC_InitStruct->ADC_ContinuousConvMode));
    assert_param(IS_ADC_EXT_TRIG(ADC_InitStruct->ADC_ExternalTrigConv));
    assert_param(IS_ADC_DATA_ALIGN(ADC_InitStruct->ADC_DataAlign));
    assert_param(IS_ADC_REGULAR_LENGTH(ADC_InitStruct->ADC_NbrOfChannel));
    /*---------------------------- ADCx ADCFG Configuration -----------------*/
    /* Get the ADCx ADCFG value */
    tmpreg1 = ADCx->ADCFG;
    /* Clear ADCPRE bits */
    tmpreg1 &= ADCFG_CLEAR_Mask;
    /* Configure ADCx: AD convertion prescare*/
    /* Set ADCPRE bit according to ADC_PRESCARE value */
    tmpreg1 |= (uint32_t)(ADC_InitStruct->ADC_PRESCARE)|ADC_InitStruct->ADC_Resolution;
    /* Write to ADCx ADCFG */
    ADCx->ADCFG = tmpreg1;

    /*---------------------------- ADCx ADCR Configuration -----------------*/
    /* Get the ADCx ADCR value */
    tmpreg1 = ADCx->ADCR;
    /* Clear ALIGN , ADMD, and TRGEN and TRGSEL bits */
    tmpreg1 &= ADCR_CLEAR_Mask;
    /* Configure ADCx: external trigger event and AD conversion mode and ALIGN*/
    /* Set ALIGN bit according to ADC_DataAlign value */
    /* Set TRGEN bits according to ADC_ContinuousConvMode value */
    /* Set TRGSEL bits according to ADC_ExternalTrigConv value */

    tmpreg1 |= ((uint32_t)ADC_InitStruct->ADC_DataAlign) | ADC_InitStruct->ADC_ExternalTrigConv |
        ((uint32_t)ADC_InitStruct->ADC_Mode) ;

    /* Write to ADCx ADCR */
    ADCx->ADCR = tmpreg1;

}

/**
* @brief  Fills each ADC_InitStruct member with its default value.
* @param ADC_InitStruct : pointer to an ADC_InitTypeDef structure
*   which will be initialized.
* @retval : None
*/
void ADC_StructInit(ADC_InitTypeDef* ADC_InitStruct)
{
	/* Initialize the ADC_Resolution values */
	ADC_InitStruct->ADC_Resolution = ADC_Resolution_12b;
    /* Initialize the ADC_PRESCARE values */
    ADC_InitStruct->ADC_PRESCARE = ADC_PCLK2_PRESCARE_2;
    /* Initialize the ADC_Mode member */
    ADC_InitStruct->ADC_Mode = ADC_Mode_Single;
    /* Initialize the ADC_ContinuousConvMode member */
    ADC_InitStruct->ADC_ContinuousConvMode = DISABLE;
    /* Initialize the ADC_ExternalTrigConv member */
    ADC_InitStruct->ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1;
    /* Initialize the ADC_DataAlign member */
    ADC_InitStruct->ADC_DataAlign = ADC_DataAlign_Right;
    /* Initialize the ADC_NbrOfChannel member */

}

/**
* @brief  Enables or disables the specified ADC peripheral.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param NewState: new state of the ADCx peripheral. This parameter
*   can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_Cmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        /* Set the ADEN bit */
        ADCx->ADCFG |= ADCFG_ADEN_Set;
    }
    else
    {
        /* Disable the selected ADC peripheral */
        ADCx->ADCFG &= ADCFG_ADEN_Reset;
    }
}

/**
* @brief  Enables or disables the specified ADC DMA request.
* @param ADCx: where x can be 1 or 2 to select the ADC peripheral.
* @param NewState: new state of the selected ADC DMA transfer.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_DMACmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
    /* Check the parameters */
    assert_param(IS_ADC_DMA_PERIPH(ADCx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        /* Enable the selected ADC DMA request */
        ADCx->ADCR |= ADCR_DMA_Set;
    }
    else
    {
        /* Disable the selected ADC DMA request */
        ADCx->ADCR &= ADCR_DMA_Reset;
    }
}

/**
* @brief  Enables or disables the specified ADC interrupts.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param ADC_IT: specifies the ADC interrupt sources to be enabled
*   or disabled.
*   This parameter can be any combination of the following values:
* @arg ADC_IT_EOC: End of conversion interrupt mask
* @arg ADC_IT_AWD: Analog watchdog interrupt mask
* @param NewState: new state of the specified ADC interrupts.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_ITConfig(ADC_TypeDef* ADCx, uint16_t ADC_IT, FunctionalState NewState)
{

    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    assert_param(IS_ADC_IT(ADC_IT));
    /* Get the ADC IT index */
    //itmask = (uint8_t)ADC_IT;
    if (NewState != DISABLE)
    {
        /* Enable the selected ADC interrupts */
        ADCx->ADCR |= ADC_IT;
    }
    else
    {
        /* Disable the selected ADC interrupts */
        ADCx->ADCR &= (~(uint32_t)ADC_IT);
    }
}

/**
* @brief  Enables or disables the selected ADC software start conversion .
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param NewState: new state of the selected ADC software start conversion.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_SoftwareStartConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        /* Enable the selected ADC conversion on external event and start the selected
        ADC conversion */
        /*Set ADST bit*/
        ADCx->ADCR |= ADCR_SWSTART_Set;
    }
    else
    {
        /* Disable the selected ADC conversion on external event and stop the selected
        ADC conversion */
        ADCx->ADCR &= ADCR_SWSTART_Reset;
    }
}

/**
* @brief  Gets the selected ADC Software start conversion Status.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @retval : The new state of ADC software start conversion (SET or RESET).
*/
FlagStatus ADC_GetSoftwareStartConvStatus(ADC_TypeDef* ADCx)
{
    FlagStatus bitstatus = RESET;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    /* Check the status of ADST bit */
    if ((ADCx->ADCR & ADCR_SWSTART_Set) != (uint32_t)RESET)
    {
        /* ADST bit is set */
        bitstatus = SET;
    }
    else
    {
        /* ADST bit is reset */
        bitstatus = RESET;
    }
    /* Return the ADST bit status */
    return  bitstatus;
}

/**
* @brief  Configures for the selected ADC  channel its corresponding
*   rank in the sequencer and its sample time.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param ADC_Channel: the ADC channel to configure.
*   This parameter can be one of the following values:
* @arg ADC_Channel_0: ADC Channel0 selected
* @arg ADC_Channel_1: ADC Channel1 selected
* @arg ADC_Channel_2: ADC Channel2 selected
* @arg ADC_Channel_3: ADC Channel3 selected
* @arg ADC_Channel_4: ADC Channel4 selected
* @arg ADC_Channel_5: ADC Channel5 selected
* @arg ADC_Channel_6: ADC Channel6 selected
* @arg ADC_Channel_7: ADC Channel7 selected
* @arg ADC_Channel_8: ADC Channel8 selected
* @retval : None
*/
void ADC_RegularChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime)
{
    uint32_t tmpreg = 0;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_CHANNEL(ADC_Channel));
    assert_param(IS_ADC_REGULAR_RANK(Rank));
    assert_param(IS_ADC_SAMPLE_TIME(ADC_SampleTime));
    tmpreg = ADCx->ADCFG;
    tmpreg &= ~(ADC_SMPR_SMP<<10);
    ADCx->ADCFG = tmpreg|((ADC_SampleTime&ADC_SMPR_SMP)<<10);
    switch(ADC_Channel)
    {
        /* set the CHEN0 bit for channel 0 enable*/
    case ADC_Channel_0: ADCx->ADCHS |= CHEN0_ENABLE;
    break;
    /* set the CHEN1 bit for channel 1 enable*/
    case ADC_Channel_1: ADCx->ADCHS |= CHEN1_ENABLE;
    break;
    /* set the CHEN2 bit for channel 2 enable*/
    case ADC_Channel_2: ADCx->ADCHS |= CHEN2_ENABLE;
    break;
    /* set the CHEN3 bit for channel 3 enable*/
    case ADC_Channel_3: ADCx->ADCHS |= CHEN3_ENABLE;
    break;
    /* set the CHEN4 bit for channel 4 enable*/
    case ADC_Channel_4: ADCx->ADCHS |= CHEN4_ENABLE;
    break;
    /* set the CHEN5 bit for channel 5 enable*/
    case ADC_Channel_5: ADCx->ADCHS |= CHEN5_ENABLE;
    break;
    /* set the CHEN6 bit for channel 6 enable*/
    case ADC_Channel_6: ADCx->ADCHS |= CHEN6_ENABLE;
    break;
    /* set the CHEN7 bit for channel 7 enable*/
    case ADC_Channel_7: ADCx->ADCHS |= CHEN7_ENABLE;
    break;
    /* set the SENSOREN bit for channel 8 enable*/
    case ADC_Channel_8: ADCx->ADCHS |= CHEN8_ENABLE;      //SENSOREN or VREFINT
    break;
    case ADC_Channel_All:ADCx->ADCHS |= CHALL_ENABLE;     //SENSOREN or VREFINT
    break;
    default:
        ADCx->ADCHS &= CHEN_DISABLE;
        break;
    }
}

/**
* @brief  Enables or disables the ADCx conversion through external trigger.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param NewState: new state of the selected ADC external trigger
*   start of conversion.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_ExternalTrigConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        /* Enable the selected ADC conversion on external event */
        ADCx->ADCR |= ADCR_EXTTRIG_Set;
    }
    else
    {
        /* Disable the selected ADC conversion on external event */
        ADCx->ADCR &= ADCR_EXTTRIG_Reset;
    }
}

/**
* @brief  Returns the last ADCx conversion result data for regular channel.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @retval : The Data conversion value.
*/
uint16_t ADC_GetConversionValue(ADC_TypeDef* ADCx)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    /* Return the selected ADC conversion value */
    return (uint16_t) ADCx->ADDATA;
}

/**
* @brief  Returns the last ADC conversion result data in dual mode.
* @retval : The Data conversion value.
*/
uint32_t ADC_GetDualModeConversionValue(void)
{
    /* Return the dual mode conversion value */
    return (*(__IO uint32_t *) ADDATA_ADDRESS);
}

/**
* @brief  Configures the ADCx external trigger for injected channels conversion.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param ADC_ExternalTrigInjecConv: specifies the ADC trigger to
*   start injected conversion.
*   This parameter can be one of the following values:
* @arg ADC_ExternalTrigConv_T1_CC1: Timer1 capture
*   compare1 selected (for ADC1)
* @arg ADC_ExternalTrigConv_T1_CC2: Timer1 capture
*   compare2 selected (for ADC1)
* @arg ADC_ExternalTrigConv_T1_CC3: Timer1 capture
*   compare3 selected (for ADC1)
* @arg ADC_ExternalTrigConv_T2_CC2: Timer2 capture
*   compare2 selected (for ADC1)
* @arg ADC_ExternalTrigConv_T3_TRGO: Timer3 TRGO event
*   selected (for ADC1)
* @arg ADC_ExternalTrigConv_T4_CC4: Timer4 capture
*   compare4 selected (for ADC1)
* @arg ADC_ExternalTrigConv_T3_CC1: Timer3 capture
*   compare1 selected (for ADC1)
* @arg ADC_ExternalTrigConv_EXTI_11: EXTI line 11 event
*   cselected (for ADC1)
* @arg ADC_ExternalTrigConv_T1_TRGO: Timer1 TRGO event
*   selected (for ADC2)
* @arg ADC_ExternalTrigConv_T1_CC4: Timer1 capture
*   compare4 selected (for ADC2)
* @arg ADC_ExternalTrigConv_T2_TRGO: Timer2 TRGO event
*   selected (for ADC2)
* @arg ADC_ExternalTrigConv_T2_CC1: Timer2 capture
*   compare1 selected (for ADC2)
* @arg ADC_ExternalTrigConv_T3_CC4: Timer3 capture
*   compare4 selected (for ADC2)
* @arg ADC_ExternalTrigConv_T4_TRGO: Timer4 TRGO event
*   selected (for ADC2)
* @arg ADC_ExternalTrigConv_T3_CC1: Timer3 capture
*   compare1 selected (for ADC2)
* @arg ADC_ExternalTrigConv_EXTI_15: EXTI line 15 event
*   cselected (for ADC2)
* @retval : None
*/
void ADC_ExternalTrigInjectedConvConfig(ADC_TypeDef* ADCx, uint32_t ADC_ExternalTrigInjecConv)
{
    uint32_t tmpreg = 0;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_EXT_INJEC_TRIG(ADC_ExternalTrigInjecConv));
    /* Get the old register value */
    tmpreg = ADCx->ADCR;
    /* Clear the old external event selection for injected group */
    tmpreg &= ADCR_EXTSEL_Reset;
    /* Set the external event selection for injected group */
    tmpreg |= ADC_ExternalTrigInjecConv;
    /* Store the new register value */
    ADCx->ADCR = tmpreg;
}

/**
* @brief  Enables or disables the ADCx injected channels conversion
*   through external trigger
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param NewState: new state of the selected ADC external trigger
*   start of injected conversion.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_ExternalTrigInjectedConvCmd(ADC_TypeDef* ADCx, FunctionalState NewState)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        /* Enable the selected ADC external event selection for injected group */
        ADCx->ADCR |= ADCR_EXTTRIG_Set;
    }
    else
    {
        ADCx->ADCR &= ADCR_EXTTRIG_Reset;
    }
}

/**
* @brief  Enables or disables the analog watchdog on single/all regular
*   or injected channels
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param ADC_AnalogWatchdog: the ADC analog watchdog configuration.
*   This parameter can be one of the following values:
* @arg ADC_AnalogWatchdog_SingleRegEnable: Analog watchdog on
*   a single regular channel
* @arg ADC_AnalogWatchdog_None: No channel guarded by the
*   analog watchdog
*   analog watchdog
* @retval : None
*/
void ADC_AnalogWatchdogCmd(ADC_TypeDef* ADCx, uint32_t ADC_AnalogWatchdog)
{
    uint32_t tmpreg = 0;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_ANALOG_WATCHDOG(ADC_AnalogWatchdog));
    /* Get the old register value */
    tmpreg = ADCx->ADCFG;
    /* Clear ADWEN bit */
    tmpreg &= ADCFG_AWDMode_Reset;
    /* Set the analog watchdog enable mode */
    tmpreg |= ADC_AnalogWatchdog;
    /* Store the new register value */
    ADCx->ADCFG = tmpreg;
}

/**
* @brief  Configures the high and low thresholds of the analog watchdog.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param HighThreshold: the ADC analog watchdog High threshold value.
*   This parameter must be a 12bit value.
* @param LowThreshold: the ADC analog watchdog Low threshold value.
*   This parameter must be a 12bit value.
* @retval : None
*/
void ADC_AnalogWatchdogThresholdsConfig(ADC_TypeDef* ADCx, uint16_t HighThreshold,
                                        uint16_t LowThreshold)
{
    uint32_t tempThreshold;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_THRESHOLD(HighThreshold));
    assert_param(IS_ADC_THRESHOLD(LowThreshold));
    /* Get the ADCx high threshold */
    tempThreshold = HighThreshold;
    /* Set the ADCx high threshold and the ADCx low threshold */
    ADCx->ADCMPR = (tempThreshold<<16) | LowThreshold;
}

/**
* @brief  Configures the analog watchdog guarded single channel
* @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* @param ADC_Channel: the ADC channel to configure for the analog
*   watchdog.
*   This parameter can be one of the following values:
* @arg ADC_Channel_0: ADC Channel0 selected
* @arg ADC_Channel_1: ADC Channel1 selected
* @arg ADC_Channel_2: ADC Channel2 selected
* @arg ADC_Channel_3: ADC Channel3 selected
* @arg ADC_Channel_4: ADC Channel4 selected
* @arg ADC_Channel_5: ADC Channel5 selected
* @arg ADC_Channel_6: ADC Channel6 selected
* @arg ADC_Channel_7: ADC Channel7 selected
* @arg ADC_Channel_8: ADC Channel8 selected
* @arg ADC_Channel_All: ADC all Channel selected
* @retval : None
*/
void ADC_AnalogWatchdogSingleChannelConfig(ADC_TypeDef* ADCx, uint8_t ADC_Channel)
{
    uint32_t tmpreg = 0;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_CHANNEL(ADC_Channel));
    /* Get the old register value */
    tmpreg = ADCx->ADCR;
    /* Clear the Analog watchdog channel select bits */
    tmpreg &= ADCR_AWDCH_Reset;
    /* Set the Analog watchdog channel */
    tmpreg |= (ADC_Channel<<12);
    /* Store the new register value */
    ADCx->ADCR = tmpreg;
}

/**
* @brief  Enables or disables the temperature sensor and Vrefint channel.
* @param NewState: new state of the temperature sensor.
*   This parameter can be: ENABLE or DISABLE.
* @retval : None
*/
void ADC_TempSensorVrefintCmd(FunctionalState NewState)
{
    /* Check the parameters */
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        /* Enable the temperature sensor and Vrefint channel*/
        ADC1->ADCFG |= ADCFG_TVSEN ;
        ADC2->ADCFG |= ADCFG_TVSEN ;//next
    }
    else
    {
        /* Disable the temperature sensor and Vrefint channel*/
        ADC1->ADCFG &=~ ADCFG_TVSEN;
        ADC2->ADCFG &=~ ADCFG_TVSEN;
    }
}

/**
* @brief  Checks whether the specified ADC flag is set or not.
* @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* @param ADC_FLAG: specifies the flag to check.
*   This parameter can be one of the following values:
* @arg ADC_FLAG_AWD: Analog watchdog flag
* @arg ADC_FLAG_EOC: End of conversion flag
* @arg ADC_FLAG_BUSY: AD conversion busy flag
* @retval : The new state of ADC_FLAG (SET or RESET).
*/
FlagStatus ADC_GetFlagStatus(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
{
    FlagStatus bitstatus = RESET;
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_GET_FLAG(ADC_FLAG));
    /* Check the status of the specified ADC flag */
    if ((ADCx->ADSTA & ADC_FLAG) != (uint8_t)RESET)
    {
        /* ADC_FLAG is set */
        bitstatus = SET;
    }
    else
    {
        /* ADC_FLAG is reset */
        bitstatus = RESET;
    }

    /* Return the ADC_FLAG status */
    return  bitstatus;
}

/**
* @brief  Clears the ADCx's pending flags.
* @param ADCx: where x can be 1, 2 to select the ADC peripheral.
* @param ADC_FLAG: specifies the flag to clear.
*   This parameter can be any combination of the following values:
* @arg ADC_FLAG_AWD: Analog watchdog flag
* @arg ADC_FLAG_EOC: End of conversion flag
* @retval : None
*/
void ADC_ClearFlag(ADC_TypeDef* ADCx, uint8_t ADC_FLAG)
{
    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_CLEAR_FLAG(ADC_FLAG));
    /* Clear the selected ADC flags */
    ADCx->ADSTA |= ADC_FLAG;
}

/**
* @brief  Checks whether the specified ADC interrupt has occurred or not.
* @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* @param ADC_IT: specifies the ADC interrupt source to check.
*   This parameter can be one of the following values:
* @arg ADC_IT_EOC: End of conversion interrupt mask
* @arg ADC_IT_AWD: Analog watchdog interrupt mask
* @retval : The new state of ADC_IT (SET or RESET).
*/
ITStatus ADC_GetITStatus(ADC_TypeDef* ADCx, uint16_t ADC_IT)
{
    ITStatus bitstatus = RESET;

    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_GET_IT(ADC_IT));

    /* Check the status of the specified ADC interrupt */
    if (((ADCx->ADSTA & ADC_IT)) != (uint32_t)RESET)
    {
        /* ADC_IT is set */
        bitstatus = SET;
    }
    else
    {
        /* ADC_IT is reset */
        bitstatus = RESET;
    }
    /* Return the ADC_IT status */
    return  bitstatus;
}

/**
* @brief  Clears the ADCx's interrupt pending bits.
* @param ADCx: where x can be 1, 2 or 3 to select the ADC peripheral.
* @param ADC_IT: specifies the ADC interrupt pending bit to clear.
*   This parameter can be any combination of the following values:
* @arg ADC_IT_EOC: End of conversion interrupt mask
* @arg ADC_IT_AWD: Analog watchdog interrupt mask
* @retval : None
*/
void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT)
{

    /* Check the parameters */
    assert_param(IS_ADC_ALL_PERIPH(ADCx));
    assert_param(IS_ADC_IT(ADC_IT));
    /* Clear the selected ADC interrupt pending bits */
    ADCx->ADSTA = ADC_IT;
}

/**
* @}
*/

/**
* @}
*/

/**
* @}
*/

/*-------------------------(C) COPYRIGHT 2017 MindMotion ----------------------*/


text:
package unquietcode.tools.closures;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * @author Benjamin Fagin
 * @version 03-02-2011
 */
public class ClosurePassing_T {
	@Test
	public void basic() {
		// create a multiplier through nested closures
		Closure1<Integer, Integer> squared = new AbstractClosure1<Integer, Integer>() {
			public @Override
			Integer run(Integer p1) {
				if (p1 == null)
					return null;
				else
					return p1 * p1;
			}
		};

		Closure1<Integer, Integer> copycat = new AbstractClosure1<Integer, Integer>(squared) {
			Closure1 a1 = a1();

			@SuppressWarnings("unchecked")
			public @Override
			Integer run(Integer p1) {
				return (Integer) a1.run(p1);
			}
		};

		assertEquals((Integer) 16, copycat.run(4));
	}
}


text:
// Copyright 2004-2010 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Castle.Samples.Extensibility.UI
{
	using System.Windows.Forms;

	public partial class ApplicationShell : Form
	{
		public ApplicationShell(Input input, Output output)
		{
			InitializeComponent();

			flowLayoutPanel1.Controls.Add(input);
			flowLayoutPanel1.Controls.Add(output);
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:rs="http://www.openarchives.org/rs/terms/">
  <rs:md capability="description" />
  <url>
    <loc>http://localhost/.well-known/resourcesync/dataset1/capability.xml</loc>
    <rs:md capability="capabilitylist" />
  </url>
  <url>
    <loc>http://localhost/.well-known/resourcesync/dataset2/capability.xml</loc>
    <rs:md capability="capabilitylist" />
  </url>
</urlset>


text:
package com.example.johnmasiello.developnewproject;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.Toast;

import java.util.Arrays;
import java.util.List;

public class DemoActivity extends AppCompatActivity implements HorizontalListContentView.ScrollCallback {

    private HorizontalListContentView demoView;

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

        // Set the data
        List data = Arrays.asList(1, 2, 3, 4, 5, 6);

        // Set the view
        demoView = new HorizontalListContentView(this);
        addContentView(demoView, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));

        // Connect the view to the data
        demoView.setContentItems(data, R.layout.listitem, R.id.textView);

        // Add more functionality
        demoView.setScrollCallback(this);
    }

    @Override
    public void scrollCallback() {
        String feedback = "item " + (demoView.getCurrentItemIndex() + 1);
        Toast.makeText(this, feedback, Toast.LENGTH_SHORT).show();
    }
}


text:
var editableModule = angular.module('streamflow.editable', []);

editableModule.directive('contenteditable', function() {
    return {
        require: 'ngModel',
        link: function(scope, element, attrs, ctrl) {
            // view -> model
            element.bind('blur', function() {
                scope.$apply(function() {
                    ctrl.$setViewValue(element.text());
                });
            });

            // model -> view
            ctrl.$render = function() {
                element.html(ctrl.$viewValue);
            };

            // load init value from DOM
            ctrl.$render();
        }
    };
});


text:
package org.apache.ignite.internal.processors.hadoop.igfs;

import org.apache.hadoop.fs.permission.*;
import org.apache.ignite.*;

import java.util.*;

import static org.apache.ignite.internal.processors.igfs.IgfsEx.*;

/**
 * Hadoop file system properties.
 */
public class HadoopIgfsProperties {
    /** Username. */
    private String usrName;

    /** Group name. */
    private String grpName;

    /** Permissions. */
    private FsPermission perm;

    /**
     * Constructor.
     *
     * @param props Properties.
     * @throws IgniteException In case of error.
     */
    public HadoopIgfsProperties(Map<String, String> props) throws IgniteException {
        usrName = props.get(PROP_USER_NAME);
        grpName = props.get(PROP_GROUP_NAME);

        String permStr = props.get(PROP_PERMISSION);

        if (permStr != null) {
            try {
                perm = new FsPermission((short)Integer.parseInt(permStr, 8));
            }
            catch (NumberFormatException ignore) {
                throw new IgniteException("Permissions cannot be parsed: " + permStr);
            }
        }
    }

    /**
     * Get user name.
     *
     * @return User name.
     */
    public String userName() {
        return usrName;
    }

    /**
     * Get group name.
     *
     * @return Group name.
     */
    public String groupName() {
        return grpName;
    }

    /**
     * Get permission.
     *
     * @return Permission.
     */
    public FsPermission permission() {
        return perm;
    }
}


text:
/* this typedef goes here because it is needed by add */

typedef struct multiseq_struct {
    int			not_logically_stopped_cnt;
    int			nchans;
    /* greatest lower bound on logical stop time: */
    time_type		horizon;
    /* lowest time corresp to sample count on a snd_list: */
    time_type	        low_water;
    snd_list_type	*chans;
    time_type		t0;
    rate_type		sr;
    LVAL closure;
} multiseq_node, *multiseq_type;

LVAL snd_make_multiseq(LVAL s1, LVAL closure);
    /* LISP: (SND-MULTISEQ ANY ANY) */


text:
- Add `kubernetes_resource` field ([commit d03595e](https://github.com/googleapis/google-cloud-dotnet/commit/d03595ea86e200b93c35f761a358cbf6346ebbe2))

### Documentation improvements

- Update API annotation ([commit d03595e](https://github.com/googleapis/google-cloud-dotnet/commit/d03595ea86e200b93c35f761a358cbf6346ebbe2))

## Version 1.1.0, released 2021-08-31

- [Commit ac367e2](https://github.com/googleapis/google-cloud-dotnet/commit/ac367e2): feat: Regenerate all APIs to support self-signed JWTs

## Version 1.0.0, released 2021-08-16

No API surface changes; just dependency updates and promotion to GA.

## Version 1.0.0-beta01, released 2021-07-21

Initial release.


text:
describe('snapshot() Should ', function () {
    const basicConfig = {
        children: [
            {
                type: "row",
                children: [
                    {
                        type: "window",
                        appName: "dummyApp"
                    }
                ]
            }
        ]
    }
    let workspace = undefined;

    before(() => coreReady);

    beforeEach(async () => {
        workspace = await glue.workspaces.createWorkspace(basicConfig);
    })

    afterEach(async () => {
        const frames = await glue.workspaces.getAllFrames();
        await Promise.all(frames.map((f) => f.close()));
    });

    it("return a promise", () => {
        expect(workspace.snapshot().then).to.be.a("function");
        expect(workspace.snapshot().catch).to.be.a("function");
    });

    it("resolve", async () => {
        await workspace.snapshot();
    });

    it("have the correct id", async () => {
        const snapshot = await workspace.snapshot();

        expect(snapshot.id).to.eql(workspace.id);
    });

    //TODO test all other properties
});


text:
author: robmyers
comments: true
date: 2008-01-11 03:25:58+00:00
layout: post
slug: data-visualization-and-corporate-information-culture
title: Data Visualization And Corporate Information Culture
wordpress_id: 1558
categories:
- Aesthetics
- Generative Art
---

[Create Digital Motion » Visualizing Data, and Data as Art](http://createdigitalmotion.com/2008/01/10/visualizing-data-and-data-as-art/)

_Regine at We Make Money Not Art has a fantastic overview summarizing a recent workshop of presenting data and numbers visually [...]
What happens when data artists and interaction designers collide with VJs and digital musicians? I'm excited to find out._

[Systems Art - Not Quite The Belaqua Pose - A talk in three voices](http://systemsart.org/a_lpaper.html)

_[...] a corporatist knowledge culture which has flattened literature, art and the rest of the so-called Humanities into information [...]_


text:
source config.sh

echo -e "Starting Daytona Installation ...\n"

echo -e "Updating Ubuntu ...\n"
# update & upgrade #
sudo apt-get -y  update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade

echo -e "Installing MySQL...\n"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '${db_root_pass}
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '${db_root_pass}
sudo apt-get install mysql-server mysql-client -y

echo -e "Setting Daytona Database Configuration...\n"

sudo service mysql start

mysql -uroot -p${db_root_pass} -e "CREATE USER '${db_user}'@'${db_host}' IDENTIFIED BY '${db_password}';"
mysql -uroot -p${db_root_pass} -e "CREATE DATABASE ${db_name};"
mysql -uroot -p${db_root_pass} -e "GRANT ALL PRIVILEGES ON ${db_name}.* TO '${db_user}'@'${db_host}';"
mysql -uroot -p${db_root_pass} -e "FLUSH PRIVILEGES;"

echo -e "Creating all required daytona tables in Database...\n"
mysql -u${db_user} -p${db_password} ${db_name} < ../../DbSchema/DbSchema.sql


text:
system_info_dir  = '/usr/local/system_info'
system_info_dest = '/usr/share/travis'
rvm_source = "#{node['travis_build_environment']['home']}/.rvm/scripts/rvm"

git system_info_dir do
  repository 'https://github.com/travis-ci/system_info.git'
  revision 'master'
  action :sync
end

execute "set owner on #{system_info_dir}" do
  command "chown -R #{node['travis_build_environment']['user']}:#{node['travis_build_environment']['group']} #{system_info_dir}"
end

execute "remove #{system_info_dest}" do
  command "rm -rf #{system_info_dest}"
end

bash 'Install system_info gems' do
  user node['travis_build_environment']['user']
  cwd system_info_dir
  code <<-EOF
    [[ -f #{rvm_source} ]] && source #{rvm_source}
    bundle install --deployment
  EOF
  only_if { node['system_info']['use_bundler'] }
end

directory system_info_dest do
  owner node['travis_build_environment']['user']
  group node['travis_build_environment']['group']
  recursive true
end

bash 'execute-system_info' do
  user node['travis_build_environment']['user']
  cwd system_info_dir
  code <<-EOF
    [[ -f #{rvm_source} ]] && source #{rvm_source}
    #{node['system_info']['use_bundler'] ? 'bundle exec' : ''} ./bin/system_info #{node['system_info']['cookbooks_sha'] || 'fffffff'}
  EOF
  environment(
    'FORMATS' => 'human,json',
    'HUMAN_OUTPUT' => "#{system_info_dest}/system_info",
    'JSON_OUTPUT' => "#{system_info_dest}/system_info.json",
    'COMMANDS_FILE' => node['system_info']['commands_file']
  )
end


text:
package info.dc4j.toolbox.block.math;

import java.util.List;

import info.dc4j.toolbox.block.Block;
import info.dc4j.toolbox.block.BlockImpl;
import info.dc4j.toolbox.element.Parameter;

public class Sum extends BlockImpl {

  public static final String DESC = "sum inputs";

  public interface Size {
    int U_D = 2;
    int U_B = 0;
    int Y_D = 1;
    int Y_B = 0;
    int S_D = 0;
    int S_B = 0;
  }

  public Sum(int id, String name) {
    super(id, name, Size.U_D, Size.Y_D, Size.U_B, Size.Y_B, Size.S_D, Size.S_B);
    setDesc(DESC);
  }

  @Override
  protected void eval() {
    double u0 = u.getD(0).get();
    double u1 = u.getD(1).get();
    double y0 = u0 + u1;
    y.getD(0).set(y0);
  }

  @Override
  public Block.Type blockType() {
    return Block.Type.SUM;
  }

  @Override
  public List<Parameter> getParameters(boolean defaults) {
    return null;
  }

  @Override
  public void setParameters(List<Parameter> params) {
    throw new IllegalArgumentException("wrong parameter");
  }

}


text:
module Nit
  class Command
    class Push < Command
      def call(args, original=`git branch`)
        branch = current_branch_for(original)

        system("git #{command} origin #{branch} #{args.join(" ")}")
      end

    private
      def command
        "push"
      end

      def current_branch_for(screen)
        screen.match(/\* (.+)/)[1].strip
      end
    end
  end
end


text:
require_relative 'base'

module Swaggard
  module Swagger
    module Parameters
      class Query < Base

        def initialize(string)
          @in = 'query'
          parse(string)
        end

        def to_doc
          doc = super

          doc.merge!('enum' => @options) if @options.any?

          doc
        end

        private

        # Example: [Array]     status            Filter by status. (e.g. status[]=1&status[]=2&status[]=3)
        # Example: [Array]     status(required)  Filter by status. (e.g. status[]=1&status[]=2&status[]=3)
        # Example: [Integer]   media[media_type_id]                          ID of the desired media type.
        def parse(string)
          data_type, name, required, options_and_description = string.match(/\A\[(\S*)\]\s*([\w\[\]]*)(\(required\))?\s*(.*)\Z/).captures
          allow_multiple = name.gsub!('[]', '')

          options, description = options_and_description.match(/\A(\[.*\])?(.*)\Z/).captures
          options = options ? options.gsub(/\[?\]?\s?/, '').split(',') : []

          @name = name
          @description = description
          @data_type = data_type.downcase
          @is_required = required.present?
          @allow_multiple = allow_multiple.present?
          @options = options
        end

      end
    end
  end
end


text:
package nl.weeaboo.styledtext.gdx;

public final class TestSentences {

    public static final String ALPHANUMERIC =
            "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n" +
            "abcdefghijklmnopqrstuvwxyz\n" +
            "0123456789";

    public static final String ASCII_SYMBOLS =
            "!@#$%^&*?_-+=<>()[]{},.;:'\"";

    /** Popular non-ASCII characters */
    public static final String UNICODE_SYMBOLS =
            "—…";

    private TestSentences() {
    }

}


text:
package org.springframework.boot.autoconfigure.jdbc;

import javax.sql.DataSource;

import com.zaxxer.hikari.HikariDataSource;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * Actual DataSource configurations imported by {@link DataSourceAutoConfiguration}.
 *
 * @author Dave Syer
 * @author Phillip Webb
 * @author Stephane Nicoll
 */
abstract class DataSourceConfiguration {

	@SuppressWarnings("unchecked")
	protected <T> T createDataSource(DataSourceProperties properties,
			Class<? extends DataSource> type) {
		return (T) DataSourceBuilder.create(properties.getClassLoader()).type(type)
				.driverClassName(properties.determineDriverClassName())
				.url(properties.determineUrl()).username(properties.determineUsername())
				.password(properties.determinePassword()).build();
	}

	@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
	@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
	static class Tomcat extends DataSourceConfiguration {

		@Bean
		@ConfigurationProperties("spring.datasource.tomcat")
		public org.apache.tomcat.jdbc.pool.DataSource dataSource(
				DataSourceProperties properties) {
			return createDataSource(properties,
					org.apache.tomcat.jdbc.pool.DataSource.class);
		}

	}

	@ConditionalOnClass(HikariDataSource.class)
	@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
	static class Hikari extends DataSourceConfiguration {

		@Bean
		@ConfigurationProperties("spring.datasource.hikari")
		public HikariDataSource dataSource(DataSourceProperties properties) {
			return createDataSource(properties, HikariDataSource.class);
		}
	}

	@ConditionalOnClass(org.apache.commons.dbcp.BasicDataSource.class)
	@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp.BasicDataSource", matchIfMissing = true)
	static class Dbcp extends DataSourceConfiguration {

		@Bean
		@ConfigurationProperties("spring.datasource.dbcp")
		public org.apache.commons.dbcp.BasicDataSource dataSource(
				DataSourceProperties properties) {
			return createDataSource(properties,
					org.apache.commons.dbcp.BasicDataSource.class);
		}
	}

	@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
	@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
	static class Dbcp2 extends DataSourceConfiguration {

		@Bean
		@ConfigurationProperties("spring.datasource.dbcp2")
		public org.apache.commons.dbcp2.BasicDataSource dataSource(
				DataSourceProperties properties) {
			return createDataSource(properties,
					org.apache.commons.dbcp2.BasicDataSource.class);
		}
	}

}


text:
'use strict';

/**
 * Module dependencies.
 */
var usuariosPolicy = require('../policies/usuarios.server.policy'),
  usuarios = require('../controllers/usuarios.server.controller');

module.exports = function (app) {
  // Usuarios collection routes
  app.route('/api/usuarios').all(usuariosPolicy.isAllowed)
    .get(usuarios.list);

  app.route('/api/registrarusuario').all(usuariosPolicy.isAllowed)
    .post(usuarios.create);

  app.route('/api/login').all(usuariosPolicy.isAllowed)
    .post(usuarios.login);

  app.route('/api/recuperarcontrasenia').all(usuariosPolicy.isAllowed)
    .post(usuarios.recuperarcontrasenia);

  app.route('/api/editarperfil').all(usuariosPolicy.isAllowed)
    .post(usuarios.editarperfil);

  // Single usuario routes
  app.route('/api/usuarios/:usuarioId').all(usuariosPolicy.isAllowed)
    // .get(usuarios.read)
    // .put(usuarios.update)
    .delete(usuarios.delete);

  app.route('/api/getDetailCustomer').all(usuariosPolicy.isAllowed)
    .post(usuarios.getDetailCustomer);

  // Finish by binding the usuario middleware
  app.param('usuarioId', usuarios.usuarioByID);
  app.param('IdUsuario', usuarios.usuarioByIdUsuario);
};


text:
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>

    <link href="Content/bootstrap.css" rel="stylesheet" />

</head>
<body>

</body>
</html>


text:
import edu.columbia.main.db.DAO;
import edu.columbia.main.db.Models.Tweet;
import edu.columbia.main.db.MongoDB;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Test;

/**
 * Created by Gideon on 10/1/15.
 */
public class TestDAO {

    @Test
    public void testInsert(){
        String data = "Исламын бүлэглэлүүд нь Узбек, Тажик, Киргиз улсыг хамарсан Ферганын хөндийд байрлаж байна";
        String url = "http://twitter.com/sukhee56/status/640834315731910656";
        Tweet tweet = new Tweet(data,data,"tst","sukhee56",null,"topsy",url,"640834315731910656","filename");

        DAO.saveEntry(tweet,"testing");
        Assert.assertFalse(DAO.isNew(tweet,"testing"));
    }

    @Test
    public void testIsNew(){
        String data = "blba bla bla ";
        String url = "http://twitter.com/sukhee56/status/640834315731910656";
        Tweet tweet = new Tweet(data,data,"tst","sukhee56",null,"topsy",url,"640834315731910656","filename");

        DAO.saveEntry(tweet,"testing");
        Assert.assertFalse(DAO.isNew(tweet,"testing"));

        data = "just some data";
        url = "http://twitter.com/sukhee56/status/640834315731910656";
        tweet = new Tweet(data,data,"tst","sukhee56",null,"topsy",url,"640834315731910656","filename");

        Assert.assertTrue(DAO.isNew(tweet, "testing"));

    }

    @After
    public void tearDown(){
        MongoDB.INSTANCE.getDatabase("testing").drop();
    }

}


text:
#import "UIViewController.h"

#import "PSController-Protocol.h"

@class PSRootController, PSSpecifier, UIViewController<PSController>;

@interface PSViewController : UIViewController <PSController>
{
    UIViewController<PSController> *_parentController;
    PSRootController *_rootController;
    PSSpecifier *_specifier;
}

- (void)statusBarWillAnimateByHeight:(double)arg1;
- (_Bool)canBeShownFromSuspendedState;
- (void)formSheetViewDidDisappear;
- (void)formSheetViewWillDisappear;
- (void)popupViewDidDisappear;
- (void)popupViewWillDisappear;
- (void)handleURL:(id)arg1;
- (void)pushController:(id)arg1;
- (void)didWake;
- (void)didUnlock;
- (void)willUnlock;
- (void)didLock;
- (void)suspend;
- (void)willBecomeActive;
- (void)willResignActive;
- (id)readPreferenceValue:(id)arg1;
- (void)setPreferenceValue:(id)arg1 specifier:(id)arg2;
- (id)specifier;
- (void)setSpecifier:(id)arg1;
- (void)dealloc;
- (id)rootController;
- (void)setRootController:(id)arg1;
- (id)parentController;
- (void)setParentController:(id)arg1;

@end


text:
'use strict';

import headerDirective from './header.directive';
import './header.scss';

const headerModule = angular.module('header-module', []);

headerModule
  .directive('headerComponent', headerDirective);

export default headerModule;


text:
package com.bentech.android.appcommons.validator;

import android.view.View;
import android.widget.EditText;

import com.bentech.android.appcommons.AppCommons;
import com.bentech.android.appcommons.utils.EditTextUtils;
import com.google.common.primitives.Doubles;

/**
 * Created by Daniel on 9/11/2015.
 */
public class EditTextPositiveNumberedInputValidator extends EditTextValidator {

    public EditTextPositiveNumberedInputValidator(EditText editText) {
        super(editText, AppCommons.getAppCommonsConfiguration().getEditTextInvalidPositiveNumberErrorMessage());
    }

    @Override
    public boolean isValid() {
        if (EditTextUtils.testIsEmpty(editText))
            return false;
        return editText.getVisibility() != View.VISIBLE ||
                (Doubles.tryParse(EditTextUtils.getText(editText)) != null && Double.parseDouble(EditTextUtils.getText(editText)) >= 0);
    }

}


text:
package collabware.collaboration.internal.context;

import static collabware.collaboration.internal.context.ContextHelper.clientNumberOf;
import static collabware.collaboration.internal.context.ContextHelper.contextOf;
import static collabware.collaboration.internal.context.ContextHelper.ownSequenceNumberOf;
import collabware.api.operations.context.Context;
import collabware.api.operations.context.ContextDifference;
import collabware.api.operations.context.ContextualizedOperation;
import collabware.api.operations.context.NonConsecutiveContextException;
import collabware.api.operations.context.OperationsSet;
/**
 *  A vector-based implementation of an Context.
 *  The underlying vector has one sequence number per client and gets
 *  incremented with every operation performed by the corresponding client.
 *  Just by looking a vector, we can very quickly decide whether an operation is
 *  include in a context and whether a context is a sub-context of another. This is
 *  very important for the performance of the transformation algorithm.
 *
 */
public class VectorBasedContext implements Context {

	private final ContextVector sequenceNumbers;
	private final int clientNumber;

	public VectorBasedContext(int client, int[] sequenceNumbers) {
		this(client, new ContextVector(sequenceNumbers));
	}

	public VectorBasedContext(int client) {
		this(client, new int[0]);
	}

	public VectorBasedContext(int client, ContextVector contextVector) {
		this.clientNumber = client;
		this.sequenceNumbers = contextVector;
	}

	/**
	 * @param operation the operation to include
	 * @return new Context, which includes operation o.
	 * @throws NonConsecutiveContextException
	 */
	public Context including(ContextualizedOperation operation)  {
		assertCanInclude(contextOf(operation));
		ContextVector includingContextVector = sequenceNumbers.updating(clientNumberOf(operation), ownSequenceNumberOf(operation));
		return new VectorBasedContext(getClientNumber(), includingContextVector );
	}

	public Context including(Context context)  {
		assertCanInclude((VectorBasedContext)context);
		ContextVector includingContextVector = sequenceNumbers.updating(context.getClientNumber(), nextSequenceNumberOf(context));
		return new VectorBasedContext(getClientNumber(), includingContextVector );
	}

	private int nextSequenceNumberOf(Context context) {
		return ((VectorBasedContext) context).getSequenceNumbers().get(context.getClientNumber())+1;
	}

	private void assertCanInclude(VectorBasedContext otherContext) {
		int otherClientNumber = otherContext.getClientNumber();
		if (!otherContext.isSubsetOf(this) && !equalSequenceNumbersAt(otherClientNumber, otherContext))
			throw new NonConsecutiveContextException();
	}

	private boolean equalSequenceNumbersAt(int index, VectorBasedContext otherContext) {
		return this.sequenceNumbers.get(index) == otherContext.sequenceNumbers.get(index);
	}

	public boolean contains(ContextualizedOperation o) {
		try {
			return o.getSelfIncludingContext().isSubsetOf(this);
		} catch (NonConsecutiveContextException cannotHappen) {
			return false;
		}
	}

	public boolean isSubsetOf(OperationsSet superContext) {
		VectorBasedContext superContextImpl = (VectorBasedContext) superContext;
		return this.sequenceNumbers.lessThanOrEqual(superContextImpl.sequenceNumbers);
	}

	public int getClientNumber() {
		return clientNumber;
	}

	public ContextDifference minus(OperationsSet subtrahend) {
		return new ContextDifferenceImpl(this, (VectorBasedContext) subtrahend);
	}

	public ContextVector getSequenceNumbers() {
		return sequenceNumbers;
	}

	public int hashCode() {
		return 17*sequenceNumbers.hashCode();
	}

	@Override
	public boolean equals(Object o) {
		if (o == this) return true;
		if (o instanceof Context) return equalsContext((VectorBasedContext) o);
		return false;
	}

	private boolean equalsContext(Context context) {
		ContextVector otherSequenceNumbers = ((VectorBasedContext)context ).getSequenceNumbers();
		return sequenceNumbers.equals(otherSequenceNumbers);
	}

	@Override
	public String toString() {
		return "sequenceNumbers: "+sequenceNumbers+", clientNumber: " + clientNumber;
	}

	public Context next() {
		return new VectorBasedContext(clientNumber, sequenceNumbers.incrementing(clientNumber));
	}

}


text:
//
//  JPSDisplayLink.h
//  JPSDisplayLink
//
//  Created by JP Simard on 1/12/2014.
//  Copyright (c) 2014 JP Simard. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void (^JPSDisplayLinkBlock)(CGFloat progress);

@interface JPSDisplayLink : NSObject

/**
 Deprecated to fall in line with Apple's suggested best practices for method declarations with blocks
 https://developer.apple.com/library/ios/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html
*/

+ (void)runDisplayLinkBlock:(JPSDisplayLinkBlock)block duration:(CFTimeInterval)duration __attribute__((deprecated));

/**
 This block is called multiple times.
 The CGFloat progress is between 0.0 and 1.0 based on the percentage
 of the total duration that has elapsed since the begininning of execution.
*/

+ (void)runDisplayLinkWithDuration:(CFTimeInterval)duration block:(JPSDisplayLinkBlock)block;

@end


text:
package storm.kafka.bolt;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.IRichBolt;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;
import backtype.storm.tuple.Values;
public class WordNormalizer implements IRichBolt{
    private OutputCollector collector;
    public void cleanup(){}

    public void execute(Tuple input){
        String sentence = input.getString(0);
        String[] words = sentence.split(" ");
        for(String word : words){
            word = word.trim();
            if(!word.isEmpty()){
                word=word.toLowerCase();
                List a = new ArrayList();
                a.add(input);
                collector.emit(a,new Values(word));
            }
        }

        collector.ack(input);
    }
    public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
        this.collector=collector;
    }

    public void declareOutputFields(OutputFieldsDeclarer declarer) {
        declarer.declare(new Fields("word"));
    }

	@Override
	public Map<String, Object> getComponentConfiguration() {
		// TODO Auto-generated method stub
		return null;
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using JetBrains.Annotations;
using Orchard.ContentManagement.Drivers;
using WebStore.Models;
using Orchard.UI.Notify;
using Orchard;
using Orchard.Localization;
using WebStore.Services;
using Magelia.WebStore.Services.Contract;
using System.Threading;
using System.Web.Mvc;

namespace WebStore.Drivers
{
    [UsedImplicitly]
    public class WebStoreConfigurationPartDriver : ContentPartDriver<WebStoreConfigurationPart>
    {
        private const String TemplateName = "Parts/Webstore.Configuration";
        private readonly INotifier _notifier;
        public Localizer T { get; set; }

        public WebStoreConfigurationPartDriver(INotifier notifier, IOrchardServices services)
        {
            this._notifier = notifier;
            this.T = NullLocalizer.Instance;
        }

        protected override DriverResult Editor(WebStoreConfigurationPart part, dynamic shapeHelper)
        {
            part.Merchants = new List<SelectListItem>();
            part.Catalogs = new List<SelectListItem>();
            if (part != default(WebStoreConfigurationPart) && part.IsComplete)
            {
                try
                {
                    WebStoreServices webstoreServices = new WebStoreServices(part);
                    part.Merchants.AddRange(webstoreServices.CreateWebStoreChannel<IProfileService>().GetMerchants().OrderBy(m => m.Name).Select(m => new SelectListItem { Text = m.Name, Value = m.MerchantId.ToString(), Selected = m.MerchantId == part.MerchantId.Value }));
                    part.Catalogs.AddRange(webstoreServices.CreateWebStoreChannel<ICatalogService>().GetCatalogs(new GetCatalogsParameters { CultureName = Thread.CurrentThread.CurrentUICulture.Name, MerchantId = part.MerchantId.Value }).OrderBy(c => c.Name).Select(c => new SelectListItem { Text = String.IsNullOrEmpty(c.Name) ? c.Code : c.Name, Value = c.CatalogId.ToString(), Selected = c.CatalogId == part.CatalogId.Value }));
                }
                catch (Exception)
                {
                    this._notifier.Error(this.T("Unable to contact configured WebServices"));
                }
            }
            return this.ContentShape("Parts_WebStore_Configuration", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: part, Prefix: this.Prefix));
        }

        protected override DriverResult Editor(WebStoreConfigurationPart part, Orchard.ContentManagement.IUpdateModel updater, dynamic shapeHelper)
        {
            if (updater.TryUpdateModel(part, this.Prefix, null, null))
            {
                this._notifier.Information(this.T("WebStore configuration updated successfully"));
            }
            else
            {
                this._notifier.Information(this.T("Error during WebStore configuration update"));
            }
            return this.Editor(part, shapeHelper);
        }
    }
}


text:
package roadgraph.searchalgorithms.impl;

import geography.GeographicPoint;
import roadgraph.graphsenities.MapEdge;
import roadgraph.graphsenities.MapNode;
import roadgraph.searchalgorithms.api.SearchAlgo;

import java.util.*;
import java.util.function.Consumer;

public class BFSAlgo extends SearchAlgo {
    public BFSAlgo(Map<MapNode, List<MapEdge>> graph) {
        super(graph);
    }

    @Override
    public boolean findPath(MapNode startNode, MapNode goalNode, Consumer<GeographicPoint> nodeSearched,
                            List<GeographicPoint> result) {
        if (isInputValid(startNode, goalNode, nodeSearched, result)) {
            Queue<MapNode> queue = new LinkedList<>();
            Set<MapNode> visitedVertices = new HashSet<>();
            Map<MapNode, MapNode> parentMap = new HashMap<>();
            visitedVertices.add(startNode);
            queue.add(startNode);
            nodeSearched.accept(startNode.getLocation());
            while (!queue.isEmpty()) {
                MapNode current = queue.remove();
                if (current.equals(goalNode)) {
                    constructPath(parentMap, goalNode, result);
                    return true;
                } else {
                    for (MapEdge edge : graph.get(current)) {
                        MapNode neighbour = edge.getOtherNode(current);
                        if (!visitedVertices.contains(neighbour)) {
                            queue.add(neighbour);
                            visitedVertices.add(neighbour);
                            parentMap.put(neighbour, current);
                            nodeSearched.accept(neighbour.getLocation());
                        }
                    }
                }
            }
            return false;
        } else {
            return false;
        }
    }
}


text:
package jsonpath

import (
	"context"

	"github.com/PaesslerAG/gval"
)

// New returns an selector for given JSONPath
func New(path string) (gval.Evaluable, error) {
	return lang.NewEvaluable(path)
}

//Get executes given JSONPath on given value
func Get(path string, value interface{}) (interface{}, error) {
	eval, err := lang.NewEvaluable(path)
	if err != nil {
		return nil, err
	}
	return eval(context.Background(), value)
}

var lang = gval.NewLanguage(
	gval.Base(),
	gval.PrefixExtension('$', single(getRootEvaluable).parse),
	gval.PrefixExtension('@', single(getCurrentEvaluable).parse),
)

//Language is the JSONPath Language
func Language() gval.Language {
	return lang
}

var placeholderExtension = gval.NewLanguage(
	lang,
	gval.PrefixExtension('{', parseJSONObject),
	gval.PrefixExtension('#', parsePlaceholder),
)

//PlaceholderExtension is the JSONPath Language with placeholder
func PlaceholderExtension() gval.Language {
	return placeholderExtension
}


text:
FROM ubuntu:14.04

MAINTAINER Meir Wahnon

RUN apt-get update -y

RUN apt-get install git -y --fix-missing

RUN apt-get update -qq && apt-get install -y python python-pip python-dev

RUN  git clone https://git.openstack.org/openstack-dev/devstack

ADD local.conf devstack/

WORKDIR devstack/tools/

RUN ./create-stack-user.sh

WORKDIR /devstack/

RUN su -m stack ./stack.sh


text:
#ifndef TEX_UTIL_HEADER
#define TEX_UTIL_HEADER

#include <string>
#include <vector>
#include <fstream>
#include <cstring>
#include <cerrno>
#include <cassert>

#include <Eigen/Core>

#include "util/exception.h"
#include "util/file_system.h"

#include "math/vector.h"
#include "math/matrix.h"
#include "math/functions.h"

/**
 * Converts an MVE matrix into an Eigen matrix.
 */
template <typename T, int M, int N> Eigen::Matrix<T,M,N>
mve_to_eigen(math::Matrix<T, M, N> const & mat) {
    Eigen::Matrix<T, M, N> ret;
    for (int m = 0; m < M; ++m)
        for (int n = 0; n < N; ++n)
            ret(m, n) = mat(m, n);
    return ret;
}

/**
 * Converts an MVE vector into an Eigen row vector.
 */
template <typename T, int N> Eigen::Matrix<T, 1, N>
mve_to_eigen(math::Vector<T, N> const & vec) {
    Eigen::Matrix<T, 1, N> ret;
    for (int n = 0; n < N; ++n)
        ret(0, n) = vec(n);
    return ret;
}

/**
 * A multi-variate normal distribution which is NOT normalized such that the integral is 1.
 *
 * @param X is the vector for which the function is to be evaluated. Must have size 1xN.
 * @param mu is the mean around which the distribution is centered. Must have size 1xN.
 * @param covariance_inv is the INVERSE of the covariance matrix. Must have size NxN.
 * @return \f$\exp(-\frac{1}{2} (X-\mbox{mu})^T \cdot \mbox{covariance\_inv} \cdot (X-\mbox{mu}))\f$
 */
template <typename T, int N> T const
multi_gauss_unnormalized(Eigen::Matrix<T, 1, N> const & X, Eigen::Matrix<T, 1, N> const & mu,
    Eigen::Matrix<T, N, N> const & covariance_inv) {

    Eigen::Matrix<T, 1, N> mean_removed = X - mu;
    return std::exp(T(-0.5) * mean_removed * covariance_inv * mean_removed.adjoint());
}

/** Return the number suffix for n, e.g. 3 -> "rd". */
inline
std::string number_suffix(int n) {
    if (n % 100 == 11 || n % 100 == 12 || n % 100 == 13)
        return "th";
    if (n % 10 == 1)
        return "st";
    if (n % 10 == 2)
        return "nd";
    if (n % 10 == 3)
        return "rd";
    return "th";
}

/**
  * Write vector to csv file with "Index, $header" as header.
  * @throws util::FileException
  */
template <typename T> void
write_vector_to_csv(std::string const & filename, std::vector<T> const & vector, std::string const & header) {
    std::ofstream out(filename.c_str());
    if (!out.good())
        throw util::FileException(filename, std::strerror(errno));

    out << "Index, "<< header << std::endl;
    for (std::size_t i = 0; i < vector.size(); i++){
        out << i << ", " << vector[i] << std::endl;
    }
    out.close();
}

/**
  * Write vector to binary file.
  * @throws util::FileException
  */
template <typename T> void
vector_to_file(std::string const & filename, std::vector<T> const & vector) {
    std::ofstream out(filename.c_str(), std::ios::binary);
    if (!out.good())
        throw util::FileException(filename, std::strerror(errno));

    out.write(reinterpret_cast<const char*>(&vector[0]), vector.size()*sizeof(T));
    out.close();
}

/**
  * Loads vector from binary file.
  * @throws util::FileException
  */
template <typename T> std::vector<T>
vector_from_file(std::string const & filename) {
    std::ifstream in(filename.c_str(), std::ios::binary);
    if (!in.good())
        throw util::FileException(filename, std::strerror(errno));
    in.seekg (0, in.end);
    const size_t filesize = in.tellg();
    in.seekg (0, in.beg);
    const size_t num_elements = filesize / sizeof(T);
    std::vector<T> vector(num_elements);
    in.read(reinterpret_cast<char*>(&vector[0]), num_elements*sizeof(T));
    in.close();
    return vector;
}

/**
  * Writes the given string to the file given by filename.
  * @throws util::FileException
  */
inline void
write_string_to_file(std::string const & filename, std::string const & string) {
    std::ofstream out(filename.c_str());
    if (!out.good())
        throw util::FileException(filename, std::strerror(errno));

    out << string;
    out.close();
}

/**
  * returns the corresponding jet color encoding for the given value.
  * @warning asserts values within the interval [0, 1]
  */
inline math::Vec4f
get_jet_color(float value) {
    assert(0.0f <= value && value <= 1.0f);
    float mvalue = 4 * value;
    float red   = math::clamp(std::min(mvalue - 1.5f, -mvalue + 4.5f));
    float green = math::clamp(std::min(mvalue - 0.5f, -mvalue + 3.5f));
    float blue  = math::clamp(std::min(mvalue + 0.5f, -mvalue + 2.5f));
    return math::Vec4f(red, green, blue, 1.0f);
}

#endif /* TEX_UTIL_HEADER */


text:
define([
    'ko',
    '../template/renderer'
], function (ko, renderer) {
    'use strict';

    ko.bindingHandlers.keyboard = {

        /**
         * Attaches keypress handlers to element
         * @param {HTMLElement} el - Element, that binding is applied to
         * @param {Function} valueAccessor - Function that returns value, passed to binding
         * @param  {Object} allBindings - all bindings object
         * @param  {Object} viewModel - reference to viewmodel
         */
        init: function (el, valueAccessor, allBindings, viewModel) {
            var map = valueAccessor();

            ko.utils.registerEventHandler(el, 'keyup', function (e) {
                var callback = map[e.keyCode];

                if (callback) {
                    return callback.call(viewModel, e);
                }
            });
        }
    };

    renderer.addAttribute('keyboard');
});


text:
/**
 * @generated SignedSource<<557aa8ddf72c01624345575f05253e41>>
 * @lightSyntaxTransform
 * @nogrep
 */

/* tslint:disable */
/* eslint-disable */
// @ts-nocheck

import { Fragment, ReaderFragment } from 'relay-runtime';
import { FragmentRefs } from "relay-runtime";
export type ShippingArtaSummaryItem_order$data = {
  readonly lineItems: {
    readonly edges: ReadonlyArray<{
      readonly node: {
        readonly selectedShippingQuote: {
          readonly price: string | null;
          readonly typeName: string;
        } | null;
      } | null;
    } | null> | null;
  } | null;
  readonly requestedFulfillment: {
    readonly __typename: string;
  } | null;
  readonly " $fragmentType": "ShippingArtaSummaryItem_order";
};
export type ShippingArtaSummaryItem_order$key = {
  readonly " $data"?: ShippingArtaSummaryItem_order$data;
  readonly " $fragmentSpreads": FragmentRefs<"ShippingArtaSummaryItem_order">;
};

const node: ReaderFragment = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "ShippingArtaSummaryItem_order",
  "selections": [
    {
      "alias": null,
      "args": null,
      "concreteType": null,
      "kind": "LinkedField",
      "name": "requestedFulfillment",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "__typename",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "CommerceLineItemConnection",
      "kind": "LinkedField",
      "name": "lineItems",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "CommerceLineItemEdge",
          "kind": "LinkedField",
          "name": "edges",
          "plural": true,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "CommerceLineItem",
              "kind": "LinkedField",
              "name": "node",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "CommerceShippingQuote",
                  "kind": "LinkedField",
                  "name": "selectedShippingQuote",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "typeName",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": [
                        {
                          "kind": "Literal",
                          "name": "precision",
                          "value": 2
                        }
                      ],
                      "kind": "ScalarField",
                      "name": "price",
                      "storageKey": "price(precision:2)"
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ],
  "type": "CommerceOrder",
  "abstractKey": "__isCommerceOrder"
};

(node as any).hash = "53837b0dfca37358282774a18a4cdb5a";

export default node;