text:
<?php

$piereg = get_option( 'pie_register_2' );

$piereg_custom = get_option( 'pie_register_custom' );

if( $_POST['notice'] ){

echo '

' . $_POST['notice'] . '.

';

}

?>

<?php _e('You are currently using version of 1 of Pie-Register, which will be deprecated soon. We have released a Version 2.0 of this plugin. Please ' , 'piereg');?><?php _e('Click here', 'piereg');?> <?php _e('to get more information.');?>

<?php _e('Customize User Notification Email', 'piereg');?>

<form method="post" action="" enctype="multipart/form-data">

<?php if( function_exists( 'wp_nonce_field' )) wp_nonce_field( 'piereg-update-options'); ?>

<input name="Submit" value="<?php _e('Save Changes','piereg');?>" type="submit" />

<?php _e('Customize User Notification Email', 'piereg');?>

<?php _e('Custom User Email Notification', 'piereg');?>

<input type="checkbox" name="piereg_custom_msg" id="custom_msg" value="1" <?php if( $piereg['custom_msg'] ) echo 'checked="checked"';?> /> <?php _e('Enable', 'piereg');?>

<?php _e('From Email', 'piereg');?>

<input type="text" name="piereg_from" id="from" style="width:250px;" value="<?php echo $piereg['from'];?>" />

<?php _e('From Name', 'piereg');?>

<input type="text" name="piereg_fromname" id="fromname" style="width:250px;" value="<?php echo $piereg['fromname'];?>" />

<?php _e('Subject', 'piereg');?>

<input type="text" name="piereg_subject" id="subject" style="width:350px;" value="<?php echo $piereg['subject'];?>" />

<?php _e('User Message', 'piereg');?>

<?php

if( $piereg['firstname'] ) $custom_keys .= '   %firstname%';

if( $piereg['lastname'] ) $custom_keys .= '   %lastname%';

if( $piereg['website'] ) $custom_keys .= '   %website%';

if( $piereg['aim'] ) $custom_keys .= '   %aim%';

if( $piereg['yahoo'] ) $custom_keys .= '   %yahoo%';

if( $piereg['jabber'] ) $custom_keys .= '   %jabber%';

if( $piereg['about'] ) $custom_keys .= '   %about%';

if( $piereg['code'] ) $custom_keys .= '   %'.$piereg['codename'].'code%';

if( is_array($piereg_custom) ){

foreach( $piereg_custom as $k=>$v ){

$meta = $this->Label_ID($v['label']);

$value = get_usermeta( $user_id, $meta );

$custom_keys .= '   %'.$meta.'%';

}

}

?>

<?php _e('Replacement Keys', 'piereg');?>:   %user_login%    %user_pass%   %user_email%   %blogname%   %siteurl% <?php echo $custom_keys; ?>  %user_ip%   %user_ref%   %user_host%   %user_agent%

<textarea name="piereg_msg" id="msg" rows="10" cols="25" style="width:80%;height:300px;"><?php echo $piereg['msg'];?></textarea>
<input type="checkbox" name="piereg_html" id="html" value="1" <?php if( $piereg['html'] ) echo 'checked="checked"';?> /> <?php _e('Send as HTML', 'piereg');?>   <input type="checkbox" name="piereg_user_nl2br" id="html" value="1" <?php if( $piereg['user_nl2br'] ) echo 'checked="checked"';?> /> <?php _e('Convert new lines to <br/> tags (HTML only)' , 'piereg');?>

<?php _e('Pending Email Verification Message', 'piereg');?>

<textarea name="piereg_emailvmsg" id="emailvmsg" rows="10" cols="25" style="width:80%;height:300px;"><?php echo $piereg['emailvmsg'];?></textarea>
<input type="checkbox" name="piereg_emailvmsghtml" id="emailvmsghtml" value="1" <?php if( $piereg['emailvmsghtml'] ) echo 'checked="checked"';?> /> <?php _e('Send as HTML', 'piereg');?>   <input type="checkbox" name="piereg_emailvmsguser_nl2br" id="html" value="1" <?php if( $piereg['emailvmsguser_nl2br'] ) echo 'checked="checked"';?> /> <?php _e('Convert new lines to <br/> tags (HTML only)' , 'piereg');?>

<?php _e('Pending Admin Verification Message', 'piereg');?>

<textarea name="piereg_adminvmsg" id="adminvmsg" rows="10" cols="25" style="width:80%;height:300px;"><?php echo $piereg['adminvmsg'];?></textarea>
<input type="checkbox" name="piereg_adminvmsghtml" id="adminvmsghtml" value="1" <?php if( $piereg['adminvmsghtml'] ) echo 'checked="checked"';?> /> <?php _e('Send as HTML', 'piereg');?>   <input type="checkbox" name="piereg_adminvmsguser_nl2br" id="html" value="1" <?php if( $piereg['adminvmsguser_nl2br'] ) echo 'checked="checked"';?> /> <?php _e('Convert new lines to <br/> tags (HTML only)' , 'piereg');?>

<?php _e('Customize Admin Notification Email', 'piereg');?>

<?php _e('Admin Email Notification', 'piereg');?>

<input type="checkbox" name="piereg_disable_admin" id="disable_admin" value="1" <?php if( $piereg['disable_admin'] ) echo 'checked="checked"';?> /> <?php _e('Disable', 'piereg');?>

<?php _e('Custom Admin Email Notification', 'piereg');?>

<input type="checkbox" name="piereg_custom_adminmsg" id="custom_adminmsg" value="1" <?php if( $piereg['custom_adminmsg'] ) echo 'checked="checked"';?> /> <?php _e('Enable', 'piereg');?>

<?php _e('From Email', 'piereg');?>

<input type="text" name="piereg_adminfrom" id="adminfrom" style="width:250px;" value="<?php echo $piereg['adminfrom'];?>" />

<?php _e('From Name', 'piereg');?>

<input type="text" name="piereg_adminfromname" id="adminfromname" style="width:250px;" value="<?php echo $piereg['adminfromname'];?>" />

<?php _e('Subject', 'piereg');?>

<input type="text" name="piereg_adminsubject" id="adminsubject" style="width:350px;" value="<?php echo $piereg['adminsubject'];?>" />

<?php _e('Admin Message', 'piereg');?>

<?php _e('Replacement Keys', 'piereg');?>:   %user_login%    %user_email%   %blogname%   %siteurl%  <?php echo $custom_keys; ?>  %user_ip%   %user_ref%   %user_host%   %user_agent%
<textarea name="piereg_adminmsg" id="adminmsg" rows="10" cols="25" style="width:80%;height:300px;"><?php echo $piereg['adminmsg'];?></textarea>
<input type="checkbox" name="piereg_adminhtml" id="adminhtml" value="1" <?php if( $piereg['adminhtml'] ) echo 'checked="checked"';?> /> <?php _e('Send as HTML' , 'piereg');?>   <input type="checkbox" name="piereg_admin_nl2br" id="html" value="1" <?php if( $piereg['admin_nl2br'] ) echo 'checked="checked"';?> /> <?php _e('Convert new lines to <br/> tags (HTML only)' , 'piereg');?>

<input name="action" value="pie_reg_update" type="hidden" />

<input type="hidden" name="email_notification_page" value="1" />

<input name="Submit" value="<?php _e('Save Changes','piereg');?>" type="submit" />

</form>


text:
from __future__ import print_function
from blib_util import *
import sys
import build_externals
import build_cubicer

if __name__ == "__main__":
    cfg = cfg_from_argv(sys.argv)
    info = build_info(cfg)

    build_externals.build(info)
    build_cubicer.build(info)

redpajama_set_name: RedPajamaGithub


text:
require({cache:{
'url:dojorama/ui/release/template/ReleaseUpdatePage.html':"
\n

\n    \n
\n

\n

\n

\n

\n    \n
\n

\n
\n    \n

\n
\n    \n

\n
",
'url:dojorama/styles/inline/ui/release/ReleaseUpdatePage.css':"body {background: white;}"}});
/*jshint strict:false */

define("dojorama/ui/release/ReleaseUpdatePage", [
    "dojo/_base/declare",
    "mijit/_WidgetBase",
    "mijit/_TemplatedMixin",
    "dojomat/_AppAware",
    "dojomat/_StateAware",
    "../_global/mixin/_NavigationMixin",
    "../_global/mixin/_PlayerMixin",
    "../_global/mixin/_NotificationMixin",
    "../_global/mixin/_FooterMixin",
    "./mixin/_ReleaseBreadcrumbsMixin",
    "./mixin/_ReleaseActionsMixin",
    "./mixin/_ReleaseComponentTitleMixin",
    "./widget/ReleaseUpdateFormWidget",
    "../../service/release-store",
    "dojo/topic",
    "dojo/_base/lang",
    "dojo/text!./template/ReleaseUpdatePage.html",
    "dojo/i18n!./nls/ReleaseUpdatePage",
    "dojo/text!../../styles/inline/ui/release/ReleaseUpdatePage.css"
], function (
    declare,
    _WidgetBase,
    _TemplatedMixin,
    _AppAware,
    _StateAware,
    _NavigationMixin,
    _PlayerMixin,
    _NotificationMixin,
    _FooterMixin,
    _ReleaseBreadcrumbsMixin,
    _ReleaseActionsMixin,
    _ReleaseComponentTitleMixin,
    ReleaseUpdateFormWidget,
    releaseStore,
    topic,
    lang,
    template,
    nls,
    css
) {
    return declare([_WidgetBase, _TemplatedMixin, _AppAware, _StateAware, _NavigationMixin, _PlayerMixin, _NotificationMixin, _FooterMixin, _ReleaseBreadcrumbsMixin, _ReleaseActionsMixin, _ReleaseComponentTitleMixin], {

        router: null,
        request: null,
        session: null,
        notification: null,
        templateString: template,
        formWidget: null,
        releaseStore: null,

        constructor: function (params) {
            this.router = params.router;
            this.request = params.request;
            this.session = params.session;
            this.notification = params.notification;
        },

        postCreate: function () {
            this.inherited(arguments);
            this.setCss(css, 'all');

            this.formWidget = new ReleaseUpdateFormWidget({
                store: releaseStore,
                releaseId: this.request.getPathParam('id')
            }, this.formNode);

            // set subscriptions
            this.setSubscriptions();
        },

        startup: function () {
            this.inherited(arguments);
            this.showNavigation();
            this.showFooter();
            this.showReleaseActions();
            this.formWidget.startup();
            this.formWidget.show();
        },

        setSubscriptions: function () {
            this.own(topic.subscribe('ui/release/widget/ReleaseUpdateFormWidget/load-ok', lang.hitch(this, function (release) {
                this.setTitle(release.get('title'));
                this.setReleaseUpdateBreadcrumbsItems(release.get('title'));
                this.showReleaseBreadcrumbs();

                if (this.notification) {
                    this.showNotification(this.notification);
                }
            })));

            this.own(topic.subscribe('ui/release/widget/ReleaseUpdateFormWidget/load-error', lang.hitch(this, function (error) {
                this.handleError(error);
            })));

            this.own(topic.subscribe('ui/release/widget/ReleaseUpdateFormWidget/load-not-found', lang.hitch(this, function () {
                this.handleNotFound();
            })));

            this.own(topic.subscribe('ui/release/widget/ReleaseUpdateFormWidget/submit', lang.hitch(this, function () {
                this.hideNotification();
            })));

            this.own(topic.subscribe('ui/release/widget/ReleaseUpdateFormWidget/update-ok', lang.hitch(this, function (data) {
                this.setTitle(data.model.get('title'));
                this.showNotification(data.notification);
            })));
        }
    });
});


text:
/****************************/
/* THIS IS OPEN SOURCE CODE */
/****************************/

/**
 * @file    linux-CNKunit.c
 * @author  Heike Jagode
 *          jagode@eecs.utk.edu
 * Mods:	<your name here>
 *			<your email address>
 * BGPM / CNKunit component
 *
 * Tested version of bgpm (early access)
 *
 * @brief
 *  This file has the source code for a component that enables PAPI-C to
 *  access hardware monitoring counters for BG/Q through the bgpm library.
 */

#include "linux-CNKunit.h"

/* Declare our vector in advance */
papi_vector_t _CNKunit_vector;

