text:
package function

import (
	"fmt"

	"github.com/pkg/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

	"github.com/fission/fission/pkg/fission-cli/cliwrapper/cli"
	"github.com/fission/fission/pkg/fission-cli/cmd"
	flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
)

type GetMetaSubCommand struct {
	cmd.CommandActioner
}

func GetMeta(input cli.Input) error {
	return (&GetMetaSubCommand{}).do(input)
}

func (opts *GetMetaSubCommand) do(input cli.Input) error {
	_, namespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
	if err != nil {
		return errors.Wrap(err, "error in getting meta function ")
	}

	fn, err := opts.Client().FissionClientSet.CoreV1().Functions(namespace).Get(input.Context(), input.String(flagkey.FnName), metav1.GetOptions{})
	if err != nil {
		return errors.Wrap(err, "error getting function")
	}

	fmt.Printf("Name: %v\n", fn.ObjectMeta.Name)
	fmt.Printf("Environment: %v\n", fn.Spec.Environment.Name)
	if len(fn.ObjectMeta.Labels) != 0 {
		fmt.Println("Labels:")
		for k, v := range fn.ObjectMeta.Labels {
			fmt.Printf("  %s=%s\n", k, v)
		}
	}
	if len(fn.ObjectMeta.Annotations) != 0 {
		fmt.Println("Annotations:")
		for k, v := range fn.ObjectMeta.Annotations {
			fmt.Printf("  %s=%s\n", k, v)
		}
	}

	return nil
}


text:
// Type definitions for loader-utils 2.0
// Project: https://github.com/webpack/loader-utils#readme
// Definitions by: Gyusun Yeom <https://github.com/Perlmint>
//                 Totooria Hyperion <https://github.com/TotooriaHyperion>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
//                 Jesse Katsumata <https://github.com/Naturalclar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

import { loader } from 'webpack';

export type Readonly<T> = {
    readonly [P in keyof T]: T[P];
};

export interface InterpolateOption {
    context?: string;
    content?: string | Buffer;
    regExp?: string | RegExp;
}

export interface OptionObject {
    [key: string]: null | false | true | string;
}

export type HashType = 'sha1' | 'md4' | 'md5' | 'sha256' | 'sha512';

export type DigestType = 'hex' | 'base26' | 'base32' | 'base36' | 'base49' | 'base52' | 'base58' | 'base62' | 'base64';

/**
 * Recommended way to retrieve the options of a loader invocation
 * {@link https://github.com/webpack/loader-utils#getoptions}
 */
export function getOptions(loaderContext: loader.LoaderContext): Readonly<OptionObject>;

/**
 * Parses a passed string (e.g. loaderContext.resourceQuery) as a query string, and returns an object.
 * {@link https://github.com/webpack/loader-utils#parsequery}
 */
export function parseQuery(optionString: string): OptionObject;

/**
 * Turns a request into a string that can be used inside require() or import while avoiding absolute paths. Use it instead of JSON.stringify(...) if you're generating code inside a loader.
 * {@link https://github.com/webpack/loader-utils#stringifyrequest}
 */
export function stringifyRequest(loaderContext: loader.LoaderContext, resource: string): string;

export function getRemainingRequest(loaderContext: loader.LoaderContext): string;

export function getCurrentRequest(loaderContext: loader.LoaderContext): string;

export function isUrlRequest(url: string, root?: string): boolean;

export function parseString(str: string): string;

/**
 * Converts some resource URL to a webpack module request.
 * {@link https://github.com/webpack/loader-utils#urltorequest}
 */
export function urlToRequest(url: string, root?: string): string;

/**
 * Interpolates a filename template using multiple placeholders and/or a regular expression.
 * The template and regular expression are set as query params called name and regExp on the current loader's context.
 * {@link https://github.com/webpack/loader-utils#interpolatename}
 */
export function interpolateName(loaderContext: loader.LoaderContext, name: string, options?: any): string;

/**
 * @param buffer
 * @param [hashType='md4']
 * @param [digestType='hex']
 * @param [maxLength=9999]
 */
export function getHashDigest(buffer: Buffer, hashType: HashType, digestType: DigestType, maxLength: number): string;

redpajama_set_name: RedPajamaGithub


text:
'use strict'
const async = require('async')
const options = require('template-tools/src/utils/options')
const Stripe = require('stripe')

const REQUIRED = [
  'secretKey'
]

const REQUIRED_HOOKS = [

]

const DEFAULTS = {

}

const StripeBackend = (opts) => {

  opts = options.processor(opts, {
    required: REQUIRED,
    defaults: DEFAULTS
  })

  const hooks = options.processor(opts.hooks, {
    required: REQUIRED_HOOKS
  })

  const stripe = Stripe(opts.secretKey)

  /*

    testToken

  */
  const testToken = (call, done) => {
    // + 2 months
    const nowDate = new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 60))
    const year = nowDate.getFullYear()
    const month = nowDate.getMonth() + 1
    stripe.tokens.create({
      card: {
        "number": '4242424242424242',
        "exp_month": month,
        "exp_year": year,
        "cvc": '123'
      }
    }, done)
  }

  /*

    payment

    returns {
      ok: bool,
      error: 'desc'
    }

    if an actual error is returned it is a lower level system error (like cannot connect to remote api etc)
  */
  const payment = (call, done) => {
    stripe.charges.create({
      amount: call.request.amount,
      currency: "gbp",
      receipt_email: call.request.email,
      source: call.request.token,
      description: call.request.description
    }, (err, result) => {
      if(err) return done(null, {
        ok: false,
        error: err.toString()
      })
      if(!result) return done(null, {
        ok: false,
        error: 'no payment result found'
      })
      done(null, {
        ok: true,
        charge: result
      })
    })
  }

  return {
    testToken,
    payment
  }

}

module.exports = StripeBackend


text:
Spinners

Global variables

$spinner-class: "-spinner" !global

Spinner is an element shows that process is executing (any one, for example loading process)

    If you want to position your spinner in the center of any relative element, add _responsive_ modifier to the spinner.

    In some spinners you'll need to add -addon elements inside to add spinner blocks.


text:
namespace Microsoft.Graph
{
    using System;

    using Newtonsoft.Json;

    /// <summary>
    /// The interface IUserDirectReportsCollectionWithReferencesPage.
    /// </summary>
    [JsonConverter(typeof(InterfaceConverter<UserDirectReportsCollectionWithReferencesPage>))]
    public interface IUserDirectReportsCollectionWithReferencesPage : ICollectionPage<DirectoryObject>
    {
        /// <summary>
        /// Gets the next page <see cref="IUserDirectReportsCollectionWithReferencesRequest"/> instance.
        /// </summary>
        IUserDirectReportsCollectionWithReferencesRequest NextPageRequest { get; }

        /// <summary>
        /// Initializes the NextPageRequest property.
        /// </summary>
        void InitializeNextPageRequest(IBaseClient client, string nextPageLinkString);
    }
}


text:
var express = require('express');
var path = require('path');

/// Let's begin

var app = express();

/// Development/Production

app.set('env', process.env.NODE_ENV || 'development');

// view engine setup
// note: we still keep some views to fallback if angular or whatever fails
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');

var favicon = require('serve-favicons');
app.use(favicon({
  '/favicon.ico': path.join(__dirname, 'favicon', 'favicon.ico'),
  '/apple-touch-icon.png': path.join(__dirname, 'favicon', 'apple-touch-icon.png'),
  '/favicon-32x32.png': path.join(__dirname, 'favicon', 'favicon-32x32.png'),
  '/favicon-16x16.png': path.join(__dirname, 'favicon', 'favicon-16x16.png'),
  '/manifest.json': path.join(__dirname, 'favicon', 'manifest.json'),
  '/safari-pinned-tab.svg': path.join(__dirname, 'favicon', 'safari-pinned-tab.svg'),
}));

var logger = require('./logger');
app.use(logger);

var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

/// Cookies and Sessions

var cookieParser = require('cookie-parser');
app.use(cookieParser());

var session = require('express-session');
app.set('trust proxy', 1); // trust first proxy
app.use(session({
   secret: 'b0nf1y4h'
   , resave: false
   , saveUninitialized: false
   , cookie: {
      // secure is not working as planned...
      //secure: app.get('env') === 'production',
      maxAge: 1 * 60 * 60 * 1000
   }
}));

var passport = require('passport');
app.use(passport.initialize());
app.use(passport.session());
var flash = require('connect-flash');
app.use(flash());

/// Security

var helmet = require('helmet');
app.use(helmet());

/// Env settings

/// Database

const db = require('./db'); // should never be require'd again!

/// Routes

// Data analysis backend
var login = require('./routes/login');
app.use('/login', login);
var logout = require('./routes/logout');
app.use('/logout', logout);
var admin = require('./routes/admin');
app.use('/admin', admin);
var api = require('./routes/api/api.js');
app.use('/api', api);

// Serve the main angular frontend
app.use(express.static(path.join(__dirname, './ui/dist')));
// Catch all other routes and return the index file
app.get('*', (req, res) => {
  res.sendFile(path.join(__dirname, './ui/dist/index.html'));
});