/*****************************************************************************
 *******************  BEGIN PAPI's COMPONENT REQUIRED FUNCTIONS  *************
 *****************************************************************************/

/*
 * This is called whenever a thread is initialized
 */
int
CNKUNIT_init_thread( hwd_context_t * ctx )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_init_thread\n" );
#endif

	( void ) ctx;
	return PAPI_OK;
}

/* Initialize hardware counters, setup the function vector table
 * and get hardware information, this routine is called when the
 * PAPI process is initialized (IE PAPI_library_init)
 */
int
CNKUNIT_init_component( int cidx )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_init_component\n" );
#endif

	_CNKunit_vector.cmp_info.CmpIdx = cidx;
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_init_component cidx = %d\n", cidx );
#endif

	return ( PAPI_OK );
}

/*
 * Control of counters (Reading/Writing/Starting/Stopping/Setup)
 * functions
 */
int
CNKUNIT_init_control_state( hwd_control_state_t * ptr )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_init_control_state\n" );
#endif

	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ptr;

	this_state->EventGroup = Bgpm_CreateEventSet();
	CHECK_BGPM_ERROR( this_state->EventGroup, "Bgpm_CreateEventSet" );

	return PAPI_OK;
}

/*
 *
 */
int
CNKUNIT_start( hwd_context_t * ctx, hwd_control_state_t * ptr )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_start\n" );
#endif
	( void ) ctx;
	int retval;
	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ptr;

	retval = Bgpm_Apply( this_state->EventGroup );
	CHECK_BGPM_ERROR( retval, "Bgpm_Apply" );

	/* Bgpm_Apply() does an implicit reset;
	 hence no need to use Bgpm_ResetStart */
	retval = Bgpm_Start( this_state->EventGroup );
	CHECK_BGPM_ERROR( retval, "Bgpm_Start" );

	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_stop( hwd_context_t * ctx, hwd_control_state_t * ptr )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_stop\n" );
#endif
	( void ) ctx;
	int retval;
	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ptr;

	retval = Bgpm_Stop( this_state->EventGroup );
	CHECK_BGPM_ERROR( retval, "Bgpm_Stop" );

	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_read( hwd_context_t * ctx, hwd_control_state_t * ptr,
		   long_long ** events, int flags )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_read\n" );
#endif
	( void ) ctx;
	( void ) flags;
	int i, numEvts;
	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ptr;

	numEvts = Bgpm_NumEvents( this_state->EventGroup );
	if ( numEvts == 0 ) {
#ifdef DEBUG_BGPM
		printf ("Error: ret value is %d for BGPM API function Bgpm_NumEvents.\n", numEvts );
#endif
		//return ( EXIT_FAILURE );
	}

	for ( i = 0; i < numEvts; i++ )
		this_state->counts[i] = _common_getEventValue( i, this_state->EventGroup );

	*events = this_state->counts;

	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_shutdown_thread( hwd_context_t * ctx )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_shutdown_thread\n" );
#endif
	( void ) ctx;
	return ( PAPI_OK );
}

/* This function sets various options in the component
 * The valid codes being passed in are PAPI_SET_DEFDOM,
 * PAPI_SET_DOMAIN, PAPI_SETDEFGRN, PAPI_SET_GRANUL * and PAPI_SET_INHERIT
 */
int
CNKUNIT_ctl( hwd_context_t * ctx, int code, _papi_int_option_t * option )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_ctl\n" );
#endif
	( void ) ctx;
	( void ) code;
	( void ) option;
	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_update_control_state( hwd_control_state_t * ptr,
						   NativeInfo_t * native, int count,
						   hwd_context_t * ctx )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_update_control_state: count = %d\n", count );
#endif
	( void ) ctx;
	int retval, index, i;
	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ptr;

	// Delete and re-create BGPM eventset
	_common_deleteRecreate( &this_state->EventGroup );

	// otherwise, add the events to the eventset
	for ( i = 0; i < count; i++ ) {
		index = ( native[i].ni_event ) + OFFSET;

		native[i].ni_position = i;

#ifdef DEBUG_BGQ
		printf("CNKUNIT_update_control_state: ADD event: i = %d, index = %d\n", i, index );
#endif

		/* Add events to the BGPM eventGroup */
		retval = Bgpm_AddEvent( this_state->EventGroup, index );
		CHECK_BGPM_ERROR( retval, "Bgpm_AddEvent" );
	}

	return ( PAPI_OK );
}

/*
 * This function has to set the bits needed to count different domains
 * In particular: PAPI_DOM_USER, PAPI_DOM_KERNEL PAPI_DOM_OTHER
 * By default return PAPI_EINVAL if none of those are specified
 * and PAPI_OK with success
 * PAPI_DOM_USER is only user context is counted
 * PAPI_DOM_KERNEL is only the Kernel/OS context is counted
 * PAPI_DOM_OTHER  is Exception/transient mode (like user TLB misses)
 * PAPI_DOM_ALL   is all of the domains
 */
int
CNKUNIT_set_domain( hwd_control_state_t * cntrl, int domain )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_set_domain\n" );
#endif
	int found = 0;
	( void ) cntrl;

	if ( PAPI_DOM_USER & domain )
		found = 1;

	if ( PAPI_DOM_KERNEL & domain )
		found = 1;

	if ( PAPI_DOM_OTHER & domain )
		found = 1;

	if ( !found )
		return ( PAPI_EINVAL );

	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_reset( hwd_context_t * ctx, hwd_control_state_t * ptr )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_reset\n" );
#endif
	( void ) ctx;
	int retval;
	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ptr;

	/* we can't simply call Bgpm_Reset() since PAPI doesn't have the
	 restriction that an EventSet has to be stopped before resetting is
	 possible. However, BGPM does have this restriction.
	 Hence we need to stop, reset and start */
	retval = Bgpm_Stop( this_state->EventGroup );
	CHECK_BGPM_ERROR( retval, "Bgpm_Stop" );

	retval = Bgpm_ResetStart( this_state->EventGroup );
	CHECK_BGPM_ERROR( retval, "Bgpm_ResetStart" );

	return ( PAPI_OK );
}

/*
 * PAPI Cleanup Eventset
 *
 * Destroy and re-create the BGPM / CNKunit EventSet
 */
int
CNKUNIT_cleanup_eventset( hwd_control_state_t * ctrl )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_cleanup_eventset\n" );
#endif

	CNKUNIT_control_state_t * this_state = ( CNKUNIT_control_state_t * ) ctrl;

	// create a new empty bgpm eventset
	// reason: bgpm doesn't permit to remove events from an eventset;
	// hence we delete the old eventset and create a new one
	_common_deleteRecreate( &this_state->EventGroup ); // HJ try to use delete() only

	return ( PAPI_OK );
}

/*
 * Native Event functions
 */
int
CNKUNIT_ntv_enum_events( unsigned int *EventCode, int modifier )
{
#ifdef DEBUG_BGQ
//	printf( "CNKUNIT_ntv_enum_events\n" );
#endif

	switch ( modifier ) {
	case PAPI_ENUM_FIRST:
		*EventCode = 0;

		return ( PAPI_OK );
		break;

	case PAPI_ENUM_EVENTS:
	{
		int index = ( *EventCode ) + OFFSET;

		if ( index < CNKUNIT_MAX_COUNTERS ) {
			*EventCode = *EventCode + 1;
			return ( PAPI_OK );
		} else
			return ( PAPI_ENOEVNT );

		break;
	}
	default:
		return ( PAPI_EINVAL );
	}
	return ( PAPI_EINVAL );
}

/*
 *
 */
int
CNKUNIT_ntv_name_to_code( char *name, unsigned int *event_code )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_ntv_name_to_code\n" );
#endif
	int ret;

	/* Return event id matching a given event label string */
	ret = Bgpm_GetEventIdFromLabel ( name );

	if ( ret <= 0 ) {
#ifdef DEBUG_BGPM
		printf ("Error: ret value is %d for BGPM API function '%s'.\n",
				ret, "Bgpm_GetEventIdFromLabel" );
#endif
		return PAPI_ENOEVNT;
	}
	else if ( ret < OFFSET || ret > CNKUNIT_MAX_COUNTERS ) // not a CNKUnit event
		return PAPI_ENOEVNT;
	else
		*event_code = ( ret - OFFSET ) ;

	return PAPI_OK;
}

/*
 *
 */