/// Catch-alls

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  var err = new Error('Not Found');
  err.status = 404;
  return next(err);
});

// error handler
app.use(function(err, req, res, next) {
  // set locals, only providing error in development
  res.locals.message = err.message;
  res.locals.error = req.app.get('env') === 'development' ? err : {};

  // log the error
  console.error(`Error: message: ${err.message}\nstatus: ${err.status}\nstack: ${err.stack}`);

  // render the error page
  res.status(err.status || 500);
  res.render('error');
});

module.exports = app;


text:
package main

import (
	"github.com/desertbit/bulldozer/filewatcher"
	"github.com/desertbit/bulldozer/utils"
	"log"
	"path/filepath"
	"strings"
	"time"
)

const (
	GoSuffix       = ".go"
	TemplateSuffix = ".bt"
)

const (
	actionNothing int = 1 << iota
	actionRestart int = 1 << iota
	actionRebuild int = 1 << iota
)

var (
	restartProcessOnChangedFiles []string
	fileWatcher                  *filewatcher.FileWatcher

	action         int = actionNothing
	debounceAction func()
)

//###############//
//### Private ###//
//###############//

func init() {
	debounceAction = utils.Debounce(500*time.Millisecond, performAction)
}

func performAction() {
	if action == actionRestart {
		restartProcess()
	} else if action == actionRebuild {
		build()
	}

	action = actionNothing
}

//###################//
//### FileWatcher ###//
//###################//

func addPathToProcessRestartTrigger(path string) {
	// First clean the path.
	path = filepath.Clean(path)

	// Add it to the slice
	restartProcessOnChangedFiles = append(restartProcessOnChangedFiles, path)
}

func watchFiles() {
	// Create the filewatcher.
	var err error
	fileWatcher, err = filewatcher.New()
	if err != nil {
		log.Fatalf("failed to create filewatcher: %v", err)
	}

	// Set the event function.
	fileWatcher.OnEvent(onFileChange)

	// Add the path which should be watched.
	fileWatcher.Add(WatchPath)
}

func onFileChange(event *filewatcher.Event) {
	// Get the path.
	path := filepath.Clean(event.Path)

	// Restart the application if any file changed which
	// matches the defined slice.
	for _, p := range restartProcessOnChangedFiles {
		if p == path {
			// Restart the process.
			if action != actionRebuild {
				action = actionRestart
			}
			debounceAction()
			return
		}
	}

	// Restart the application if any template file changed.
	if strings.HasSuffix(path, TemplateSuffix) {
		// Restart the process.
		if action != actionRebuild {
			action = actionRestart
		}
		debounceAction()
		return
	}

	// Rebuild the application if any go file changed.
	if strings.HasSuffix(path, GoSuffix) {
		// Rebuild the bulldozer application.
		action = actionRebuild
		debounceAction()
		return
	}
}


text:
import {expect} from 'chai'
import {ERROR} from '../error-actions'

describe('ERROR', () => {

  it('correctly defines all actions', () => {
    const actions = {
      'ADD'   : 'ERROR__ADD',
      'REMOVE': 'ERROR__REMOVE',
    }
    Object.keys(actions).forEach((k) => expect(ERROR[k]).to.equal(actions[k]))
  })
})


text:
package org.terasology.logic.characters.events;

import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.entitySystem.event.AbstractConsumableEvent;

/**
 * This event happens on the server after a AttackRequest has been sent by the client.
 * This event is sent on the entity being attacked.
 */
public class AttackEvent extends AbstractConsumableEvent {
    private EntityRef instigator;
    private EntityRef directCause;

    /**
     * @param instigator  The instigator of the damage (which entity caused it)
     * @param directCause Tool used to cause the damage
     */
    public AttackEvent(EntityRef instigator, EntityRef directCause) {
        this.instigator = instigator;
        this.directCause = directCause;
    }

    public EntityRef getInstigator() {
        return instigator;
    }

    public EntityRef getDirectCause() {
        return directCause;
    }
}


text:
package org.spongepowered.common.mixin.plugin.tileentityactivation;

import static com.google.common.base.Preconditions.checkNotNull;

import com.flowpowered.math.vector.Vector3i;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.management.PlayerChunkMap;
import net.minecraft.server.management.PlayerChunkMapEntry;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import org.spongepowered.api.block.tileentity.TileEntityType;
import org.spongepowered.common.SpongeImpl;
import org.spongepowered.common.config.SpongeConfig;
import org.spongepowered.common.config.category.TileEntityActivationModCategory;
import org.spongepowered.common.config.category.TileEntityActivationCategory;
import org.spongepowered.common.data.type.SpongeTileEntityType;
import org.spongepowered.common.interfaces.IMixinChunk;
import org.spongepowered.common.interfaces.world.IMixinWorldServer;
import org.spongepowered.common.interfaces.world.gen.IMixinChunkProviderServer;
import org.spongepowered.common.mixin.plugin.entityactivation.interfaces.IModData_Activation;
import org.spongepowered.common.util.VecHelper;

import java.util.Map;

public class TileEntityActivation {

    /**
     * These tileentities are excluded from Activation range checks.
     *
     * @param tileEntity The tileentity to check
     * @return boolean If it should always tick.
     */
    public static boolean initializeTileEntityActivationState(TileEntity tileEntity) {
        if (tileEntity.getWorld() == null || tileEntity.getWorld().isRemote || !(tileEntity instanceof ITickable)) {
            return true;
        }

        TileEntityActivationCategory config = ((IMixinWorldServer) tileEntity.getWorld()).getActiveConfig().getConfig().getTileEntityActivationRange();
        TileEntityType type = ((org.spongepowered.api.block.tileentity.TileEntity) tileEntity).getType();

        IModData_Activation spongeEntity = (IModData_Activation) tileEntity;
        SpongeTileEntityType spongeType = (SpongeTileEntityType) type;
        if (spongeType == null || spongeType.getModId() == null) {
            return true;
        }
        TileEntityActivationModCategory tileEntityMod = config.getModList().get(spongeType.getModId());
        int defaultActivationRange = config.getDefaultBlockRange();
        if (tileEntityMod == null) {
            // use default activation range
            spongeEntity.setActivationRange(defaultActivationRange);
            if (defaultActivationRange <= 0) {
                return true;
            }
            return false;
        } else if (!tileEntityMod.isEnabled()) {
            spongeEntity.setActivationRange(defaultActivationRange);
            return true;
        }

        Integer defaultModActivationRange = tileEntityMod.getDefaultBlockRange();
        Integer tileEntityActivationRange = tileEntityMod.getTileEntityRangeList().get(type.getName());
        if (defaultModActivationRange != null && tileEntityActivationRange == null) {
            spongeEntity.setActivationRange(defaultModActivationRange);
            if (defaultModActivationRange <= 0) {
                return true;
            }
            return false;
        } else if (tileEntityActivationRange != null) {
            spongeEntity.setActivationRange(tileEntityActivationRange);
            if (tileEntityActivationRange <= 0) {
                return true;
            }
        }

        return false;
    }

    /**
    * Find what tileentities are in range of the players in the world and set
    * active if in range.
    *
    * @param world The world to perform activation checks in
    */
    public static void activateTileEntities(WorldServer world) {
        final PlayerChunkMap playerChunkMap = world.getPlayerChunkMap();
        for (PlayerChunkMapEntry playerChunkMapEntry : playerChunkMap.entries) {
            for (EntityPlayer player : playerChunkMapEntry.players) {
                final Chunk chunk = playerChunkMapEntry.chunk;
                if (chunk == null || chunk.unloadQueued) {
                    continue;
                }

                activateChunkTileEntities(player, chunk);
            }
        }
    }

    /**
     * Checks for the activation state of all tileentities in this chunk.
     *
     * @param chunk Chunk to check for activation
     */
    private static void activateChunkTileEntities(EntityPlayer player, Chunk chunk) {
        final Vector3i playerPos = VecHelper.toVector3i(player.getPosition());
        final long currentTick = SpongeImpl.getServer().getTickCounter();
        for (Map.Entry<BlockPos, TileEntity> mapEntry : chunk.getTileEntityMap().entrySet()) {
            final TileEntity tileEntity = mapEntry.getValue();
            if (!(tileEntity instanceof ITickable) || ((IModData_Activation) tileEntity).getActivatedTick() == currentTick) {
                // already activated
                continue;
            }

            final Vector3i tilePos = VecHelper.toVector3i(tileEntity.getPos());
            if (currentTick > ((IModData_Activation) tileEntity).getActivatedTick()) {
                if (((IModData_Activation) tileEntity).getDefaultActivationState()) {
                    ((IModData_Activation) tileEntity).setActivatedTick(currentTick);
                    continue;
                }

                IModData_Activation spongeEntity = (IModData_Activation) tileEntity;
                // check if activation cache needs to be updated
                if (spongeEntity.requiresActivationCacheRefresh()) {
                    TileEntityActivation.initializeTileEntityActivationState(tileEntity);
                    spongeEntity.requiresActivationCacheRefresh(false);
                }

                int bbActivationRange = ((IModData_Activation) tileEntity).getActivationRange();
                int blockDistance = Math.round(tilePos.distance(playerPos));
                if (blockDistance <= bbActivationRange) {
                    ((IModData_Activation) tileEntity).setActivatedTick(currentTick);
                }
            }
        }
    }

    /**
     * Checks if the tileentity is active for this tick.
     *
     * @param tileEntity The tileentity to check for activity
     * @return Whether the given tileentity should be active
     */
    public static boolean checkIfActive(TileEntity tileEntity) {
        if (tileEntity.getWorld() == null || tileEntity.getWorld().isRemote || !(tileEntity instanceof ITickable)) {
            return true;
        }

        final World world = tileEntity.getWorld();
        long currentTick = SpongeImpl.getServer().getTickCounter();
        IModData_Activation spongeTileEntity = (IModData_Activation) tileEntity;
        boolean isActive = spongeTileEntity.getActivatedTick() >= currentTick || spongeTileEntity.getDefaultActivationState();

        // Should this entity tick?
        if (!isActive) {
            if (spongeTileEntity.getActivatedTick() == Integer.MIN_VALUE) {
                // Has not come across a player
                return false;
            }
        }

        // Make sure not on edge of unloaded chunk
        int x = tileEntity.getPos().getX();
        int z = tileEntity.getPos().getZ();
        IMixinChunk spongeChunk = (IMixinChunk)((IMixinChunkProviderServer) world.getChunkProvider()).getLoadedChunkWithoutMarkingActive(x >> 4, z >> 4);
        if (isActive && (spongeChunk == null || (!spongeChunk.isPersistedChunk() && !spongeChunk.areNeighborsLoaded()))) {
            isActive = false;
        }

        if (!isActive && spongeChunk != null && spongeChunk.isPersistedChunk()) {
            isActive = true;
        }

        // check tick rate
        if (isActive && world.getWorldInfo().getWorldTotalTime() % spongeTileEntity.getSpongeTickRate() != 0L) {
            isActive = false;
        }

        return isActive;
    }

    public static void addTileEntityToConfig(World world, SpongeTileEntityType type) {
        checkNotNull(world, "world");
        checkNotNull(type, "type");

        SpongeConfig<?> config = ((IMixinWorldServer) world).getActiveConfig();
        if (config == null || type == null || !config.getConfig().getTileEntityActivationRange().autoPopulateData()) {
            return;
        }

        boolean requiresSave = false;
        TileEntityActivationCategory activationCategory = config.getConfig().getTileEntityActivationRange();
        TileEntityActivationModCategory tileEntityMod = activationCategory.getModList().get(type.getModId());
        int defaultRange = activationCategory.getDefaultBlockRange();
        int defaultTickRate = activationCategory.getDefaultTickRate();
        if (tileEntityMod == null) {
            tileEntityMod = new TileEntityActivationModCategory(type.getModId());
            activationCategory.getModList().put(type.getModId(), tileEntityMod);
            requiresSave = true;
        }

        if (tileEntityMod != null) {
            // check for tileentity range overrides
            Integer tileEntityActivationRange = tileEntityMod.getTileEntityRangeList().get(type.getName());
            Integer modDefaultRange = tileEntityMod.getDefaultBlockRange();
            if (modDefaultRange == null) {
                modDefaultRange = defaultRange;
            }
            if (tileEntityActivationRange == null) {
                tileEntityMod.getTileEntityRangeList().put(type.getName(), modDefaultRange);
                requiresSave = true;
            }

            // check for tileentity tick rate overrides
            Integer modDefaultTickRate = tileEntityMod.getDefaultTickRate();
            if (modDefaultTickRate == null) {
                modDefaultTickRate = defaultTickRate;
            }
            Integer tileEntityActivationTickRate = tileEntityMod.getTileEntityTickRateList().get(type.getName());
            if (tileEntityActivationTickRate == null) {
                tileEntityMod.getTileEntityTickRateList().put(type.getName(), modDefaultTickRate);
                requiresSave = true;
            }
        }

        if (requiresSave) {
            config.save();
        }
    }
}


text:
package org.mcisb.ui.kinetics;

import java.beans.*;
import java.util.*;
import org.mcisb.kinetics.*;
import org.mcisb.ontology.sbo.*;
import org.mcisb.sbml.*;
import org.mcisb.tracking.*;
import org.mcisb.ui.wizard.*;
import org.mcisb.util.*;
import org.sbml.jsbml.*;

/**
 *
 * @author Neil Swainston
 */
public class SampleSelectionWizardComponent extends WizardComponent
{
	/**
	 *
	 */
	private KineticsExperimentSet experimentSet;

	/**
	 *
	 */
	private boolean updated = false;

	/**
	 *
	 * @param bean
	 * @param component
	 */
	public SampleSelectionWizardComponent( final GenericBean bean, final SampleSelectionPanel component )
	{
		super( bean, component );
	}

	/*
	 * (non-Javadoc)
	 * @see org.mcisb.ui.wizard.WizardComponent#display()
	 */
	@Override
	public void display() throws Exception
	{
		updated = false;
		super.display();
	}

	/*
	 * (non-Javadoc)
	 * @see org.mcisb.ui.wizard.DefaultWizardComponent#update()
	 */
	@Override
	public void update() throws Exception
	{
		if( !updated )
		{
			final SampleSelectionPanel sampleSelectionPanel = (SampleSelectionPanel)parameterPanel;

			for( Iterator<Map.Entry<Object,Collection<Object>>> iterator = sampleSelectionPanel.getGroups().entrySet().iterator(); iterator.hasNext(); )
			{
				final Map.Entry<Object,Collection<Object>> entry = iterator.next();
				final Object group = entry.getKey();

				// Create model for each group:
				final SBMLDocument document = new SBMLDocument();
				final Model model = document.createModel( StringUtils.getUniqueId() );
				model.setLevel( SbmlUtils.DEFAULT_LEVEL );
				model.setVersion( SbmlUtils.DEFAULT_VERSION );
				model.setId( StringUtils.getUniqueId() );
				model.setName( group.toString() );
				KineticsUtils.addConcentrationUnitDefinition( model );
				KineticsUtils.addKcatUnitDefinition( model );

				if( experimentSet != null && experimentSet.getModelHistory() != null )
				{
					model.setHistory( experimentSet.getModelHistory() );
				}

				// Add modifier:
				final Species enzyme = model.createSpecies();
				enzyme.setId( StringUtils.getUniqueId() );
				enzyme.setSBOTerm( SboUtils.POLYPEPTIDE_CHAIN );

				for( Iterator<Object> iterator2 = entry.getValue().iterator(); iterator2.hasNext(); )
				{
					final Object value = iterator2.next();

					if( value instanceof Spot )
		    		{
						final SpotReading spotReading = ( (Spot)value ).getUserValue();
		    			final Object spotReadingUserObject = spotReading.getUserObject();

	    				if( spotReadingUserObject instanceof Species )
	    				{
	    					final Species spotSpecies = (Species)spotReadingUserObject;

	    					if( sampleSelectionPanel.isBlank( spotSpecies ) || sampleSelectionPanel.isSample( spotSpecies ) )
	    					{
	    						final Species species = model.createSpecies();
	    						species.setId( spotSpecies.getId() );
	    						species.setName( spotSpecies.getName() );
	    						species.setInitialConcentration( spotSpecies.getInitialConcentration() );
	    						species.setUnits( spotSpecies.getUnits() );
	    						species.setSBOTerm( spotSpecies.getSBOTerm() );

            					final Reaction reaction = model.createReaction();
            					reaction.setId( StringUtils.getUniqueId() );
            					reaction.setName( group.toString() );

            					final SpeciesReference speciesReference = reaction.createReactant();
            					speciesReference.setSpecies( species.getId() );

            					// Add modifier to each reaction that is not a blank:
            					if( sampleSelectionPanel.isSample( spotSpecies ) )
            					{
            						final ModifierSpeciesReference modifierSpeciesReference = reaction.createModifier();
            						modifierSpeciesReference.setSpecies( enzyme.getId() );
            					}
	    					}
	    				}
	    			}
				}

				if( experimentSet != null )
				{
					experimentSet.addDocument( document );
				}
			}

			updated = true;
		}
	}

	/*
	 * (non-Javadoc)
	 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
	 */
	@Override
	public void propertyChange( PropertyChangeEvent evt )
	{
		super.propertyChange( evt );

		if( evt.getPropertyName().equals( AbsorbanceWizard.NEW_EXPERIMENT_SET ) )
		{
			experimentSet = (KineticsExperimentSet)evt.getNewValue();
		}
	}
}


text:
import * as Lint from "../lint";