int
CNKUNIT_ntv_code_to_name( unsigned int EventCode, char *name, int len )
{
#ifdef DEBUG_BGQ
	//printf( "CNKUNIT_ntv_code_to_name\n" );
#endif
	int index;

	index = ( EventCode ) + OFFSET;

	if ( index >= MAX_COUNTERS )
		return PAPI_ENOEVNT;

	strncpy( name, Bgpm_GetEventIdLabel( index ), len );
	//printf("----%s----\n", name);

	if ( name == NULL ) {
#ifdef DEBUG_BGPM
		printf ("Error: ret value is NULL for BGPM API function Bgpm_GetEventIdLabel.\n" );
#endif
		return PAPI_ENOEVNT;
	}

	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_ntv_code_to_descr( unsigned int EventCode, char *name, int len )
{
#ifdef DEBUG_BGQ
	//printf( "CNKUNIT_ntv_code_to_descr\n" );
#endif
	int retval, index;

	index = ( EventCode ) + OFFSET;

	retval = Bgpm_GetLongDesc( index, name, &len );
	CHECK_BGPM_ERROR( retval, "Bgpm_GetLongDesc" );

	return ( PAPI_OK );
}

/*
 *
 */
int
CNKUNIT_ntv_code_to_bits( unsigned int EventCode, hwd_register_t * bits )
{
#ifdef DEBUG_BGQ
	printf( "CNKUNIT_ntv_code_to_bits\n" );
#endif
	( void ) EventCode;
	( void ) bits;
	return ( PAPI_OK );
}

/*
 *
 */
papi_vector_t _CNKunit_vector = {
	.cmp_info = {
				 /* default component information (unspecified values are initialized to 0) */
				 .name = "bgpm/CNKUnit",
				 .short_name = "CNKUnit",
				 .description = "Blue Gene/Q CNKUnit component",
				 .num_cntrs = CNKUNIT_MAX_COUNTERS,
				 .num_mpx_cntrs = CNKUNIT_MAX_COUNTERS,
				 .default_domain = PAPI_DOM_USER,
				 .available_domains = PAPI_DOM_USER | PAPI_DOM_KERNEL,
				 .default_granularity = PAPI_GRN_THR,
				 .available_granularities = PAPI_GRN_THR,

				 .hardware_intr_sig = PAPI_INT_SIGNAL,
				 .hardware_intr = 1,

				 .kernel_multiplex = 0,

				 /* component specific cmp_info initializations */
				 .fast_real_timer = 0,
				 .fast_virtual_timer = 0,
				 .attach = 0,
				 .attach_must_ptrace = 0,

				 }
	,

	/* sizes of framework-opaque component-private structures */
	.size = {
			 .context = sizeof ( CNKUNIT_context_t ),
			 .control_state = sizeof ( CNKUNIT_control_state_t ),
			 .reg_value = sizeof ( CNKUNIT_register_t ),
			 .reg_alloc = sizeof ( CNKUNIT_reg_alloc_t ),
			 }
	,
	/* function pointers in this component */
	.init_thread = CNKUNIT_init_thread,
	.init_component = CNKUNIT_init_component,
	.init_control_state = CNKUNIT_init_control_state,
	.start = CNKUNIT_start,
	.stop = CNKUNIT_stop,
	.read = CNKUNIT_read,
	.shutdown_thread = CNKUNIT_shutdown_thread,
	.cleanup_eventset = CNKUNIT_cleanup_eventset,
	.ctl = CNKUNIT_ctl,

	.update_control_state = CNKUNIT_update_control_state,
	.set_domain = CNKUNIT_set_domain,
	.reset = CNKUNIT_reset,

	.ntv_name_to_code = CNKUNIT_ntv_name_to_code,
	.ntv_enum_events = CNKUNIT_ntv_enum_events,
	.ntv_code_to_name = CNKUNIT_ntv_code_to_name,
	.ntv_code_to_descr = CNKUNIT_ntv_code_to_descr,
	.ntv_code_to_bits = CNKUNIT_ntv_code_to_bits
};


text:
package main

import (
	"context"
	"flag"
	"fmt"
	"os"
	"os/signal"
	"strings"
	"time"

	"cloud.google.com/go/spanner"
)

func usage() {
	command := os.Args[0]
	fmt.Printf(`Usage:
  %s [OPTIONS]

Options:
  -p, --project=  (required)   GCP Project ID
  -i, --instance= (required)   Cloud Spanner Instance ID
  -d, --database= (required)   Cloud Spanner Database ID
  -s, --stream=   (required)   Cloud Spanner Change Stream ID
  -f, --format=                Output format [text|json] (default: text)
      --start=                 Start timestamp with RFC3339 format (default: current timestamp)
      --end=                   End timestamp with RFC3339 format (default: none)
      --visualize-partitions   Visualize the change stream partitions in Graphviz DOT

Help Options:
  -h, -help                    Show this help message
`, command)
}

func main() {
	var (
		projectID, instanceID, databaseID, streamID, format, start, end string
		startTimestamp, endTimestamp                                    time.Time
		verbose, visualizePartitions                                    bool
	)

	// Long options.
	flag.StringVar(&projectID, "project", "", "")
	flag.StringVar(&instanceID, "instance", "", "")
	flag.StringVar(&databaseID, "database", "", "")
	flag.StringVar(&streamID, "stream", "", "")
	flag.StringVar(&format, "format", formatText, "")
	flag.StringVar(&start, "start", "", "")
	flag.StringVar(&end, "end", "", "")
	flag.BoolVar(&verbose, "verbose", false, "")
	flag.BoolVar(&visualizePartitions, "visualize-partitions", false, "")

	// Short options.
	flag.StringVar(&projectID, "p", "", "")
	flag.StringVar(&instanceID, "i", "", "")
	flag.StringVar(&databaseID, "d", "", "")
	flag.StringVar(&streamID, "s", "", "")
	flag.StringVar(&format, "f", formatText, "")
	flag.BoolVar(&verbose, "v", false, "")

	flag.Usage = usage
	flag.Parse()

	// Validate required options.
	if projectID == "" || instanceID == "" || databaseID == "" || streamID == "" {
		flag.Usage()
		os.Exit(1)
	}

	// Validate optional options.
	if format != formatText && format != formatJSON {
		exitf("invalid format: %s", format)
	}
	if start != "" {
		ts, err := time.Parse(time.RFC3339, start)
		if err != nil {
			exitf("invalid start timestamp: %v", err)
		}
		startTimestamp = ts
	}
	if end != "" {
		ts, err := time.Parse(time.RFC3339, end)
		if err != nil {
			exitf("invalid end timestamp: %v", err)
		}
		endTimestamp = ts
	}
	if visualizePartitions {
		if start == "" || end == "" {
			exitf("To visualize partitions, specify --start and --end options as well")
		}
	}

	ctx, cancel := context.WithCancel(context.Background())
	go handleInterrupt(cancel)

	dbPath := fmt.Sprintf("projects/%s/instances/%s/databases/%s", projectID, instanceID, databaseID)
	client, err := spanner.NewClientWithConfig(ctx, dbPath, spanner.ClientConfig{
		SessionPoolConfig: spanner.SessionPoolConfig{
			MinOpened:     1,
			WriteSessions: 0,
		},
	})
	if err != nil {
		exitf("failed to create spanner client: %v", err)
	}
	defer client.Close()

	subscriber := NewSubscriber(client, streamID, startTimestamp, endTimestamp)

	if visualizePartitions {
		fmt.Fprintf(os.Stderr, "Reading the stream and analyzing partitions...\n\n")
		visualizer := NewPartitionVisualizer(os.Stdout)
		if err := subscriber.Subscribe(ctx, visualizer); err != nil {
			exitf("failed to read stream: %v", err)
		}
		visualizer.Draw()
		return
	}

	fmt.Fprintf(os.Stderr, "Reading the stream...\n")

	logger := &Logger{
		out:     os.Stdout,
		format:  format,
		verbose: verbose,
	}
	if err := subscriber.Subscribe(ctx, logger); err != nil {
		exitf("failed to read stream: %v", err)
	}
}

func exitf(format string, a ...interface{}) {
	message := fmt.Sprintf(format, a...)
	if !strings.HasSuffix(message, "\n") {
		message += "\n"
	}
	fmt.Fprint(os.Stderr, message)
	os.Exit(1)
}

func handleInterrupt(cancel context.CancelFunc) {
	c := make(chan os.Signal, 1)
	signal.Notify(c, os.Interrupt)
	<-c
	cancel()
}


text:
sudo apt-get -y install dkms
sudo mount -o loop /home/vagrant/VBoxGuestAdditions.iso /mnt
sudo sh /mnt/VBoxLinuxAdditions.run
sudo umount /mnt
sudo /etc/init.d/vboxadd setup


text:
// Copyright (C) 2011 - Will Glozer.  All rights reserved.

package com.lambdaworks.redis.output;

import com.lambdaworks.redis.RedisException;
import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.protocol.Command;
import com.lambdaworks.redis.protocol.CommandOutput;

import java.nio.ByteBuffer;
import java.util.*;

/**
 * Output of all commands within a MULTI block.
 *
 * @author Will Glozer
 */
public class MultiOutput<K, V> extends CommandOutput<K, V, List<Object>> {
    private Queue<Command<K, V, ?>> queue;

    public MultiOutput(RedisCodec<K, V> codec) {
        super(codec, new ArrayList<Object>());
        queue = new LinkedList<Command<K, V, ?>>();
    }

    public void add(Command<K, V, ?> cmd) {
        queue.add(cmd);
    }

    @Override
    public void set(long integer) {
        queue.peek().getOutput().set(integer);
    }

    @Override
    public void set(ByteBuffer bytes) {
        queue.peek().getOutput().set(bytes);
    }

    @Override
    public void setError(ByteBuffer error) {
        queue.peek().getOutput().setError(error);
    }

    @Override
    public void complete(int depth) {
        if (depth == 1) {
            Command<K, V, ?> cmd = queue.remove();
            CommandOutput<K, V, ?> o = cmd.getOutput();
            output.add(!o.hasError() ? o.get() : new RedisException(o.getError()));
            cmd.complete();
        } else if (depth == 0 && !queue.isEmpty()) {
            for (Command<K, V, ?> cmd : queue) {
                cmd.complete();
            }
        }
    }
}


text:
/* ----------------------------------------------------------------- */
/*           The Japanese TTS System "Open JTalk"                    */
/*           developed by HTS Working Group                          */
/*           http://open-jtalk.sourceforge.net/                      */
/* ----------------------------------------------------------------- */
/*                                                                   */
/*  Copyright (c) 2008-2014  Nagoya Institute of Technology          */
/*                           Department of Computer Science          */
/*                                                                   */
/* All rights reserved.                                              */
/*                                                                   */
/* Redistribution and use in source and binary forms, with or        */
/* without modification, are permitted provided that the following   */
/* conditions are met:                                               */
/*                                                                   */
/* - Redistributions of source code must retain the above copyright  */
/*   notice, this list of conditions and the following disclaimer.   */
/* - Redistributions in binary form must reproduce the above         */
/*   copyright notice, this list of conditions and the following     */
/*   disclaimer in the documentation and/or other materials provided */
/*   with the distribution.                                          */
/* - Neither the name of the HTS working group nor the names of its  */
/*   contributors may be used to endorse or promote products derived */
/*   from this software without specific prior written permission.   */
/*                                                                   */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND            */
/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,       */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF          */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE          */
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */
/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,          */
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED   */
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,     */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
/* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,   */
/* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY    */
/* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE           */
/* POSSIBILITY OF SUCH DAMAGE.                                       */
/* ----------------------------------------------------------------- */

#ifndef OPEN_JTALK_LIB
#define OPEN_JTALK_LIB

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string>
#include <math.h>

/* Main headers */
#include "mecab.h"
#include "njd.h"
#include "jpcommon.h"
#include "HTS_engine.h"

/* Sub headers */
#include "text2mecab.h"
#include "mecab2njd.h"
#include "njd_set_pronunciation.h"
#include "njd_set_digit.h"
#include "njd_set_accent_phrase.h"
#include "njd_set_accent_type.h"
#include "njd_set_unvoiced_vowel.h"
#include "njd_set_long_vowel.h"
#include "njd2jpcommon.h"

//namespace jtalk {

#define MAXBUFLEN 1024

typedef struct _Open_JTalk {
   Mecab mecab;
   NJD njd;
   JPCommon jpcommon;
   HTS_Engine engine;
} Open_JTalk;

 void Open_JTalk_initialize(Open_JTalk * open_jtalk);

 void Open_JTalk_clear(Open_JTalk * open_jtalk);

 int Open_JTalk_load(Open_JTalk * open_jtalk, const char* dn_mecab, const char *fn_voice);

 void Open_JTalk_set_sampling_frequency(Open_JTalk * open_jtalk, size_t i);

 void Open_JTalk_set_fperiod(Open_JTalk * open_jtalk, size_t i);

 void Open_JTalk_set_alpha(Open_JTalk * open_jtalk, double f);

 void Open_JTalk_set_beta(Open_JTalk * open_jtalk, double f);

 void Open_JTalk_set_speed(Open_JTalk * open_jtalk, double f);

 void Open_JTalk_add_half_tone(Open_JTalk * open_jtalk, double f);

 void Open_JTalk_set_msd_threshold(Open_JTalk * open_jtalk, size_t i, double f);

 void Open_JTalk_set_gv_weight(Open_JTalk * open_jtalk, size_t i, double f);

 void Open_JTalk_set_volume(Open_JTalk * open_jtalk, double f);

 void Open_JTalk_set_audio_buff_size(Open_JTalk * open_jtalk, size_t i);

 int Open_JTalk_synthesis(Open_JTalk * open_jtalk, const char *txt, FILE * wavfp,
                                FILE * logfp);

//OPEN_JTALK_LIB_END;
//}
#endif                          /* !OPEN_JTALK_LIB */


text:
package tastytest

import ThisTypes._

object TestThisTypes {

  def test = {
    val a = new Sub3()
    val b = new Sub3()

    var aBase = a.doTest.get
    aBase = b.doTest.get // error
  }

}


text:
using System.Web.Mvc;
using Marketplace.Interview.Business;
using Marketplace.Interview.Business.Basket;
using Marketplace.Interview.Business.Shipping;
using Marketplace.Interview.Web.Views.Home;

namespace Marketplace.Interview.Web.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        private readonly IGetBasketQuery _basketLoader;
        private readonly IAddToBasketCommand _addToBasket;
        private readonly IGetShippingOptionsQuery _getShippingOptions;
        private readonly IRemoveFromBasketCommand _removeFromBasketCommand;

        public HomeController(IGetBasketQuery basketLoader,
            IAddToBasketCommand addToBasket,
            IGetShippingOptionsQuery getShippingOptions,
            IRemoveFromBasketCommand removeFromBasketCommand)
        {
            _basketLoader = basketLoader;
            _addToBasket = addToBasket;
            _getShippingOptions = getShippingOptions;
            _removeFromBasketCommand = removeFromBasketCommand;
        }

        public ActionResult Index()
        {
            var basket = _basketLoader.Invoke(new BasketRequest());
            var shippingOptions = _getShippingOptions.Invoke(new GetShippingOptionsRequest()).ShippingOptions;

            var viewModel = new InterviewViewModel {Basket = basket, ShippingOptions = shippingOptions};

            return View(viewModel);
        }

        public ActionResult RemoveItem(int id)
        {
            _removeFromBasketCommand.Invoke(id);

            return RedirectToAction("Index");
        }

        public ActionResult AddItem(LineItemViewModel lineItemViewModel)
        {
            var shippingOptions = _getShippingOptions.Invoke(new GetShippingOptionsRequest()).ShippingOptions;

            var lineItem = new LineItem()
                               {
                                   Amount = lineItemViewModel.Amount,
                                   ProductId = lineItemViewModel.ProductId,
                                   Shipping = shippingOptions[lineItemViewModel.ShippingOption],
                                   SupplierId = lineItemViewModel.SupplierId,
                                   DeliveryRegion = lineItemViewModel.DeliveryRegion,
                               };

            _addToBasket.Invoke(new AddToBasketRequest() {LineItem = lineItem});

            return RedirectToAction("Index");
        }

        public ActionResult About()
        {
            return View();
        }
    }
}