describe("<no-inferrable-types>", () => {
    const Rule = Lint.Test.getRule("no-inferrable-types");
    const fileName = "rules/noinferrabletypes.test.ts";

    it("forbids explicit type declarations where easily inferrable", () => {
        const createFailure = (start: number[], end: number[], type: string) => {
            const failureString = Rule.FAILURE_STRING_FACTORY(type);
            return Lint.Test.createFailure(fileName, start, end, failureString);
        };

        const expectedFailures = [
            createFailure([2, 8], [2, 14], "number"),
            createFailure([3, 8], [3, 15], "boolean"),
            createFailure([4, 8], [4, 14], "string"),
            createFailure([7, 18], [7, 24], "number"),
            createFailure([7, 33], [7, 40], "boolean"),
            createFailure([7, 52], [7, 58], "string")
        ];
        const actualFailures = Lint.Test.applyRuleOnFile(fileName, Rule);
        Lint.Test.assertFailuresEqual(actualFailures, expectedFailures);
    });
});


text:
package us.kbase.kbasejobservice;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;

import us.kbase.auth.AuthService;
import us.kbase.auth.AuthToken;
import us.kbase.common.service.JacksonTupleModule;
import us.kbase.common.service.JsonServerMethod;
import us.kbase.common.service.JsonServerServlet;
import us.kbase.common.service.JsonServerSyslog;

//BEGIN_HEADER

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.exception.ExceptionUtils;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;

import com.fasterxml.jackson.databind.ObjectMapper;

import us.kbase.common.service.UObject;
import us.kbase.mobu.util.ProcessHelper;

//END_HEADER

/**
 *
Original spec-file module name: KBaseJobService

 *

 *

 */
public class KBaseJobServiceServer extends JsonServerServlet {
    private static final long serialVersionUID = 1L;

    //BEGIN_CLASS_HEADER
    private int lastJobId = 0;
    private Map<String, FinishJobParams> results = new LinkedHashMap<String, FinishJobParams>();
    private File binDir = null;
    private File tempDir = null;

    public KBaseJobServiceServer withBinDir(File binDir) {
        this.binDir = binDir;
        return this;
    }

    public KBaseJobServiceServer withTempDir(File tempDir) {
        this.tempDir = tempDir;
        return this;
    }

    public File getTempDir() {
        return tempDir == null ? new File(".") : tempDir;
    }

    public String getBinScript(String scriptName) {
        File ret = null;
        if (binDir == null) {
            ret = new File(".", scriptName);
            if (!ret.exists())
                return scriptName;
        } else {
            ret = new File(binDir, scriptName);
        }
        return ret.getAbsolutePath();
    }

    protected void processRpcCall(RpcCallData rpcCallData, String token, JsonServerSyslog.RpcInfo info,
            String requestHeaderXForwardedFor, ResponseStatusSetter response, OutputStream output,
            boolean commandLine) {
        if (rpcCallData.getMethod().startsWith("NarrativeJobService.")) {
            super.processRpcCall(rpcCallData, token, info, requestHeaderXForwardedFor, response, output, commandLine);
        } else {
            String rpcName = rpcCallData.getMethod();
            List<UObject> paramsList = rpcCallData.getParams();
            List<Object> result = null;
            ObjectMapper mapper = new ObjectMapper().registerModule(new JacksonTupleModule());
            RpcContext context = UObject.transformObjectToObject(rpcCallData.getContext(),
                            RpcContext.class);
            Exception exc = null;
            try {
                //TODO AUTH make configurable?
                final AuthToken t = AuthService.validateToken(token);
                if (rpcName.endsWith("_submit")) {
                    String origRpcName = rpcName.substring(0, rpcName.lastIndexOf('_'));
                    String[] parts = origRpcName.split(Pattern.quote("."));
                    if (!parts[1].startsWith("_"))
                        throw new IllegalStateException("Unexpected method name: " + rpcName);
                    origRpcName = parts[0] + "." + parts[1].substring(1);
                    RunJobParams runJobParams = new RunJobParams();
                    String serviceVer = rpcCallData.getContext() == null ? null :
                        (String)rpcCallData.getContext().getAdditionalProperties().get("service_ver");
                    runJobParams.setServiceVer(serviceVer);
                    runJobParams.setMethod(origRpcName);
                    runJobParams.setParams(paramsList);
                    runJobParams.setRpcContext(context);
                    result = new ArrayList<Object>();
                    result.add(runJob(runJobParams, t,
                            rpcCallData.getContext()));
                } else if (rpcName.endsWith("._check_job") && paramsList.size() == 1) {
                    String jobId = paramsList.get(0).asClassInstance(String.class);
                    JobState jobState = checkJob(jobId, t,
                            rpcCallData.getContext());
                    Long finished = jobState.getFinished();
                    if (finished != 0L) {
                        Object error = jobState.getError();
                        if (error != null) {
                            Map<String, Object> ret = new LinkedHashMap<String, Object>();
                            ret.put("version", "1.1");
                            ret.put("error", error);
                            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
                            mapper.writeValue(new UnclosableOutputStream(output), ret);
                            return;
                        }
                    }
                    result = new ArrayList<Object>();
                    result.add(jobState);
                } else {
                    throw new IllegalArgumentException("Method [" + rpcName +
                            "] doesn't ends with \"_submit\" or \"_check_job\" suffix");
                }
                Map<String, Object> ret = new LinkedHashMap<String, Object>();
                ret.put("version", "1.1");
                ret.put("result", result);
                mapper.writeValue(new UnclosableOutputStream(output), ret);
                return;
            } catch (Exception ex) {
                exc = ex;
            }
            try {
                Map<String, Object> error = new LinkedHashMap<String, Object>();
                error.put("name", "JSONRPCError");
                error.put("code", -32601);
                error.put("message", exc.getLocalizedMessage());
                error.put("error", ExceptionUtils.getStackTrace(exc));
                Map<String, Object> ret = new LinkedHashMap<String, Object>();
                ret.put("version", "1.1");
                ret.put("error", error);
                mapper.writeValue(new UnclosableOutputStream(output), ret);
                response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
            } catch (Exception ex) {
                new Exception("Error sending error: " +
                        exc.getLocalizedMessage(), ex).printStackTrace();
            }
        }
    }

    private static class UnclosableOutputStream extends OutputStream {
        OutputStream inner;
        boolean isClosed = false;

        public UnclosableOutputStream(OutputStream inner) {
            this.inner = inner;
        }

        @Override
        public void write(int b) throws IOException {
            if (isClosed)
                return;
            inner.write(b);
        }

        @Override
        public void close() throws IOException {
            isClosed = true;
        }

        @Override
        public void flush() throws IOException {
            inner.flush();
        }

        @Override
        public void write(byte[] b) throws IOException {
            if (isClosed)
                return;
            inner.write(b);
        }

        @Override
        public void write(byte[] b, int off, int len) throws IOException {
            if (isClosed)
                return;
            inner.write(b, off, len);
        }
    }
    //END_CLASS_HEADER

    public KBaseJobServiceServer() throws Exception {
        super("KBaseJobService");
        //BEGIN_CONSTRUCTOR
        //END_CONSTRUCTOR
    }

    /**
     *
Original spec-file function name: run_job

     *

     * Start a new job
     *

     * @param   params   instance of type {@link us.kbase.kbasejobservice.RunJobParams RunJobParams}
     * @return   parameter "job_id" of original type "job_id" (A job id.)
     */
    @JsonServerMethod(rpc = "KBaseJobService.run_job")
    public String runJob(RunJobParams params, AuthToken authPart, us.kbase.common.service.RpcContext... jsonRpcCallContext) throws Exception {
        String returnVal = null;
        //BEGIN run_job
        lastJobId++;
        final String jobId = "" + lastJobId;
        final AuthToken token = authPart;
        returnVal = jobId;
        final File jobDir = new File(tempDir, "job_" + jobId);
        if (!jobDir.exists())
            jobDir.mkdirs();
        File jobFile = new File(jobDir, "job.json");
        UObject.getMapper().writeValue(jobFile, params);
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    RunJobParams job = getJobParams(jobId, token);
                    String serviceName = job.getMethod().split("\\.")[0];
                    RpcContext context = job.getRpcContext();
                    if (context == null)
                        context = new RpcContext().withRunId("");
                    if (context.getCallStack() == null)
                        context.setCallStack(new ArrayList<MethodCall>());
                    context.getCallStack().add(new MethodCall().withJobId(jobId).withMethod(job.getMethod())
                            .withTime(DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ssZ").withZoneUTC()
                                    .print(new DateTime())));
                    File jobDir = new File(tempDir, "job_" + jobId);
                    if (!jobDir.exists())
                        jobDir.mkdirs();
                    Map<String, Object> rpc = new LinkedHashMap<String, Object>();
                    rpc.put("version", "1.1");
                    rpc.put("method", job.getMethod());
                    rpc.put("params", job.getParams());
                    rpc.put("context", job.getRpcContext());
                    File inputFile = new File(jobDir, "input.json");
                    UObject.getMapper().writeValue(inputFile, rpc);
                    String scriptFilePath = getBinScript("run_" + serviceName + "_async_job.sh");
                    File outputFile = new File(jobDir, "output.json");
                    ProcessHelper.cmd("bash", scriptFilePath, inputFile.getCanonicalPath(),
                            outputFile.getCanonicalPath(), token.getToken()).exec(jobDir);
                    FinishJobParams result = UObject.getMapper().readValue(outputFile, FinishJobParams.class);
                    finishJob(jobId, result, token);
                } catch (Exception ex) {
                    FinishJobParams result = new FinishJobParams().withError(new JsonRpcError().withCode(-1L)
                            .withName("JSONRPCError").withMessage("Job service side error: " + ex.getMessage()));
                    try {
                        finishJob(jobId, result, token);
                    } catch (Exception ignore) {}
                }
            }
        }).start();
        //END run_job
        return returnVal;
    }

    /**
     *
Original spec-file function name: get_job_params

     *

     * Get job params necessary for job execution
     *

     * @param   jobId   instance of original type "job_id" (A job id.)
     * @return   parameter "params" of type {@link us.kbase.kbasejobservice.RunJobParams RunJobParams}
     */
    @JsonServerMethod(rpc = "KBaseJobService.get_job_params")
    public RunJobParams getJobParams(String jobId, AuthToken authPart, us.kbase.common.service.RpcContext... jsonRpcCallContext) throws Exception {
        RunJobParams returnVal = null;
        //BEGIN get_job_params
        final File jobDir = new File(tempDir, "job_" + jobId);
        if (!jobDir.exists())
            jobDir.mkdirs();
        File jobFile = new File(jobDir, "job.json");
        returnVal = UObject.getMapper().readValue(jobFile, RunJobParams.class);
        //END get_job_params
        return returnVal;
    }

    /**
     *
Original spec-file function name: finish_job

     *

     * Register results of already started job
     *

     * @param   jobId   instance of original type "job_id" (A job id.)
     * @param   params   instance of type {@link us.kbase.kbasejobservice.FinishJobParams FinishJobParams}
     */
    @JsonServerMethod(rpc = "KBaseJobService.finish_job")
    public void finishJob(String jobId, FinishJobParams params, AuthToken authPart, us.kbase.common.service.RpcContext... jsonRpcCallContext) throws Exception {
        //BEGIN finish_job
        results.put(jobId, params);
        //END finish_job
    }

    /**
     *
Original spec-file function name: check_job

     *

     * Check if job is finished and get results/error
     *

     * @param   jobId   instance of original type "job_id" (A job id.)
     * @return   parameter "job_state" of type {@link us.kbase.kbasejobservice.JobState JobState}
     */
    @JsonServerMethod(rpc = "KBaseJobService.check_job")
    public JobState checkJob(String jobId, AuthToken authPart, us.kbase.common.service.RpcContext... jsonRpcCallContext) throws Exception {
        JobState returnVal = null;
        //BEGIN check_job
        returnVal = new JobState();
        FinishJobParams result = results.get(jobId);
        if (result == null) {
            returnVal.setFinished(0L);
        } else {
            returnVal.setFinished(1L);
            returnVal.setResult(result.getResult());
            returnVal.setError(result.getError());
        }
        //END check_job
        return returnVal;
    }

    public static void main(String[] args) throws Exception {
        if (args.length == 1) {
            new KBaseJobServiceServer().startupServer(Integer.parseInt(args[0]));
        } else if (args.length == 3) {
            new KBaseJobServiceServer().processRpcCall(new File(args[0]), new File(args[1]), args[2]);
        } else {
            System.out.println("Usage: <program> <server_port>");
            System.out.println("   or: <program> <context_json_file> <output_json_file> <token>");
            return;
        }
    }
}


text:
Now you'll want to create a chart component with a realtime scale. Import chartjs-plugin-streaming and register it. Also, import the `Line` chart component from react-chartjs-2 and render it specifying datasets and options.

#### src/App.js

```jsx
import React, { Component } from 'react';
import { Line, Chart } from 'react-chartjs-2';
import 'chartjs-adapter-luxon';
import StreamingPlugin from 'chartjs-plugin-streaming';
import './App.css';

Chart.register(StreamingPlugin);

class App extends Component {
  render() {
    return (
      <Line
        data={{
          datasets: [{
            data: []
          }, {
            data: []
          }]
        }}
        options={{
          scales: {
            x: {
              type: 'realtime'
            }
          }
        }}
      />
    );
  }
}

export default App;
```


text:
module.exports = function(grunt) {
  'use strict';

  var requirejs = require('requirejs');

  // TODO: extend this to send build log to grunt.log.ok / grunt.log.error
  // by overriding the r.js logger (or submit issue to r.js to expand logging support)
  requirejs.define('node/print', [], function() {
    return function print(msg) {
      if (msg.substring(0, 5) === 'Error') {
        grunt.log.errorlns(msg);
        grunt.fail.warn('RequireJS failed.');
      } else {
        grunt.log.oklns(msg);
      }
    };
  });

  grunt.registerMultiTask('requirejs', 'Build a RequireJS project.', function() {

    var done = this.async();
    var options = this.options({
      logLevel: 0
    });

    //Inject modules configurations using annotations
    var generateModulesList = function(baseUrl,regex) {
      return grunt.file.expand(baseUrl + "/**/*.js").filter(
        function(file){
          return regex.test(grunt.file.read(file));
        }
      ).map(function(file) {
        return {name: file.substring(baseUrl.length + 1,file.length - 3)};
      });
    };

    grunt.verbose.writeflags(options, 'Options');

    if(options.modules instanceof Array) {
      var modules = [];
      for(var i = 0; i < options.modules.length; i++) {
        modules.push(options.modules[i]);
        if(typeof options.modules[i] === "object") {
          if(options.modules[i].pattern !== undefined) {
            var pattern = "";
            if(options.modules[i].pattern instanceof RegExp) {
              pattern = options.modules[i].pattern;
            } else if (typeof options.modules[i].pattern === "string"){
              pattern = new RegExp(options.modules[i].pattern);
            }
            if(pattern !== "") {
              modules.pop();
              var basePath = "";
              if(options.appDir) {
                basePath += options.appDir + "/";
              }
              if(options.baseUrl) {
                basePath += options.baseUrl;
              }
              modules = modules.concat(generateModulesList(basePath,pattern)).filter(function(elem, pos, self) {
                return self.map(function(module){
                  return module.name;
                }).indexOf(elem.name) === pos;
              });
            }
          }
        }
      }
      options.modules = modules;
    }

    grunt.verbose.writeflags(options, 'Options');

    requirejs.optimize(options, function(response) {
      done();
    });
  });
};


text:
import math
import unittest

import numpy
import six

import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition

@testing.parameterize(
    {'shape': (4, 3)},
    {'shape': (65536, 1)},  # too large shape causes int32 -> float64 issue
)
class TestSigmoidCrossEntropy(unittest.TestCase):

    def setUp(self):
        self.x = numpy.random.uniform(-1, 1, self.shape).astype(numpy.float32)
        self.t = numpy.random.randint(0, 2, self.shape).astype(numpy.int32)

    def check_forward(self, x_data, t_data, use_cudnn=True):
        x_val = chainer.Variable(x_data)
        t_val = chainer.Variable(t_data)
        loss = functions.sigmoid_cross_entropy(x_val, t_val, use_cudnn)
        self.assertEqual(loss.data.shape, ())
        self.assertEqual(loss.data.dtype, numpy.float32)
        loss_value = float(cuda.to_cpu(loss.data))

        # Compute expected value
        loss_expect = 0
        for i in six.moves.range(self.x.shape[0]):
            for j in six.moves.range(self.x.shape[1]):
                xd, td = self.x[i, j], self.t[i, j]
                loss_expect -= xd * (td - (xd >= 0)) \
                    - math.log(1 + math.exp(-numpy.abs(xd)))
        loss_expect /= self.t.shape[0]
        self.assertAlmostEqual(loss_expect, loss_value, places=5)

    @condition.retry(3)
    def test_forward_cpu(self):
        self.check_forward(self.x, self.t)

    @attr.cudnn
    @condition.retry(3)
    def test_forward_gpu(self):
        self.check_forward(cuda.to_gpu(self.x), cuda.to_gpu(self.t))

    @attr.gpu
    @condition.retry(3)
    def test_forward_gpu_no_cudnn(self):
        self.check_forward(cuda.to_gpu(self.x), cuda.to_gpu(self.t), False)

    def check_backward(self, x_data, t_data, use_cudnn=True):
        x = chainer.Variable(x_data)
        t = chainer.Variable(t_data)
        loss = functions.sigmoid_cross_entropy(x, t, use_cudnn)
        loss.backward()
        self.assertEqual(None, t.grad)

        # Skip too large case. That requires a long time.
        if self.shape[0] == 65536:
            return

        func = loss.creator
        f = lambda: func.forward((x.data, t.data))
        gx, = gradient_check.numerical_grad(f, (x.data,), (1,), eps=0.01)

        gradient_check.assert_allclose(gx, x.grad)

    @condition.retry(3)
    def test_backward_cpu(self):
        self.check_backward(self.x, self.t)

    @attr.cudnn
    @condition.retry(3)
    def test_backward_gpu(self):
        self.check_backward(cuda.to_gpu(self.x), cuda.to_gpu(self.t))

    @attr.gpu
    @condition.retry(3)
    def test_backward_gpu_no_cudnn(self):
        self.check_backward(cuda.to_gpu(self.x), cuda.to_gpu(self.t), False)