text:
<?php

namespace App\SystemModule\Presenters;

use \App\SystemModule\Forms\SportTypeForm,
    \App\SystemModule\Forms\SportGroupForm,
    \App\SystemModule\Forms\StaticPageForm,
    \Grido\Grid,
    \App\Model\Misc\Enum\CommentMode,
    \App\Model\Entities\SportGroup,
    \App\Model\Misc\Enum\FormMode,
    \App\Model\Entities\SportType,
    \App\Model\Entities\StaticPage,
    \Nette\ArrayHash,
    \App\SystemModule\Presenters\SystemAdminPresenter,
    \App\Model\Misc\Exceptions,
    \App\Model\Misc\Enum\StaticPageStatus,
    \Nette\Application\UI\Form,
    \App\SecurityModule\Model\Misc\Annotations\Secured;

/**
 * System package AdminPresenter
 * @Secured(resource="SystemAdmin")
 * @author Michal Fučík <michal.fuca.fucik(at)gmail.com>
 */
final class AdminPresenter extends SystemAdminPresenter {

    /**
     * @inject
     * @var \App\SystemModule\Model\Service\ISportTypeService
     */
    public $sportTypeService;

    /**
     * @inject
     * @var \App\SystemModule\Model\Service\ISportGroupService
     */
    public $sportGroupService;

    /**
     * @inject
     * @var \App\UsersModule\Model\Service\IUserService
     */
    public $userService;

    /**
     * @inject
     * @var \App\SystemModule\Model\Service\IStaticPageService
     */
    public $staticPageService;

    /**
     * @var array
     */
    private $selectSportGroups;

    public function getSportGroupService() {
	return $this->sportGroupService;
    }

    public function getSportTypeService() {
	return $this->sportTypeService;
    }

    /**
     * @Secured(resource="default")
     */
    public function actionDefault() {
    }

    // <editor-fold desc="Administration of SPORT TYPES">

    /**
     * @Secured(resource="addSportType")
     */
    public function actionAddSportType() {

    }

    public function createSportType(ArrayHash $values) {
	$type = new SportType();
	$type->fromArray((array) $values);
	try {
	    $this->sportTypeService->createSportType($type);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleException($ex);
	}
	$this->redirect("default");
    }

    /**
     * @Secured(resource="updateSportType")
     */
    public function actionUpdateSportType($id) {
	if (!is_numeric($id)) $this->handleBadArgument ($id);
	try {
	    $dbType = $this->sportTypeService->getSportType($id);
	    if ($dbType !== null) {
		$form = $this->getComponent('updateSportTypeForm');
		$form->setDefaults($dbType->toArray());
		$this->template->title = $dbType->getName();
	    }
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataLoad($id, "default", $ex);
	}
    }

    public function updateSportType(ArrayHash $values) {
	$type = new SportType();
	$type->fromArray((array) $values);
	try {
	    $this->sportTypeService->updateSportType($type);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataSave($values->id, "this", $ex);
	}
	$this->redirect("default");
    }

    /**
     * @Secured(resource="deleteSportType")
     */
    public function handleDeleteSportType($id) {
	if (!is_numeric($id)) $this->handleBadArgument ($id);
	$this->doDeleteSportType($id);
	$this->redirect("this");
    }

    private function doDeleteSportType($id) {
	try {
	    $this->sportTypeService->deleteSportType($id);
	} catch (Exceptions\DependencyException $ex) {
	    $this->handleDependencyDelete($id, "this", $ex);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataDelete($id, "this", $ex);
	}
    }

    public function createComponentSportTypeGrid($name) {

	$grid = new Grid($this, $name);
	$grid->setTranslator($this->getTranslator());
	$grid->setModel($this->getSportTypeService()->getSportTypeDataSource());

	$grid->setPrimaryKey('id');

	$grid->addColumnNumber('id', '#')
		->cellPrototype->class[] = 'center';
	$headerId = $grid->getColumn('id')->headerPrototype;
	$headerId->class[] = 'center';
	$headerId->rowspan = "2";
	$headerId->style['width'] = '0.1%';

	$grid->addColumnText('name', $this->tt("systemModule.admin.grid.name"))
		->setSortable();
	$headerAdded = $grid->getColumn('name')->headerPrototype;
	$headerAdded->class[] = 'center';

	$y = $this->tt("system.common.yes");
	$n = $this->tt("system.common.no");
	$activeList = [true => $y, false => $n];
	$grid->addColumnText('active', $this->tt("systemModule.admin.grid.active"))
		->setSortable()
		->setReplacement([true => $y,
		    null => $n])
		->setFilterSelect($activeList);

	$headerAct = $grid->getColumn('active')->headerPrototype;
	$headerAct->class[] = 'center';
	$headerAct->style['width'] = '0.1%';

	$grid->addColumnText('note', $this->tt("systemModule.admin.grid.note"))
		->setSortable();
	$headerAdded = $grid->getColumn('note')->headerPrototype;
	$headerAdded->class[] = 'center';

	$grid->addActionHref('delete', '', 'deleteSportType!')
		->setIcon('trash')
		->setElementPrototype(\Nette\Utils\Html::el("a")->addAttributes(["title" => $this->tt("systemModule.admin.grid.delete")]))
		->setConfirm(function($u) {
		    return $this->tt("systemModule.admin.grid.messages.rlyDelSport",null,["id"=>$u->getId()]);
		});

	$grid->addActionHref('edit', '', 'updateSportType')
		->setIcon('pencil')
		->setElementPrototype(\Nette\Utils\Html::el("a")->addAttributes(["title" => $this->tt("systemModule.admin.grid.update")]));

	$grid->setOperation(["delete"=>$this->tt("systemModule.admin.grid.delete")], $this->sportsGridOpHandler)
		->setConfirm("delete", $this->tt("systemModule.admin.grid.messages.rlyDelSportItems"));
	$grid->setFilterRenderType($this->filterRenderType);
	$grid->setExport("admin-types " . date("Y-m-d H:i:s", time()));
    }

    public function sportsGridOpHandler($op, $ids) {
	switch($op) {
	    case "delete":
		foreach ($ids as $id) {
		    $this->doDeleteSportType($id);
		}
		break;
	}
	$this->redirect("this");
    }

    public function createComponentAddSportTypeForm($name) {
	$form = $this->prepareSportTypeForm($name);
	//$form->setImages();
	$form->initialize();
	return $form;
    }

    public function createComponentUpdateSportTypeForm($name) {
	$form = $this->prepareSportTypeForm($name);
	//$form->setImages();
	$form->setMode(FormMode::UPDATE_MODE);
	$form->initialize();
	return $form;
    }

    public function prepareSportTypeForm($name) {
	$form = $form = new SportTypeForm($this, $name, $this->getTranslator());
	return $form;
    }

    // </editor-fold>
    // <editor-fold desc="Administration of GROUPS">

    /**
     * @Secured(resource="addSportGroup")
     */
    public function actionAddSportGroup() {

    }

    public function createSportGroup(ArrayHash $values) {
	$type = new SportGroup();
	$type->fromArray((array) $values);
	try {
	    $this->sportGroupService->createSportGroup($type);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataSave($values->id, "this", $ex);
	}
	$this->redirect("default");
    }

    /**
     * @Secured(resource="updateSportGroup")
     */
    public function actionUpdateSportGroup($id) {
	if (!is_numeric($id)) $this->handleBadArgument ($id);
	try {
	    $dbGroup = $this->sportGroupService->getSportGroup($id);
	    if ($dbGroup !== null) {
		$form = $this->getComponent('updateSportGroupForm');
		$dbGroup->setPriority($dbGroup->getPriority()-1);
		$form->setDefaults($dbGroup->toArray());
		$this->template->title = $dbGroup->getName();
	    }
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataLoad($id, "default", $ex);
	}
    }

    public function updateSportGroup(ArrayHash $values) {
	$type = new SportGroup();
	$type->fromArray((array) $values);
	try {
	    $this->sportGroupService->updateSportGroup($type);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataSave($values->id, "this", $ex);
	}
	$this->redirect("default");
    }

    /**
     * @Secured(resource="deleteSportGroup")
     */
    public function handleDeleteSportGroup($id) {
	if (!is_numeric($id)) $this->handleBadArgument ($id);
	$this->doDeleteSportGroup($id);
	$this->redirect("this");
    }

    private function doDeleteSportGroup($id) {
	try {
	    $this->sportGroupService->deleteSportGroup($id);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDependencyDelete($id, "this", $ex);
	}
    }

    protected function getSelectSportGroups() {
	if (!isset($this->selectSportGroups)) {
	    try {
		$this->selectSportGroups = $this->sportGroupService->getSelectAllSportGroups();
	    } catch (Exceptions\DataErrorException $ex) {
		$this->handleDataLoad(null, null, $ex);
	    }
	}
	return $this->selectSportGroups;
    }

    public function createComponentSportGroupGrid($name) {
	try {
	    $sportTypes = [null=>null]+$this->sportTypeService->getSelectSportTypes();
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataLoad(null, ":System:Default:adminRoot", $ex);
	}

	$grid = new Grid($this, $name);

	$grid->setTranslator($this->getTranslator());
	$grid->setModel($this->getSportGroupService()->getSportGroupsDataSource());
	$grid->setPrimaryKey('id');

	$grid->addColumnNumber('id', '#')
		->cellPrototype->class[] = 'center';
	$headerId = $grid->getColumn('id')->headerPrototype;
	$headerId->class[] = 'center';
	$headerId->rowspan = "2";
	$headerId->style['width'] = '0.1%';

	$grid->addColumnText('name', $this->tt("systemModule.admin.grid.name"))
		->setSortable();
	$headerAdded = $grid->getColumn('name')->headerPrototype;
	$headerAdded->class[] = 'center';

	$grid->addColumnText('sportType', $this->tt("systemModule.admin.grid.sport"))
		->setSortable()
		->setFilterSelect($sportTypes);
	$headerType = $grid->getColumn('sportType')->headerPrototype;
	$headerType->class[] = 'center';

	$grid->addColumnText('parent', $this->tt("systemModule.admin.grid.parent"))
		->setSortable()
		->setFilterSelect([null=>null]+$this->getSelectSportGroups());
	$headerParent = $grid->getColumn('parent')->headerPrototype;
	$headerParent->class[] = 'center';

	$y = $this->tt("system.common.yes");
	$n = $this->tt("system.common.no");
	$activeList = [true => $y, false => $n];
	$grid->addColumnText('activity', $this->tt("systemModule.admin.grid.active"))
		->setSortable()
		->setReplacement([true => $y,
		    null => $n])
		->setFilterSelect($activeList);

	$headerAct = $grid->getColumn('activity')->headerPrototype;
	$headerAct->class[] = 'center';
	$headerAct->style['width'] = '0.1%';

	$grid->addColumnText('description', $this->tt("systemModule.admin.grid.note"))
		->setSortable();
	$headerAdded = $grid->getColumn('description')->headerPrototype;
	$headerAdded->class[] = 'center';

	$grid->addActionHref('delete', '', 'deleteSportGroup!')
		->setIcon('trash')
		->setElementPrototype(\Nette\Utils\Html::el("a")->addAttributes(["title" => $this->tt("systemModule.admin.grid.delete")]))
		->setConfirm(function($u) {
		    return $this->tt("systemModule.admin.grid.messages.rlyDelGroup",null,["id"=>$u->getId()]);
		});

	$grid->addActionHref('edit', '', 'updateSportGroup')
		->setIcon('pencil')
		->setElementPrototype(\Nette\Utils\Html::el("a")->addAttributes(["title" => $this->tt("systemModule.admin.grid.update")]));

	$grid->setOperation(["delete"=>$this->tt("systemModule.admin.grid.delete")], $this->sportGroupOpHandler)
		->setConfirm("delete", $this->tt("systemModule.admin.grid.messages.rlyDelGroupItems"));
	$grid->setFilterRenderType($this->filterRenderType);
	$grid->setExport("admin-types " . date("Y-m-d H:i:s", time()));
    }

    public function sportGroupOpHandler($op, $ids) {
	switch($op) {
	    case "delete":
		foreach ($ids as $id) {
		    $this->doDeleteSportGroup($id);
		}
 		break;
	}
	$this->redirect("this");
    }

    public function createComponentAddSportGroupForm($name) {
	$form = $this->prepareSportGroupForm($name);
	$form->initialize();
	return $form;
    }

    public function createComponentUpdateSportGroupForm($name) {
	$form = $this->prepareSportGroupForm($name, $this->getEntityId());
	$form->setMode(FormMode::UPDATE_MODE);
	$form->initialize();
	return $form;
    }

    private function prepareSportGroupForm($name, $selfId = null) {
	$form = new SportGroupForm($this, $name, $this->getTranslator());
	$form->setPriorities($this->sportGroupService->getPriorities());
	try {
	    $sportGroups = $this->sportGroupService->getSelectAllSportGroups($selfId);
	    $form->setSportGroups($sportGroups);
	    $sportTypes = $this->sportTypeService->getSelectSportTypes();
	    $form->setSportTypes($sportTypes);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->flashMessage($ex->getMessage(), self::FM_ERROR);
	}
	return $form;
    }

    //</editor-fold>
    // <editor-fold desc="Administration of STATIC PAGES">

    /**
     * @Secured(resource="createStaticPage")
     */
    public function actionCreateStaticPage() {
	// render form
    }

     public function createStaticPage(ArrayHash $values) {
	$page = new StaticPage((array) $values);
	$page->setEditor($this->getUser()->getIdentity());
	try {
	    $this->staticPageService->createStaticPage($page);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataSave($values->id, "this", $ex);
	}
	$this->redirect("default");
    }

    /**
     * @Secured(resource="updateStaticPage")
     */
    public function actionUpdateStaticPage($id) {
	if (!is_numeric($id))
	    $this->handleBadArgument ($id);
	try {
	    $dbPage = $this->staticPageService->getStaticPage($id);
	    if ($dbPage !== null) {
		$form = $this->getComponent('updateStaticPageForm');
		$form->setDefaults($dbPage->toArray());
		$this->template->page = $dbPage;
	    }
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataLoad($id, "default", $ex);
	}
    }

    public function updateStaticPage(ArrayHash $values) {
	$page = new StaticPage();
	$page->fromArray((array) $values);
	$page->setEditor($this->getUser()->getIdentity());
	try {
	    $this->staticPageService->updateStaticPage($page);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataSave($values->id, "this", $ex);
	}
	$this->redirect("default");
    }

    /**
     * @Secured(resource="deleteStaticPage")
     */
    public function handleDeleteStaticPage($id) {
	if (!is_numeric($id)) $this->handleBadArgument ($id);
	$this->doDeleteStaticPage($id);
	$this->redirect("this");
    }

    private function doDeleteStaticPage($id) {
	try {
	    $this->staticPageService->deleteStaticPage($id);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDependencyDelete($id, "this", $ex);
	}
    }

    public function createComponentStaticPagesGrid($name) {
	try {
//	    $users	= [null=>null] + $this->userService->getSelectUsers();
//	    $pages	= [null=>null] + $this->staticPageService->getSelectStaticPages();
	    $states	= [null=>null] + StaticPageStatus::getOptions();
	    $commModes	= [null=>null] + CommentMode::getOptions();
	} catch (Exceptions\DataErrorException $ex) {
	    $this->handleDataLoad(null, ":System:Default:adminRoot", $ex);
	}

	$grid = new Grid($this, $name);
	$grid->setTranslator($this->getTranslator());
	$grid->setModel($this->staticPageService->getPagesDataSource());
	$grid->setPrimaryKey('id');

	$grid->addColumnNumber('id', '#')
		->cellPrototype->class[] = 'center';
	$headerId = $grid->getColumn('id')->headerPrototype;
	$headerId->class[] = 'center';
	$headerId->rowspan = "2";
	$headerId->style['width'] = '0.1%';

	$grid->addColumnText('title', $this->tt("systemModule.admin.grid.title"))
		->setSortable();
	$headerTt = $grid->getColumn('title')->headerPrototype;
	$headerTt->class[] = 'center';

	$grid->addColumnText('abbr', $this->tt("systemModule.admin.grid.abbr"))
		->setSortable()
		->setFilterText();
	$headerAb = $grid->getColumn('abbr')->headerPrototype;
	$headerAb->class[] = 'center';

//	$grid->addColumnText('parent', $this->tt("systemModule.admin.grid.parent"))
//		->setSortable()
//		->setFilterSelect($pages);
//	$headerParent = $grid->getColumn('parent')->headerPrototype;
//	$headerParent->class[] = 'center';

	$grid->addColumnText('group', $this->tt("systemModule.admin.grid.group"))
		->setSortable()
		->setFilterSelect([null=>null]+$this->getSelectSportGroups());
	$headerParent = $grid->getColumn('group')->headerPrototype;
	$headerParent->class[] = 'center';

	$grid->addColumnText('commentMode', $this->tt("systemModule.admin.grid.commMode"))
		->setSortable()
		->setCustomRender($this->spCommModeRender)
		->setFilterSelect($commModes);
	$headerCm = $grid->getColumn('commentMode')->headerPrototype;
	$headerCm->class[] = 'center';

	$grid->addColumnText('status', $this->tt("systemModule.admin.grid.status"))
		->setSortable()
		->setCustomRender($this->spStatusRender)
		->setFilterSelect($states);
	$headerSt = $grid->getColumn('status')->headerPrototype;
	$headerSt->class[] = 'center';

	$grid->addActionHref('delete', '', 'deleteStaticPage!')
		->setIcon('trash')
		->setElementPrototype(\Nette\Utils\Html::el("a")->addAttributes(["title" => $this->tt("systemModule.admin.grid.delete")]))
		->setConfirm(function($u) {
		    return $this->tt("systemModule.admin.grid.messages.rlyDelPage",null,["id"=>$u->getId()]);
		});

	$grid->addActionHref('edit', '', 'updateStaticPage')
		->setIcon('pencil')
		->setElementPrototype(\Nette\Utils\Html::el("a")->addAttributes(["title" => $this->tt("systemModule.admin.grid.update")]));

	$grid->setOperation(["delete"=>$this->tt("systemModule.admin.grid.delete")], $this->staticPagesOpHandler)
		->setConfirm("delete", $this->tt("systemModule.admin.grid.messages.rlyDelPageItems"));
	$grid->setFilterRenderType($this->filterRenderType);
	$grid->setExport("admin-types " . date("Y-m-d H:i:s", time()));
    }

    public function spStatusRender($e) {
	return $this->tt(StaticPageStatus::getOptions()[$e->getStatus()]);
    }

    public function spCommModeRender($e) {
	return $this->tt(CommentMode::getOptions()[$e->getCommentMode()]);
    }

    public function staticPagesOpHandler($op, $ids) {
	switch($op) {
	    case "delete":
		foreach ($ids as $id) {
		    $this->doDeleteStaticPage($id);
		}
 		break;
	}
	$this->redirect("this");
    }

    public function createComponentAddStaticPageForm($name) {
	$form = $this->prepareStaticPageForm($name);
	$form->initialize();
	return $form;
    }

    public function createComponentUpdateStaticPageForm($name) {
	$form = $this->prepareStaticPageForm($name, $this->getEntityId());
	$form->setMode(FormMode::UPDATE_MODE);
	$form->initialize();
	return $form;
    }

    private function prepareStaticPageForm($name, $selfId = null) {
	$form = new StaticPageForm($this, $name, $this->getTranslator());

	try {
	    $sportGroups = $this->sportGroupService->getSelectAllSportGroups($selfId);
	    $form->setSportGroups($sportGroups);

	    $users = $this->userService->getSelectUsers();
	    $form->setUsers($users);

	    $pages = $this->staticPageService->getSelectStaticPages($selfId);
	    $form->setPages($pages);
	} catch (Exceptions\DataErrorException $ex) {
	    $this->flashMessage($ex->getMessage(), self::FM_ERROR);
	}
	return $form;
    }

    public function staticPageFormSubmitted(StaticPageForm $form) {

	$values = $form->getValues();
	try {
	    switch ($form->getMode()) {
		case FormMode::CREATE_MODE:
		    $this->createStaticPage($values);
		    break;
		case FormMode::UPDATE_MODE:
		    $this->updateStaticPage($values);
		    break;
	    }
	} catch (DuplicateEntryException $ex) {
	    $form->addError(
		    $this
		    ->tt("systemModule.staticPageForm.pageAbbrExists", null, ["name"=>$values->name]));
	}
    }
    //</editor-fold>

    public function createComponentSubMenu($name) {
	$c = new \App\Components\MenuControl($this, $name);
	$c->setLabel("systemModule.navigation.options");
	$c->addNode("systemModule.admin.groupAdd", ":System:Admin:addSportGroup");
	$c->addNode("systemModule.admin.sportAdd", ":System:Admin:addSportType");
	$c->addNode("systemModule.admin.pageAdd", ":System:Admin:addStaticPage");
	$c->addNode("systemModule.navigation.back", ":System:Default:adminRoot");
	return $c;
    }

    public function createComponentBackSubMenu($name) {
	$c = new \App\Components\MenuControl($this, $name);
	$c->setLabel("systemModule.navigation.options");
	$c->addNode("systemModule.navigation.back", ":System:Admin:default");
	return $c;
    }
}


text:
<?php

namespace ZendTest\Application\TestAsset\Resource;

use Zend\Application\Resource\AbstractResource;

/**
 * @category   Zend
 * @package    Zend_Application
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Foo extends AbstractResource
{
    public $someArbitraryKey;

    public function init()
    {
        $this->getBootstrap()->executedFooResource = true;
    }

    public function setSomeArbitraryKey($value)
    {
        $this->someArbitraryKey = $value;
    }
}


text:
class TextLiteral : public Factor {
public:
    // Konstruktor przyjmuje wartosc letterlu napisowego
    // oraz numer linii w ktorej on wystapil
    // Usuwa cudzyslow z napisow.: "kasia" -> kasia
    inline TextLiteral(const std::string& __text, int __lineNumber)
        : Factor(String, __lineNumber)
        , _value(__text.substr(1, __text.size() - 2))
    {
    }

    // Zwraca letterl napisowy
    virtual const Value* execute(RunTimeData& _runTimeData) {
        return &_value; }

    // Analizuje letterl napisowy
    virtual void analise(AnalysisData&)
    {
        // Ta klasa jest lisciem drzewa skladniowego. Metoda 'analise' nie robi nic.
        // Na niej konczy sie przechodzenie drzewa skladniowego 'w glab'.
    }

    // Zwraca type letterlu. Zawsze jest to string
    virtual Type type() const {
        return String; }

protected:
    // Przechowuje letterl napisowy
    StringValue _value;
};

#endif


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

namespace Entropy
{
    public class ComponentType
    {
        private static int _bitID = 1;
        private static Dictionary<Type, ComponentType> _componentTypes;

        public int BitID { get; set; }

        static ComponentType()
        {
            _componentTypes = new Dictionary<Type, ComponentType>();
        }

        public ComponentType()
        {
            BitID = _bitID;
            _bitID <<= 1;
        }

        public static ComponentType GetComponentType(Type clientComponentType)
        {
            if (_componentTypes.ContainsKey(clientComponentType))
            {
                return _componentTypes[clientComponentType];
            }

            ComponentType returnValue = new ComponentType();
            _componentTypes[clientComponentType] = returnValue;
            return returnValue;
        }

        public static int GetComponentTypesMap(IEnumerable<ComponentType> componentTypes)
        {
            int returnValue = 0;

            returnValue = componentTypes.Sum(ct => ct.BitID);

            return returnValue;
        }

    }
}


text:
/* MACHINE GENERATED FILE, DO NOT EDIT */

#include <jni.h>
#include "extgl.h"