testing.run_module(__name__, __file__)


text:
<?php
namespace Payum\Core\Tests\Debug;

use Payum\Core\Debug\Humanify;
use Payum\Core\Request\Capture;
use Payum\Core\Reply\HttpRedirect;
use PHPUnit\Framework\TestCase;

class HumanifyTest extends TestCase
{
    /**
     * @test
     */
    public function shouldBeAbstract()
    {
        $rc = new \ReflectionClass('Payum\Core\Debug\Humanify');

        $this->assertTrue($rc->isAbstract());
    }

    /**
     * @test
     */
    public function couldNotBeInstantiable()
    {
        $rc = new \ReflectionClass('Payum\Core\Debug\Humanify');

        $this->assertFalse($rc->isInstantiable());
    }

    /**
     * @test
     */
    public function shouldReturnObjectClassOnValueIfObjectPassed()
    {
        $this->assertEquals('HumanifyTest', Humanify::value($this));
    }

    /**
     * @test
     */
    public function shouldReturnObjectShortClassOnValueIfObjectPassedAndShortClassFlagSetTrue()
    {
        $this->assertEquals('HumanifyTest', Humanify::value($this, true));
    }

    /**
     * @test
     */
    public function shouldReturnObjectClassOnValueIfObjectPassedAndShortClassFlagSetFalse()
    {
        $this->assertEquals(__CLASS__, Humanify::value($this, false));
    }

    /**
     * @test
     */
    public function shouldReturnValueTypeIfNotObjectValueGivenOnValue()
    {
        $this->assertEquals('string', Humanify::value('foo'));
    }

    /**
     * @test
     */
    public function shouldReturnRequestTypeIfRequestNotObjectOnRequest()
    {
        $this->assertEquals('string', Humanify::request('foo'));
    }

    /**
     * @test
     */
    public function shouldReturnRequestShortClassIfRequestObjectOnRequest()
    {
        $this->assertEquals('HumanifyTest', Humanify::request($this));
    }

    /**
     * @test
     */
    public function shouldReturnRequestShortClassAndModelIfRequestImplementsModelRequestInterfaceOnRequest()
    {
        $request = new Capture($this);

        $this->assertEquals('Capture{model: HumanifyTest}', Humanify::request($request));
    }

    /**
     * @test
     */
    public function shouldReturnReplyShortClassAndUrlIfHttpRedirectReplyOnRequest()
    {
        $request = new HttpRedirect('http://example.com/foo');

        $this->assertEquals('HttpRedirect{url: http://example.com/foo}', Humanify::request($request));
    }
}


text:
MODULE mo_aerorad_lut

  IMPLICIT NONE

  PRIVATE

  PUBLIC :: init_aerorad_lut

CONTAINS

  SUBROUTINE check(istatus)
    !!Checks the return status of a nf90 function. If an error
    !!occured, the according error message is written to the
    !!screen and the program exits

    USE netcdf
    IMPLICIT NONE
    INTEGER, INTENT (IN) :: istatus
    IF (istatus /= nf90_noerr) THEN
       WRITE(*,*) TRIM(ADJUSTL(nf90_strerror(istatus)))
       WRITE(*,*) 'exiting'
       STOP
    END IF
  END SUBROUTINE check

  SUBROUTINE init_aerorad_lut(filename,dalpha, dn_re, dn_im,         &
                              n_re, n_im, alpha,            &
                              lut_sigma,lut_asym,lut_omega  )

    USE netcdf
    IMPLICIT NONE

    CHARACTER (len = *), INTENT(in) :: filename
    REAL, INTENT(out), ALLOCATABLE :: n_im(:),n_re(:),alpha(:),lut_sigma(:,:,:),lut_asym(:,:,:),lut_omega(:,:,:)
    INTEGER, INTENT(out) :: dalpha,dn_im,dn_re

    !dimension names
    CHARACTER (len = *), PARAMETER :: n_im_name = 'n_im'
    CHARACTER (len = *), PARAMETER :: n_re_name = 'n_re'
    CHARACTER (len = *), PARAMETER :: alpha_name = 'alpha'

    !file id
    INTEGER :: ncid

    !dimension ids
    INTEGER :: n_im_did, n_re_did, alpha_did

    !variable names
    CHARACTER (len = *), PARAMETER :: sigma_name = 'sigma'
    CHARACTER (len = *), PARAMETER :: asym_name = 'asym'
    CHARACTER (len = *), PARAMETER :: omega_name = 'omega'

    !variable ids
    INTEGER :: &
         n_im_vid, n_re_vid, alpha_vid, &
         sigma_vid, asym_vid, omega_vid

    !opening the file
    CALL check(nf90_open(filename, nf90_nowrite, ncid))
    !!nf90_open(filename, nf90_nowrite, ncid)

    !getting the dimension ids and then the dimension lengths
    !n_im
    CALL check(nf90_inq_dimid(ncid, n_im_name, n_im_did))
    CALL check(nf90_inquire_dimension(ncid, n_im_did, len=dn_im))

    !n_re
    CALL check(nf90_inq_dimid(ncid, n_re_name, n_re_did))
    CALL check(nf90_inquire_dimension(ncid, n_re_did, len=dn_re))

    !alpha
    CALL check(nf90_inq_dimid(ncid, alpha_name, alpha_did))
    CALL check(nf90_inquire_dimension(ncid, alpha_did, len=dalpha))

    !WRITE(*,*) n_im_name, n_im_did, dn_im
    !WRITE(*,*) n_re_name, n_re_did, dn_re
    !WRITE(*,*) alpha_name, alpha_did, dalpha

    !allocating memory:
    !dimensions
    ALLOCATE(n_im(dn_im))
    ALLOCATE(n_re(dn_re))
    ALLOCATE(alpha(dalpha))

    !variables
    ALLOCATE(lut_sigma(dn_re,dn_im,dalpha))
    ALLOCATE(lut_asym(dn_re,dn_im,dalpha))
    ALLOCATE(lut_omega(dn_re,dn_im,dalpha))

    !getting the variable ids
    CALL check(nf90_inq_varid(ncid, n_im_name, n_im_vid))
    CALL check(nf90_inq_varid(ncid, n_re_name, n_re_vid))
    CALL check(nf90_inq_varid(ncid, alpha_name, alpha_vid))
    CALL check(nf90_inq_varid(ncid, sigma_name, sigma_vid))
    CALL check(nf90_inq_varid(ncid, asym_name, asym_vid))
    CALL check(nf90_inq_varid(ncid, omega_name, omega_vid))

    !reading the data
    CALL check(nf90_get_var(ncid, n_im_vid, n_im))
    CALL check(nf90_get_var(ncid, n_re_vid, n_re))
    CALL check(nf90_get_var(ncid, alpha_vid, alpha))
    CALL check(nf90_get_var(ncid, sigma_vid, lut_sigma))
    CALL check(nf90_get_var(ncid, asym_vid, lut_asym))
    CALL check(nf90_get_var(ncid, omega_vid, lut_omega))

    !closing file
    CALL check(nf90_close(ncid))

  END SUBROUTINE init_aerorad_lut

END MODULE mo_aerorad_lut


text:
package net.starschema.clouddb.jdbc;

import com.google.api.client.testing.http.MockHttpTransport;
import com.google.api.client.testing.http.MockLowLevelHttpRequest;
import com.google.api.client.testing.http.MockLowLevelHttpResponse;
import com.google.common.collect.ImmutableMap;

import junit.framework.Assert;
import net.starschema.clouddb.jdbc.Oauth2Bigquery;
import net.starschema.clouddb.jdbc.BQConnection;
import net.starschema.clouddb.jdbc.BQStatement;
import net.starschema.clouddb.jdbc.BQSupportFuncts;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.Map;
import java.util.Properties;

/**
 * Created by steven on 10/21/15.
 */
public class JdbcUrlTest {

    private BQConnection bq;
    private String URL;
    private Properties properties;

    @Before
    public void setup() throws SQLException, IOException {
        properties = getProperties("/installedaccount.properties");
        URL = getUrl("/installedaccount.properties", null) + "&useLegacySql=true";;
        this.bq = new BQConnection(URL, new Properties());
    }

    @Test
    public void urlWithDefaultDatasetShouldWork() throws SQLException {
        Assert.assertEquals(properties.getProperty("dataset"), bq.getDataSet());
    }

    @Test
    public void projectWithColons() throws SQLException {
        String urlWithColonContainingProject = URL.replace(bq.getProjectId(), "example.com:project");
        try {
            BQConnection bqWithColons = new BQConnection(urlWithColonContainingProject, new Properties());
            Assert.assertEquals("example.com:project", bqWithColons.getProjectId());
            Assert.assertEquals("example.com:project", bqWithColons.getCatalog());
        } catch (SQLException e){
            throw new AssertionError(e);
        }
    }

    @Test
    public void mungedProjectName() throws SQLException {
        String urlWithUnderscoreContainingProject = URL.replace(bq.getProjectId(), "example_com__project");
        try {
            BQConnection bqWithUnderscores = new BQConnection(urlWithUnderscoreContainingProject, new Properties());
            Assert.assertEquals("example.com:project", bqWithUnderscores.getProjectId());
            Assert.assertEquals("example.com:project", bqWithUnderscores.getCatalog());
        } catch (SQLException e){
            throw new AssertionError(e);
        }
    }

    @Test
    public void urlWithTimeouts() throws SQLException {
        try {
            String url1 = URL + "&readTimeout=foo";
            new BQConnection(url1, new Properties());
        } catch (SQLException e){
            Assert.assertEquals("could not parse readTimeout parameter.", e.getMessage());
        }

        try {
            String url1 = URL + "&connectTimeout=foo";
            new BQConnection(url1, new Properties());
        } catch (SQLException e){
            Assert.assertEquals("could not parse connectTimeout parameter.", e.getMessage());
        }

        try {
            String url1 = URL + "&readTimeout=-1000";
            new BQConnection(url1, new Properties());
        } catch (SQLException e){
            Assert.assertEquals("readTimeout must be positive.", e.getMessage());
        }

        try {
            String url1 = URL + "&connectTimeout=-1000";
            new BQConnection(url1, new Properties());
        } catch (SQLException e){
            Assert.assertEquals("connectTimeout must be positive.", e.getMessage());
        }
    }

    @Test
    public void canRunQueryWithDefaultDataset() throws SQLException {
        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bq);

        // This should not blow up with a "No dataset specified" exception
        stmt.executeQuery("SELECT * FROM orders limit 1");
    }

    @Test
    public void canConnectWithPasswordProtectedP12File() throws SQLException, IOException {
        String url = getUrl("/protectedaccount.properties", null);
        BQConnection bqConn = new BQConnection(url, new Properties());

        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bqConn);
        stmt.executeQuery("SELECT * FROM orders limit 1");
    }

    @Test
    public void canConnectWithJSONFile() throws SQLException, IOException {
        String url = getUrl("/protectedaccount-json.properties", null);
        properties = getProperties("/protectedaccount-json.properties");
        properties.setProperty("path", "src/test/resources/bigquery_credentials_protected.json");
        BQConnection bqConn = new BQConnection(url, properties);

        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bqConn);
        stmt.executeQuery("SELECT * FROM orders limit 1");
    }

    @Test
    public void canConnectWithJsonAuthFileContentsInProperties() throws SQLException, IOException {
        String url = getUrl("/protectedaccount-json.properties", null);
        properties = getProperties("/protectedaccount-json.properties");
        String jsonContents = new String(Files.readAllBytes(Paths.get("src/test/resources/bigquery_credentials_protected.json")));
        Properties props = new Properties();
        props.setProperty("jsonAuthContents", jsonContents);
        BQConnection bqConn = new BQConnection(url, props);

        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bqConn);
        stmt.executeQuery("SELECT * FROM orders limit 1");
    }

    @Test
    public void canConnectWithOAuthAccessToken() throws SQLException, IOException, GeneralSecurityException {
        // generate access token from service account credentials
        Properties serviceProps = getProperties("/protectedaccount.properties");
        String accessToken = Oauth2Bigquery.generateAccessToken(
            serviceProps.getProperty("user"),
            serviceProps.getProperty("path"),
            serviceProps.getProperty("password"),
            null
        );

        Properties oauthProps = getProperties("/oauthaccount.properties");
        oauthProps.setProperty("oauthaccesstoken", accessToken);
        String url = BQSupportFuncts.constructUrlFromPropertiesFile(oauthProps, true, null);
        BQConnection bqConn = new BQConnection(url, new Properties());

        BQStatement stmt = new BQStatement(oauthProps.getProperty("projectid"), bqConn);
        stmt.executeQuery("SELECT * FROM orders limit 1");
    }

    @Test
    public void gettingUrlComponentsWorks() throws IOException {
        String url = getUrl("/protectedaccount.properties", null);
        Properties protectedProperties = getProperties("/protectedaccount.properties");
        Properties components = BQSupportFuncts.getUrlQueryComponents(url, new Properties());

        Assert.assertEquals(protectedProperties.getProperty("user"), components.getProperty("user"));
        Assert.assertEquals(protectedProperties.getProperty("password"), components.getProperty("password"));
        Assert.assertEquals(protectedProperties.getProperty("path"), components.getProperty("path"));
    }

    @Test
    public void connectionUseLegacySqlValueFromProperties() throws IOException, SQLException {
        String url = getUrl("/protectedaccount.properties", null);
        BQConnection bqConn = new BQConnection(url, new Properties());
        // default true
        Assert.assertEquals(bqConn.getUseLegacySql(), false);

        String newUrl = url + "&useLegacySql=false";
        BQConnection bqConn2 = new BQConnection(newUrl, new Properties());
        Assert.assertEquals(bqConn2.getUseLegacySql(), false);
    }

    @Test
    public void connectionMaxBillingBytesFromProperties() throws IOException, SQLException {
        String url = getUrl("/protectedaccount.properties", null);
        BQConnection bqConn = new BQConnection(url, new Properties());
        // default null
        Assert.assertNull(bqConn.getMaxBillingBytes());

        String newUrl = url + "&maxbillingbytes=1000000000";
        BQConnection bqConn2 = new BQConnection(newUrl, new Properties());
        Assert.assertEquals((long) bqConn2.getMaxBillingBytes(), 1000000000);
    }

    @Test
    public void maxBillingBytesOverrideWorks() throws IOException, SQLException {
        String url = getUrl("/protectedaccount.properties", null) + "&maxbillingbytes=1" + "&useLegacySql=true";
        BQConnection bqConn = new BQConnection(url, new Properties());
        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bqConn);

        // need to include NOW() otherwise this query will pull from cache & mess up the following ASSERTs
        String sqlStmt = "SELECT word, NOW() from publicdata:samples.shakespeare LIMIT 100";

        boolean didFailAsExpected = false;

        // limited-bytes query should fail
        try {
            stmt.executeQuery(sqlStmt, false);
        } catch (SQLException e) {
            Assert.assertTrue("Expected query to fail because it exceeds maximum billing bytes.", e.toString().contains("Query exceeded limit for bytes billed: 1."));
            didFailAsExpected = true;
        }

        Assert.assertTrue("Query did not fail as expected.", didFailAsExpected);

        // unlimited-bytes query should succeed
        stmt.executeQuery(sqlStmt, true);
    }

    @Test
    public void rootUrlOverrideWorks() throws IOException, SQLException {
        properties = getProperties("/vpcaccount.properties");
        // Add URL-encoded `https://restricted.googleapis.com/` to the JDBC URL.
        URL = getUrl("/vpcaccount.properties", null)
            + "&rootUrl=https%3A%2F%2Frestricted.googleapis.com%2F";
        // Mock a response similar to
        // https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#response-body
        String mockResponse =
            "{ \"jobComplete\": true, "
            + "\"totalRows\": \"0\", "
            + "\"rows\": [], "
            + "\"totalBytesProcessed\": \"0\", "
            + "\"cacheHit\": false }";
        MockHttpTransport mockTransport =
            new MockHttpTransport.Builder()
                .setLowLevelHttpResponse(
                    new MockLowLevelHttpResponse().setContent(mockResponse))
                .build();
        bq = new BQConnection(URL, properties, mockTransport);
        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bq);
        String sqlStmt = "SELECT word from publicdata:samples.shakespeare LIMIT 100";

        stmt.executeQuery(sqlStmt);

        MockLowLevelHttpRequest request = mockTransport.getLowLevelHttpRequest();
        Assert.assertTrue(request.getUrl().startsWith("https://restricted.googleapis.com/bigquery/v2/"));
    }

    @Test
    public void setLabelsTest() throws Exception {
        String url = getUrl("/protectedaccount.properties", null);
        url += "&labels=this%3Dconnection-label,that%3Danother-connection-label";
        BQConnection bqConn = new BQConnection(url, new Properties());
        BQStatement stmt = new BQStatement(properties.getProperty("projectid"), bqConn);
        stmt.setLabels(ImmutableMap.of("the-other", "query-label",
                                       "and-then", "another-query-label"));
        Map<String, String> sentLabels = ImmutableMap.of();

        stmt.executeQuery("SELECT * FROM orders LIMIT 1");

        sentLabels = stmt.getLabelsFromMostRecentQuery(bqConn);
        Assert.assertEquals(4, sentLabels.size());
        Assert.assertEquals("connection-label", sentLabels.get("this"));
        Assert.assertEquals("another-connection-label", sentLabels.get("that"));
        Assert.assertEquals("query-label", sentLabels.get("the-other"));
        Assert.assertEquals("another-query-label", sentLabels.get("and-then"));
    }

    private Properties getProperties(String pathToProp) throws IOException {
        return BQSupportFuncts
                .readFromPropFile(getClass().getResource(pathToProp).getFile());
    }

    private String getUrl(String pathToProp, String dataset) throws IOException {
        return BQSupportFuncts.constructUrlFromPropertiesFile(getProperties(pathToProp), true, dataset);
    }

}