typedef GL_APICALL void (GL_APIENTRY *glTexImage3DOESPROC) (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
typedef GL_APICALL void (GL_APIENTRY *glTexSubImage3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels);
typedef GL_APICALL void (GL_APIENTRY *glCopyTexSubImage3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef GL_APICALL void (GL_APIENTRY *glCompressedTexImage3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data);
typedef GL_APICALL void (GL_APIENTRY *glCompressedTexSubImage3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data);
typedef GL_APICALL void (GL_APIENTRY *glFramebufferTexture3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);

static glTexImage3DOESPROC glTexImage3DOES;
static glTexSubImage3DOESPROC glTexSubImage3DOES;
static glCopyTexSubImage3DOESPROC glCopyTexSubImage3DOES;
static glCompressedTexImage3DOESPROC glCompressedTexImage3DOES;
static glCompressedTexSubImage3DOESPROC glCompressedTexSubImage3DOES;
static glFramebufferTexture3DOESPROC glFramebufferTexture3DOES;

static void JNICALL Java_org_lwjgl_opengles_OESTexture3D_nglTexImage3DOES(JNIEnv *env, jclass clazz, jint target, jint level, jint internalFormat, jint width, jint height, jint depth, jint border, jint format, jint type, jlong pixels) {
	const GLvoid *pixels_address = (const GLvoid *)(intptr_t)pixels;
	glTexImage3DOES(target, level, internalFormat, width, height, depth, border, format, type, pixels_address);
}

static void JNICALL Java_org_lwjgl_opengles_OESTexture3D_nglTexSubImage3DOES(JNIEnv *env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jlong pixels) {
	const GLvoid *pixels_address = (const GLvoid *)(intptr_t)pixels;
	glTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels_address);
}

static void JNICALL Java_org_lwjgl_opengles_OESTexture3D_nglCopyTexSubImage3DOES(JNIEnv *env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
	glCopyTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, x, y, width, height);
}

static void JNICALL Java_org_lwjgl_opengles_OESTexture3D_nglCompressedTexImage3DOES(JNIEnv *env, jclass clazz, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jlong data) {
	const GLvoid *data_address = (const GLvoid *)(intptr_t)data;
	glCompressedTexImage3DOES(target, level, internalformat, width, height, depth, border, imageSize, data_address);
}

static void JNICALL Java_org_lwjgl_opengles_OESTexture3D_nglCompressedTexSubImage3DOES(JNIEnv *env, jclass clazz, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jlong data) {
	const GLvoid *data_address = (const GLvoid *)(intptr_t)data;
	glCompressedTexSubImage3DOES(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data_address);
}

static void JNICALL Java_org_lwjgl_opengles_OESTexture3D_nglFramebufferTexture3DOES(JNIEnv *env, jclass clazz, jint target, jint attachment, jint textarget, jint texture, jint level, jint zoffset) {
	glFramebufferTexture3DOES(target, attachment, textarget, texture, level, zoffset);
}

JNIEXPORT void JNICALL Java_org_lwjgl_opengles_OESTexture3D_initNativeStubs(JNIEnv *env, jclass clazz) {
	JavaMethodAndExtFunction functions[] = {
		{"nglTexImage3DOES", "(IIIIIIIIIJ)V", (void *)&Java_org_lwjgl_opengles_OESTexture3D_nglTexImage3DOES, "glTexImage3DOES", (void *)&glTexImage3DOES, false},
		{"nglTexSubImage3DOES", "(IIIIIIIIIIJ)V", (void *)&Java_org_lwjgl_opengles_OESTexture3D_nglTexSubImage3DOES, "glTexSubImage3DOES", (void *)&glTexSubImage3DOES, false},
		{"nglCopyTexSubImage3DOES", "(IIIIIIIII)V", (void *)&Java_org_lwjgl_opengles_OESTexture3D_nglCopyTexSubImage3DOES, "glCopyTexSubImage3DOES", (void *)&glCopyTexSubImage3DOES, false},
		{"nglCompressedTexImage3DOES", "(IIIIIIIIJ)V", (void *)&Java_org_lwjgl_opengles_OESTexture3D_nglCompressedTexImage3DOES, "glCompressedTexImage3DOES", (void *)&glCompressedTexImage3DOES, false},
		{"nglCompressedTexSubImage3DOES", "(IIIIIIIIIIJ)V", (void *)&Java_org_lwjgl_opengles_OESTexture3D_nglCompressedTexSubImage3DOES, "glCompressedTexSubImage3DOES", (void *)&glCompressedTexSubImage3DOES, false},
		{"nglFramebufferTexture3DOES", "(IIIIII)V", (void *)&Java_org_lwjgl_opengles_OESTexture3D_nglFramebufferTexture3DOES, "glFramebufferTexture3DOES", (void *)&glFramebufferTexture3DOES, false}
	};
	int num_functions = NUMFUNCTIONS(functions);
	extgl_InitializeClass(env, clazz, num_functions, functions);
}


text:
/*
 * CompiledVariable.cpp
 *
 *  Created on: Jun 16, 2014
 *      Author: psp
 */

#include "compiled/CompiledVariable.h"

#include "compiled/ITapeVisitor.h"

namespace autodiff
{
	namespace compiled
	{
		void CompiledVariable::accept(shared_ptr<ITapeVisitor> visitor)
		{
			shared_ptr<CompiledVariable> thisCasted = dynamic_pointer_cast<CompiledVariable>(shared_from_this());
			visitor->visit(thisCasted);
		}
	} /* namespace compiled */
} /* namespace autodiff */


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInitfa5a85e4763990e1dcd165420adff683::getLoader();


text:
Documentation on how to use Git LFS are under [Managing large binary files with Git LFS doc](manage_large_binaries_with_git_lfs.md).

## Requirements

- Git LFS is supported in GitLab starting with version 8.2.
- Support for object storage, such as AWS S3, was introduced in 10.0.
- Users need to install [Git LFS client](https://git-lfs.github.com) version 1.0.1 and up.

## Configuration

Git LFS objects can be large in size. By default, they are stored on the server
GitLab is installed on.

There are various configuration options to help GitLab server administrators:

- Enabling/disabling Git LFS support
- Changing the location of LFS object storage
- Setting up object storage supported by [Fog](http://fog.io/about/provider_documentation.html)

### Configuration for Omnibus installations

In `/etc/gitlab/gitlab.rb`:

```ruby
# Change to true to enable lfs - enabled by default if not defined
gitlab_rails['lfs_enabled'] = false

# Optionally, change the storage path location. Defaults to
# `#{gitlab_rails['shared_path']}/lfs-objects`. Which evaluates to
# `/var/opt/gitlab/gitlab-rails/shared/lfs-objects` by default.
gitlab_rails['lfs_storage_path'] = "/mnt/storage/lfs-objects"
```

### Configuration for installations from source

In `config/gitlab.yml`:

```yaml
# Change to true to enable lfs
  lfs:
    enabled: false
    storage_path: /mnt/storage/lfs-objects
```

## Storing LFS objects in remote object storage

> [Introduced][ee-2760] in [GitLab Premium][eep] 10.0. Brought to GitLab Core in 10.7.

It is possible to store LFS objects in remote object storage which allows you
to offload local hard disk R/W operations, and free up disk space significantly.
GitLab is tightly integrated with `Fog`, so you can refer to its [documentation](http://fog.io/about/provider_documentation.html)
to check which storage services can be integrated with GitLab.
You can also use external object storage in a private local network. For example,
[MinIO](https://min.io/) is a standalone object storage service, is easy to set up, and works well with GitLab instances.

GitLab provides two different options for the uploading mechanism: "Direct upload" and "Background upload".

**Option 1. Direct upload**

1. User pushes an lfs file to the GitLab instance
1. GitLab-workhorse uploads the file directly to the external object storage
1. GitLab-workhorse notifies GitLab-rails that the upload process is complete

**Option 2. Background upload**

1. User pushes an lfs file to the GitLab instance
1. GitLab-rails stores the file in the local file storage
1. GitLab-rails then uploads the file to the external object storage asynchronously

The following general settings are supported.

| Setting | Description | Default |
|---------|-------------|---------|
| `enabled` | Enable/disable object storage | `false` |
| `remote_directory` | The bucket name where LFS objects will be stored| |
| `direct_upload` | Set to true to enable direct upload of LFS without the need of local shared storage. Option may be removed once we decide to support only single storage for all files. | `false` |
| `background_upload` | Set to false to disable automatic upload. Option may be removed once upload is direct to S3 | `true` |
| `proxy_download` | Set to true to enable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` |
| `connection` | Various connection options described below | |

The `connection` settings match those provided by [Fog](https://github.com/fog).

Here is a configuration example with S3.

| Setting | Description | example |
|---------|-------------|---------|
| `provider` | The provider name | AWS |
| `aws_access_key_id` | AWS credentials, or compatible | `ABC123DEF456` |
| `aws_secret_access_key` | AWS credentials, or compatible | `ABC123DEF456ABC123DEF456ABC123DEF456` |
| `aws_signature_version` | AWS signature version to use. 2 or 4 are valid options. Digital Ocean Spaces and other providers may need 2. | 4 |
| `enable_signature_v4_streaming` | Set to true to enable HTTP chunked transfers with [AWS v4 signatures](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html). Oracle Cloud S3 needs this to be false | true |
| `region` | AWS region | us-east-1 |
| `host` | S3 compatible host for when not using AWS, e.g. `localhost` or `storage.example.com` | s3.amazonaws.com |
| `endpoint` | Can be used when configuring an S3 compatible service such as [MinIO](https://min.io), by entering a URL such as `http://127.0.0.1:9000` | (optional) |
| `path_style` | Set to true to use `host/bucket_name/object` style paths instead of `bucket_name.host/object`. Leave as false for AWS S3 | false |
| `use_iam_profile` | Set to true to use IAM profile instead of access keys | false

Here is a configuration example with GCS.

| Setting | Description | example |
|---------|-------------|---------|
| `provider` | The provider name | `Google` |
| `google_project` | GCP project name | `gcp-project-12345` |
| `google_client_email` | The email address of the service account | `foo@gcp-project-12345.iam.gserviceaccount.com` |
| `google_json_key_location` | The json key path | `/path/to/gcp-project-12345-abcde.json` |

NOTE: **Note:**
The service account must have permission to access the bucket.
[See more](https://cloud.google.com/storage/docs/authentication)

Here is a configuration example with Rackspace Cloud Files.

| Setting | Description | example |
|---------|-------------|---------|
| `provider` | The provider name | `Rackspace` |
| `rackspace_username` | The username of the Rackspace account with access to the container | `joe.smith` |
| `rackspace_api_key` | The API key of the Rackspace account with access to the container | `ABC123DEF456ABC123DEF456ABC123DE` |
| `rackspace_region` | The Rackspace storage region to use, a three letter code from the [list of service access endpoints](https://developer.rackspace.com/docs/cloud-files/v1/general-api-info/service-access/) | `iad` |
| `rackspace_temp_url_key` | The private key you have set in the Rackspace API for temporary URLs. Read more [here](https://developer.rackspace.com/docs/cloud-files/v1/use-cases/public-access-to-your-cloud-files-account/#tempurl) | `ABC123DEF456ABC123DEF456ABC123DE` |

NOTE: **Note:**
Regardless of whether the container has public access enabled or disabled, Fog will
use the TempURL method to grant access to LFS objects. If you see errors in logs referencing
instantiating storage with a temp-url-key, ensure that you have set they key properly
on the Rackspace API and in `gitlab.rb`. You can verify the value of the key Rackspace
has set by sending a GET request with token header to the service access endpoint URL
and comparing the output of the returned headers.

### Manual uploading to an object storage

There are two ways to manually do the same thing as automatic uploading (described above).

**Option 1: rake task**

```sh
rake gitlab:lfs:migrate
```

**Option 2: rails console**

```sh
$ sudo gitlab-rails console            # Login to rails console

> # Upload LFS files manually
> LfsObject.where(file_store: [nil, 1]).find_each do |lfs_object|
>   lfs_object.file.migrate!(ObjectStorage::Store::REMOTE) if lfs_object.file.file.exists?
> end
```

### S3 for Omnibus installations

On Omnibus installations, the settings are prefixed by `lfs_object_store_`:

1. Edit `/etc/gitlab/gitlab.rb` and add the following lines by replacing with
   the values you want:

   ```ruby
   gitlab_rails['lfs_object_store_enabled'] = true
   gitlab_rails['lfs_object_store_remote_directory'] = "lfs-objects"
   gitlab_rails['lfs_object_store_connection'] = {
     'provider' => 'AWS',
     'region' => 'eu-central-1',
     'aws_access_key_id' => '1ABCD2EFGHI34JKLM567N',
     'aws_secret_access_key' => 'abcdefhijklmnopQRSTUVwxyz0123456789ABCDE',
     # The below options configure an S3 compatible host instead of AWS
     'host' => 'localhost',
     'endpoint' => 'http://127.0.0.1:9000',
     'path_style' => true
   }
   ```

1. Save the file and [reconfigure GitLab]s for the changes to take effect.
1. Migrate any existing local LFS objects to the object storage:

   ```bash
   gitlab-rake gitlab:lfs:migrate
   ```

   This will migrate existing LFS objects to object storage. New LFS objects
   will be forwarded to object storage unless
   `gitlab_rails['lfs_object_store_background_upload']` is set to false.

### S3 for installations from source

For source installations the settings are nested under `lfs:` and then
`object_store:`:

1. Edit `/home/git/gitlab/config/gitlab.yml` and add or amend the following
   lines:

   ```yaml
   lfs:
   enabled: true
   object_store:
     enabled: false
     remote_directory: lfs-objects # Bucket name
     connection:
       provider: AWS
       aws_access_key_id: 1ABCD2EFGHI34JKLM567N
       aws_secret_access_key: abcdefhijklmnopQRSTUVwxyz0123456789ABCDE
       region: eu-central-1
       # Use the following options to configure an AWS compatible host such as Minio
       host: 'localhost'
       endpoint: 'http://127.0.0.1:9000'
       path_style: true
   ```

1. Save the file and [restart GitLab][] for the changes to take effect.
1. Migrate any existing local LFS objects to the object storage:

   ```bash
   sudo -u git -H bundle exec rake gitlab:lfs:migrate RAILS_ENV=production
   ```

   This will migrate existing LFS objects to object storage. New LFS objects
   will be forwarded to object storage unless `background_upload` is set to
   false.

### Migrating back to local storage

In order to migrate back to local storage:

1. Set both `direct_upload` and `background_upload` to false under the LFS object storage settings. Don't forget to restart GitLab.
1. Run `rake gitlab:lfs:migrate_to_local` on your console.
1. Disable `object_storage` for LFS objects in `gitlab.rb`. Remember to restart GitLab afterwards.

## Storage statistics

You can see the total storage used for LFS objects on groups and projects
in the administration area, as well as through the [groups](../../api/groups.md)
and [projects APIs](../../api/projects.md).

## Troubleshooting: `Google::Apis::TransmissionError: execution expired`

If LFS integration is configred with Google Cloud Storage and background uploads (`background_upload: true` and `direct_upload: false`),
Sidekiq workers may encouter this error. This is because the uploading timed out with very large files.
LFS files up to 6Gb can be uploaded without any extra steps, otherwise you need to use the following workaround.

```shell
$ sudo gitlab-rails console            # Login to rails console

> # Set up timeouts. 20 minutes is enough to upload 30GB LFS files.
> # These settings are only in effect for the same session, i.e. they are not effective for sidekiq workers.
> ::Google::Apis::ClientOptions.default.open_timeout_sec = 1200
> ::Google::Apis::ClientOptions.default.read_timeout_sec = 1200
> ::Google::Apis::ClientOptions.default.send_timeout_sec = 1200

> # Upload LFS files manually. This process does not use sidekiq at all.
> LfsObject.where(file_store: [nil, 1]).find_each do |lfs_object|
>   lfs_object.file.migrate!(ObjectStorage::Store::REMOTE) if lfs_object.file.file.exists?
> end
```

See more information in [!19581](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/19581)

## Known limitations

- Support for removing unreferenced LFS objects was added in 8.14 onwards.
- LFS authentications via SSH was added with GitLab 8.12.
- Only compatible with the Git LFS client versions 1.1.0 and up, or 1.0.2.
- The storage statistics currently count each LFS object multiple times for
  every project linking to it.

[reconfigure gitlab]: ../../administration/restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
[restart gitlab]: ../../administration/restart_gitlab.md#installations-from-source "How to restart GitLab"
[eep]: https://about.gitlab.com/pricing/ "GitLab Premium"
[ee-2760]: https://gitlab.com/gitlab-org/gitlab/merge_requests/2760


text:
package com.google.android.apps.iosched.gcm.server;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet that registers a device, whose registration id is identified by {@link
 * #PARAMETER_REG_ID}.
 *
 * The client app should call this servlet every time it receives a {@code
 * com.google.android.c2dm.intent.REGISTRATION C2DM} intent without an error or {@code unregistered}
 * extra.
 */
@SuppressWarnings("serial")
public class RegisterServlet extends BaseServlet {

    private static final String PARAMETER_REG_ID = "regId";

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException {
        String regId = getParameter(req, PARAMETER_REG_ID);
        Datastore.register(regId);
        setSuccess(resp);
    }
}


text:
    {{pageHeader}} View the contents of the cache store

{{#cacheEnabled}}

    Clear cache

  Active implementation:
  {{implementation}}

      Get count
      Hit count
      Miss count
      Put count

      {{getCount}}
      {{hitCount}}
      {{missCount}}
      {{putCount}}

        Request
        Assets

      {{#cacheElements}}

        {{requestUri}}

        {{#assets}}

{{name}} ({{type}})

        {{/assets}}

      {{/cacheElements}}
      {{^cacheElements}}

        Empty

      {{/cacheElements}}

{{/cacheEnabled}} {{^cacheEnabled}}

Caching is disabled

{{/cacheEnabled}}


text:
<?php

namespace Koka\Flash;

use Iterator;
use PHPixie\HTTP\Context\Container as HttpContextContainer;

/**
 * Class Container
 * @package Koka\Flash
 */
class Container implements Iterator
{
    /**
     * @var array
     */
    protected $MessagesCopy = [];

    /**
     * @var HttpContextContainer
     */
    protected $httpContextContainer;

    /**
     * @param HttpContextContainer $httpContextContainer
     */
    public function __construct(HttpContextContainer $httpContextContainer)
    {
        $this->httpContextContainer = $httpContextContainer;
    }

    /**
     * @return Message
     */
    public function current()
    {
        return current($this->MessagesCopy);
    }

    /**
     * @return Message
     */
    public function next()
    {
        return next($this->MessagesCopy);
    }

    /**
     * @return boolean
     */
    public function valid()
    {
        if ($this->key() !== null) {
            return true;
        } else {
            $this->MessagesCopy = [];
            return false;
        }
    }

    /**
     * @return int
     */
    public function key()
    {
        return key($this->MessagesCopy);
    }

    /**
     * @return Message
     */
    public function rewind()
    {
        $messages = $this->get();
        $allMessages = [];
        if (!empty($messages)) {
            foreach ($messages as $type => $array) {
                foreach ($messages[$type] as $key => $message) {
                    $allMessages[] = $message;
                    unset($messages[$type][$key]);
                }
            }

            $this->set($messages);
        }
        $this->MessagesCopy = $allMessages;
        return reset($this->MessagesCopy);
    }

    /**
     * @return array
     */
    protected function get()
    {
        $messages = $this->session()->get('messages');
        return is_array($messages) ? $messages : [];
    }

    /**
     * @return \PHPixie\HTTP\Context\Session
     */
    protected function session()
    {
        return $this->httpContextContainer->httpContext()->session();
    }

    /**
     * @param array $messages
     */
    protected function set(array $messages)
    {
        $this->session()
            ->set('messages', array_filter($messages, function ($val) {
                return count($val) ? true : false;
            }));
    }
}


text:
package ru.spbstu.icc.kspt.kuznetsov.fpf4mir.core.facts.activity;

public interface ActivityAnalitycsInfo extends ActivityRelatedFact{

}


text:
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using achihapi.ViewModels;
using System.Data;
using System.Data.SqlClient;
using Microsoft.AspNetCore.Authorization;
using achihapi.Utilities;
using System.Net;
using Microsoft.Extensions.Caching.Memory;
using System.Collections.Generic;

namespace achihapi.Controllers
{
    [Produces("application/json")]
    [Route("api/[controller]")]
    public class LearnCategoryController : Controller
    {
        private IMemoryCache _cache;
        public LearnCategoryController(IMemoryCache cache)
        {
            _cache = cache;
        }

        // GET: api/learncategory
        [HttpGet]
        [Authorize]
        public async Task<IActionResult> Get([FromQuery]Int32 hid = 0, Int32 top = 100, Int32 skip = 0)
        {
            String usrName = String.Empty;
            if (Startup.UnitTestMode)
                usrName = UnitTestUtility.UnitTestUser;
            else
            {
                var usrObj = HIHAPIUtility.GetUserClaim(this);
                usrName = usrObj.Value;
            }
            if (String.IsNullOrEmpty(usrName))
                return BadRequest("User cannot recognize");

            List<LearnCategoryViewModel> listVm = null;
            SqlConnection conn = null;
            SqlCommand cmd = null;
            SqlDataReader reader = null;
            String queryString = "";
            String strErrMsg = "";
            HttpStatusCode errorCode = HttpStatusCode.OK;

            try
            {
                var cacheKey = String.Format(CacheKeys.LearnCtgyList, hid);
                if (_cache.TryGetValue<List<LearnCategoryViewModel>>(cacheKey, out listVm))
                {
                    // Do nothing
                }
                else
                {
                    listVm = new List<LearnCategoryViewModel>();

                    queryString = HIHDBUtility.getLearnCategoryQueryString() + " WHERE [HID] IS NULL OR [HID] = " + hid.ToString();

                    using (conn = new SqlConnection(Startup.DBConnectionString))
                    {
                        await conn.OpenAsync();

                        // Check Home assignment with current user
                        if (hid > 0)
                        {
                            try
                            {
                                HIHAPIUtility.CheckHIDAssignment(conn, hid, usrName);
                            }
                            catch (Exception)
                            {
                                errorCode = HttpStatusCode.BadRequest;
                                throw;
                            }
                        }

                        cmd = new SqlCommand(queryString, conn);
                        reader = cmd.ExecuteReader();

                        if (reader.HasRows)
                        {
                            while (reader.Read())
                            {
                                LearnCategoryViewModel vm = new LearnCategoryViewModel();
                                HIHDBUtility.LearnCategory_DB2VM(reader, vm);
                                listVm.Add(vm);
                            }
                        }
                    }

                    _cache.Set<List<LearnCategoryViewModel>>(cacheKey, listVm, TimeSpan.FromMinutes(20));
                }
            }
            catch (Exception exp)
            {
                System.Diagnostics.Debug.WriteLine(exp.Message);
                strErrMsg = exp.Message;
                if (errorCode == HttpStatusCode.OK)
                    errorCode = HttpStatusCode.InternalServerError;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Dispose();
                    reader = null;
                }
                if (cmd != null)
                {
                    cmd.Dispose();
                    cmd = null;
                }
                if (conn != null)
                {
                    conn.Dispose();
                    conn = null;
                }
            }

            if (errorCode != HttpStatusCode.OK)
            {
                switch (errorCode)
                {
                    case HttpStatusCode.Unauthorized:
                        return Unauthorized();
                    case HttpStatusCode.NotFound:
                        return NotFound();
                    case HttpStatusCode.BadRequest:
                        return BadRequest(strErrMsg);
                    default:
                        return StatusCode(500, strErrMsg);
                }
            }

            var setting = new Newtonsoft.Json.JsonSerializerSettings
            {
                DateFormatString = HIHAPIConstants.DateFormatPattern,
                ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
            };

            return new JsonResult(listVm, setting);
        }

        // GET api/learncategory/5
        [HttpGet("{id}")]
        public IActionResult Get([FromRoute]int id)
        {
            return BadRequest();
        }

        // POST api/learncategory
        [HttpPost]
        [Authorize]
        public async Task<IActionResult> Post([FromBody]LearnCategoryViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            String usrName = String.Empty;
            if (Startup.UnitTestMode)
                usrName = UnitTestUtility.UnitTestUser;
            else
            {
                var usrObj = HIHAPIUtility.GetUserClaim(this);
                usrName = usrObj.Value;
            }
            if (String.IsNullOrEmpty(usrName))
                return BadRequest("User cannot recognize");

            if (vm.Name != null)
                vm.Name = vm.Name.Trim();
            if (String.IsNullOrEmpty(vm.Name))
            {
                return BadRequest("Name is a must!");
            }

            // Update the database
            SqlConnection conn = null;
            SqlCommand cmd = null;
            SqlDataReader reader = null;
            String queryString = "";
            Int32 nNewID = -1;
            String strErrMsg = "";
            HttpStatusCode errorCode = HttpStatusCode.OK;

            try
            {
                queryString = @"SELECT [ID]
                            FROM [dbo].[t_learn_ctgy] WHERE [Name] = N'" + vm.Name + "'";

                using (conn = new SqlConnection(Startup.DBConnectionString))
                {
                    await conn.OpenAsync();

                    // Check Home assignment with current user
                    if (vm.HID.HasValue && vm.HID.Value > 0)
                    {
                        try
                        {
                            HIHAPIUtility.CheckHIDAssignment(conn, vm.HID.Value, usrName);
                        }
                        catch (Exception)
                        {
                            errorCode = HttpStatusCode.BadRequest;
                            throw;
                        }
                    }

                    cmd = new SqlCommand(queryString, conn);
                    reader = cmd.ExecuteReader();
                    if (reader.HasRows)
                    {
                        Int32 nDuplicatedID = -1;
                        while (reader.Read())
                        {
                            nDuplicatedID = reader.GetInt32(0);
                            break;
                        }

                        errorCode = HttpStatusCode.BadRequest;
                        throw new Exception("Object with name already exists: " + nDuplicatedID.ToString());
                    }
                    else
                    {
                        reader.Dispose();
                        reader = null;

                        cmd.Dispose();
                        cmd = null;

                        // Now go ahead for the creating
                        queryString = HIHDBUtility.getLearnCategoryInsertString();

                        cmd = new SqlCommand(queryString, conn);
                        HIHDBUtility.bindLearnCategoryInsertParameter(cmd, vm, usrName);
                        SqlParameter idparam = cmd.Parameters.AddWithValue("@Identity", SqlDbType.Int);
                        idparam.Direction = ParameterDirection.Output;

                        Int32 nRst = await cmd.ExecuteNonQueryAsync();
                        nNewID = (Int32)idparam.Value;
                    }
                }
            }
            catch (Exception exp)
            {
                System.Diagnostics.Debug.WriteLine(exp.Message);
                strErrMsg = exp.Message;
                if (errorCode == HttpStatusCode.OK)
                    errorCode = HttpStatusCode.InternalServerError;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Dispose();
                    reader = null;
                }
                if (cmd != null)
                {
                    cmd.Dispose();
                    cmd = null;
                }
                if (conn != null)
                {
                    conn.Dispose();
                    conn = null;
                }
            }

            if (errorCode != HttpStatusCode.OK)
            {
                switch (errorCode)
                {
                    case HttpStatusCode.Unauthorized:
                        return Unauthorized();
                    case HttpStatusCode.NotFound:
                        return NotFound();
                    case HttpStatusCode.BadRequest:
                        return BadRequest(strErrMsg);
                    default:
                        return StatusCode(500, strErrMsg);
                }
            }

            vm.ID = nNewID;
            var setting = new Newtonsoft.Json.JsonSerializerSettings
            {
                DateFormatString = HIHAPIConstants.DateFormatPattern,
                ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
            };

            return new JsonResult(vm, setting);
        }

        // PUT api/learncategory/5
        [HttpPut("{id}")]
        [Authorize]
        public IActionResult Put([FromRoute]int id, [FromBody]string value)
        {
            return BadRequest();
        }

        // DELETE api/learncategory/5
        [HttpDelete("{id}")]
        [Authorize]
        public IActionResult Delete([FromRoute]int id)
        {
            return BadRequest();
        }

        #region Implementation methods
        private string getQueryString(Boolean bListMode, Int32? nTop, Int32? nSkip, Int32? nSearchID, Int32? hid)
        {

            String strSQL = "";
            if (bListMode)
            {
                strSQL += @"SELECT count(*) FROM [dbo].[t_learn_ctgy] WHERE [HID] IS NULL ";
                if (hid.HasValue && hid.Value != 0)
                    strSQL += " OR [HID] = " + hid.Value.ToString() + ";";
            }

            strSQL += HIHDBUtility.getLearnCategoryQueryString();

            if (bListMode && nTop.HasValue && nSkip.HasValue)
            {
                strSQL += " WHERE [HID] IS NULL ";
                if (hid.HasValue && hid.Value != 0)
                    strSQL += " OR [HID] = " + hid.Value.ToString();
                strSQL += @" ORDER BY (SELECT NULL)
                        OFFSET " + nSkip.Value.ToString() + " ROWS FETCH NEXT " + nTop.Value.ToString() + " ROWS ONLY;";
            }
            else if (!bListMode && nSearchID.HasValue)
            {
                strSQL += @" AND [t_learn_ctgy].[ID] = " + nSearchID.Value.ToString();
            }
#if DEBUG
            System.Diagnostics.Debug.WriteLine("LearnCategoryController, SQL generated: " + strSQL);
#endif

            return strSQL;
        }
        #endregion
    }
}


text:
import expect from 'expect';

import getAlbumImages from '../get-album-images';
import watchGetAlbumImages from '../watch-get-album-images';

describe('saga watchGetAlbumImages', () => {
  it('should watch action SELECT_ALBUM', () => {
    const gen = watchGetAlbumImages();
    const next = gen.next();

    expect(next.value.TAKE.pattern).toEqual('SELECT_ALBUM');
  });

  it('should call function getAlbumImages', () => {
    const gen = watchGetAlbumImages();
    gen.next();
    const next = gen.next();

    expect(next.value.FORK.fn).toEqual(getAlbumImages);
  });
});


text:
package slack

import (
	"slackbot_atlassian/config"

	"github.com/nlopes/slack"
)

type Slack interface {
	PostMessage(channel string, as_user config.SlackUser, message string) error
}

type impl struct {
	cfg    config.SlackConfig
	client *slack.Client
}

func New(cfg config.SlackConfig) Slack {
	return impl{cfg, slack.New(cfg.Auth.Token)}
}

func (s impl) PostMessage(channel string, user config.SlackUser, message string) error {
	params := slack.PostMessageParameters{
		Username:  user.Name,
		IconURL:   user.IconUrl,
		IconEmoji: user.IconEmoji,
	}

	_, _, err := s.client.PostMessage(channel, message, params)

	return err
}


text:
package main

import (
	"fmt"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/urfave/cli/v2"
	"strings"
)

func GetInfo(config *Config, c *cli.Context) error {
	args := c.Args().Slice()

	// If we're not passed any args, we're going to do all S3 buckets
	if len(args) == 0 {
		return fmt.Errorf("Not enough parameters for command 'info'")
	}

	// Get the usage for the buckets
	for _, arg := range args {
		// Only do usage on S3 buckets
		u, err := FileURINew(arg)
		if err != nil || u.Scheme != "s3" {
			continue
		}

		bsvc, err := SessionForBucket(config, u.Bucket)
		if err != nil {
			return err
		}

		if u.Path == "" || u.Path == "/" {
			bucket := aws.String(u.Bucket)

			fmt.Printf("%s (bucket):\n", u.String())

			if info, err := bsvc.GetBucketLocation(&s3.GetBucketLocationInput{Bucket: bucket}); err == nil {
				if info.LocationConstraint != nil {
					fmt.Printf("   Location: %s\n", *info.LocationConstraint)
				} else {
					fmt.Printf("   Location: %s\n", "none")
				}
			}
			if info, err := bsvc.GetBucketRequestPayment(&s3.GetBucketRequestPaymentInput{Bucket: bucket}); err == nil {
				if info.Payer != nil {
					fmt.Printf("   Payer: %s\n", *info.Payer)
				} else {
					fmt.Printf("   Payer: %s\n", "none")
				}
			}
		} else {
			params := &s3.HeadObjectInput{
				Bucket: aws.String(u.Bucket),
				Key:    u.Key(),
			}
			info, err := bsvc.HeadObject(params)
			if err != nil {
				fmt.Printf("Error fetching info for %s\n", u.String())
				continue
			}

			fmt.Printf("%s (object):\n", u.String())
			fmt.Printf("   File size: %d\n", *info.ContentLength)
			fmt.Printf("   Last mod: %s\n", info.LastModified.Format(DATE_FMT))
			fmt.Printf("   MIME type: %s\n", *info.ContentType)
			fmt.Printf("   MD5 sum: %s\n", strings.Trim(*info.ETag, "\""))
			if info.ServerSideEncryption != nil {
				fmt.Printf("   SSE: %s\n", *info.ServerSideEncryption)
			} else {
				fmt.Printf("   SSE: %s\n", "none")
			}

			// fmt.Printf("   policy: %d\n", *info.ContentLength)
			// fmt.Printf("   cors: %d\n", *info.ContentLength)
			// fmt.Printf("   ACL: %d\n", *info.)

			for k, v := range info.Metadata {
				fmt.Printf("   x-az-meta-%s: %s\n", k, *v)
			}
		}
	}

	return nil
}


text:
package org.apache.flink.api.scala.typeutils

import org.apache.flink.annotation.Internal
import org.apache.flink.api.common.typeutils.TypeSerializer
import org.apache.flink.api.java.typeutils.runtime.TupleSerializerBase
import org.apache.flink.core.memory.{DataInputView, DataOutputView}
import org.apache.flink.types.NullFieldException

/**
 * Serializer for Case Classes. Creation and access is different from
 * our Java Tuples so we have to treat them differently.
 */
@Internal
@SerialVersionUID(7341356073446263475L)
abstract class CaseClassSerializer[T <: Product](
    clazz: Class[T],
    scalaFieldSerializers: Array[TypeSerializer[_]])
  extends TupleSerializerBase[T](clazz, scalaFieldSerializers)
  with Cloneable {

  @transient var fields : Array[AnyRef] = _

  @transient var instanceCreationFailed : Boolean = false

  override def duplicate = {
    clone().asInstanceOf[CaseClassSerializer[T]]
  }

  @throws[CloneNotSupportedException]
  override protected def clone(): Object = {
    val result = super.clone().asInstanceOf[CaseClassSerializer[T]]

    // achieve a deep copy by duplicating the field serializers
    result.fieldSerializers = result.fieldSerializers.map(_.duplicate())
    result.fields = null
    result.instanceCreationFailed = false

    result
  }

  def createInstance: T = {
    if (instanceCreationFailed) {
      null.asInstanceOf[T]
    }
    else {
      initArray()
      try {
        var i = 0
        while (i < arity) {
          fields(i) = fieldSerializers(i).createInstance()
          i += 1
        }
        createInstance(fields)
      }
      catch {
        case t: Throwable =>
          instanceCreationFailed = true
          null.asInstanceOf[T]
      }
    }
  }

  override def createOrReuseInstance(fields: Array[Object], reuse: T) : T = {
    createInstance(fields)
  }

  def copy(from: T, reuse: T): T = {
    copy(from)
  }

  def copy(from: T): T = {
    initArray()
    var i = 0
    while (i < arity) {
      fields(i) = fieldSerializers(i).copy(from.productElement(i).asInstanceOf[AnyRef])
      i += 1
    }
    createInstance(fields)
  }

  def serialize(value: T, target: DataOutputView) {
    var i = 0
    while (i < arity) {
      val serializer = fieldSerializers(i).asInstanceOf[TypeSerializer[Any]]
      val o = value.productElement(i)
      try
        serializer.serialize(o, target)
      catch {
        case e: NullPointerException =>
          throw new NullFieldException(i, e)
      }
      i += 1
    }
  }

  def deserialize(reuse: T, source: DataInputView): T = {
    deserialize(source)
  }

  def deserialize(source: DataInputView): T = {
    initArray()
    var i = 0
    while (i < arity) {
      fields(i) = fieldSerializers(i).deserialize(source)
      i += 1
    }
    createInstance(fields)
  }

  def initArray() = {
    if (fields == null) {
      fields = new Array[AnyRef](arity)
    }
  }
}