text:
$(document).ready(function() {
    $('form#currencyForm').validate({
        rules: {
            'currency[name]': {
                required: true,
                blank: false,
            },
            'currency[symbol]': {
                required: true,
                blank: false,
                minlength: 1,
                maxlength: 1
            },
            'currency[code]': {
                required: true,
                blank: false,
                minlength: 3,
                maxlength: 3
            }
        },
        highlight: function(element) {
            $(element).closest('.form-group').addClass('has-error');
        },
        unhighlight: function(element) {
            $(element).closest('.form-group').removeClass('has-error');
        },
        errorElement: 'span',
        errorClass: 'help-block',
        errorPlacement: function(error, element) {
            var group = element.closest('.input-group');

            if (group.length) {
                error.insertAfter(group);
            } else {
                error.insertAfter(element);
            }
        },
        invalidHandler: function(form, validator) {
            if (!validator.numberOfInvalids())
                return;

            $('html, body').animate({
                scrollTop: $(validator.errorList[0].element).offset().top - 100
            }, "fast");
        }
    });
});


text:
from flask import Flask, render_template
from flask_bootstrap import Bootstrap
from flask import g
import sqlite3
app = Flask(__name__)
bootstrap = Bootstrap(app)

DATABASE = 'db/bedemss.db'

def get_db():
    db = getattr(g, '_database', None)
    if db is None:
        db = g._database = sqlite3.connect(DATABASE)
    return db

def query_db(query, args=(), one=False):
    cur = get_db().execute(query, args)
    rv = cur.fetchall()
    cur.close()
    return (rv[0] if rv else None) if one else rv

@app.teardown_appcontext
def close_connection(exception):
    db = getattr(g, '_database', None)
    if db is not None:
        db.close()

@app.route('/')
@app.route('/index.html')
@app.route('/index')
def index():
    return render_template('homepage.html')

@app.route('/bedemss')
def bedemss_home():
    cur = get_db().cursor()
    works = [w for w in query_db('select * from works')]
    return render_template('bedemss.html', works=works)

@app.route('/bedemss/<work_id>')
def work_mss(work_id):
    cur = get_db().cursor()
    work = query_db(
        'select * from works where abbreviation = ?',
        [work_id], one=True)
    return render_template('work_mss.html', work=work)

if __name__ == '__main__':
    app.run(debug = True)


text:
namespace chrono {

/// Screw joint between two rigid bodies. This
/// link type is able to couple translation and rotation.

class ChApi ChLinkScrew : public ChLinkLock {

    // Tag needed for class factory in archive (de)serialization:
    CH_FACTORY_TAG(ChLinkScrew)

  protected:
    double tau;  ///< transmission coeff.

  public:
    ChLinkScrew();
    ChLinkScrew(const ChLinkScrew& other);
    virtual ~ChLinkScrew() {}

    /// "Virtual" copy constructor (covariant return type).
    virtual ChLinkScrew* Clone() const override { return new ChLinkScrew(*this); }

    // Inherit the link-lock computations like it were a
    // normal "revolute" joint, but then modifies the Z-lock parts of C,
    // Cdt, Cdtdt, [Cq] etc., in order to have z = tau * alpha.
    virtual void UpdateState() override;

    double Get_tau() const { return tau; };
    void Set_tau(double mset) { tau = mset; }
    double Get_thread() const { return tau * (2 * CH_C_PI); };
    void Set_thread(double mset) { tau = mset / (2 * CH_C_PI); }

    /// Method to allow serialization of transient data to archives.
    virtual void ArchiveOUT(ChArchiveOut& marchive) override;

    /// Method to allow deserialization of transient data from archives.
    virtual void ArchiveIN(ChArchiveIn& marchive) override;
};

CH_CLASS_VERSION(ChLinkScrew,0)

}  // end namespace chrono

#endif


text:
require 'sequel/extensions/search_path/version'

module Sequel
  module SearchPath
    def use_schema(*new_schemas, &block)
      synchronize { override_schema(*(new_schemas + schemas), &block) }
    end

    def override_schema(*new_schemas, &block)
      synchronize do
        previous_schemas = schemas

        begin
          self.schemas = new_schemas
          yield
        ensure
          self.schemas = previous_schemas
        end
      end
    end

    def schemas
      Thread.current[schemas_key] ||= parse_search_path
    end

    def schemas=(new_schemas)
      new_schemas = new_schemas.map(&:to_sym).uniq

      return if schemas == new_schemas

      Thread.current[schemas_key] = new_schemas

      # Set the search_path in Postgres, unless it's in transaction rollback.
      # If it is, the search_path will be reset for us anyway, and the SQL
      # call will just raise another error.
      unless synchronize(&:transaction_status) == PG::PQTRANS_INERROR
        set_search_path(new_schemas)
      end
    end

    # The schema that new objects will be created in.
    def active_schema
      schemas.first
    end

    def search_path
      self["SHOW search_path"].get
    end
    alias :show_search_path :search_path

    def freeze
      schemas_key
      super
    end

    private

    def parse_search_path
      search_path.
        split(/[\s,]+/).
        map{|s| s.gsub(/\A"|"\z/, '')}.
        reject{|s| s == '$user'}.
        map(&:to_sym)
    end

    def set_search_path(schemas)
      placeholders = schemas.map{'?'}.join(', ')
      placeholders = "''" if placeholders.empty?
      self["SET search_path TO #{placeholders}", *schemas].get
    end

    def schemas_key
      @schemas_key ||= "sequel-search-path-#{object_id}".to_sym
    end
  end

  Database.register_extension(:search_path){|db| db.extend(Sequel::SearchPath)}
end


text:
#import "ANAdAdapterBannerFacebook.h"
#import "ANLogging.h"

@interface ANAdAdapterBannerFacebook()

@property (nonatomic, strong) FBAdView *fbAdView;

@end

@implementation ANAdAdapterBannerFacebook

@synthesize delegate;

- (void)requestBannerAdWithSize:(CGSize)size
             rootViewController:(UIViewController *)rootViewController
                serverParameter:(NSString *)parameterString
                       adUnitId:(NSString *)idString
            targetingParameters:(ANTargetingParameters *)targetingParameters {
    if (CGSizeEqualToSize(size, kFBAdSize320x50.size)) {
        self.fbAdView = [[FBAdView alloc] initWithPlacementID:idString
                                                       adSize:kFBAdSize320x50
                                           rootViewController:rootViewController];
        self.fbAdView.frame = CGRectMake(0, 0, kFBAdSize320x50.size.width, kFBAdSize320x50.size.height);
        self.fbAdView.delegate = self;
        [self.fbAdView loadAd];
    } else {
        [self.delegate didFailToLoadAd:ANAdResponseUnableToFill];
    }
}

#pragma mark FBAdViewDelegate methods

- (void)adView:(FBAdView *)adView didFailWithError:(NSError *)error {
    ANLogDebug(@"Facebook banner failed to load with error: %@", error);
    ANAdResponseCode code = ANAdResponseInternalError;
    if (error.code == 1001) {
        code = ANAdResponseUnableToFill;
    }
    [self.delegate didFailToLoadAd:code];
}

- (void)adViewDidLoad:(FBAdView *)adView {
    [self.delegate didLoadBannerAd:adView];
}

- (void)adViewDidClick:(FBAdView *)adView {
    [self.delegate adWasClicked];
    [self.delegate willPresentAd];
    [self.delegate didPresentAd];
}

- (void)adViewDidFinishHandlingClick:(FBAdView *)adView {
    [self.delegate willCloseAd];
    [self.delegate didCloseAd];
}

@end


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/default_background"
            android:paddingBottom="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:paddingTop="@dimen/activity_vertical_margin"
            tools:context="com.adafruit.bluefruit.le.connect.app.ColorPickerActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        >

        <!--
            <com.adafruit.bluefruit.le.connect.ui.utils.ColorPicker
                android:id="@+id/colorPicker"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
        -->
        <com.larswerkman.holocolorpicker.ColorPicker
            android:id="@+id/colorPicker"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"/>

        <com.larswerkman.holocolorpicker.SaturationBar
            android:id="@+id/saturationbar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"/>

        <com.larswerkman.holocolorpicker.ValueBar
            android:id="@+id/valuebar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:orientation="vertical">

            <TextView
                android:id="@+id/rgbTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="10dp"
                android:text="@string/colorpicker_rgbformat"
                android:textColor="#ffffff"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <View
                        android:id="@+id/rgbColorView"
                        android:layout_width="match_parent"
                        android:layout_height="80dp"
                        android:background="#ff0000"
                        />
                </LinearLayout>

                <Button
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginLeft="10dp"
                    android:layout_weight="1"
                    android:onClick="onClickSend"
                    android:text="@string/colorpicker_send"/>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
</ScrollView>


text:
@interface PostTextBody : UITextView
@property (nonatomic, strong) UILabel* tintText;
@end