text:
package org.springframework.cloud.stream.binder.kafka.streams;

import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Collectors;

import io.micrometer.core.instrument.MeterRegistry;
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.errors.LogAndContinueExceptionHandler;
import org.apache.kafka.streams.errors.LogAndFailExceptionHandler;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.context.properties.bind.BindResult;
import org.springframework.boot.context.properties.bind.Bindable;
import org.springframework.boot.context.properties.bind.Binder;
import org.springframework.boot.context.properties.bind.PropertySourcesPlaceholdersResolver;
import org.springframework.boot.context.properties.source.ConfigurationPropertySources;
import org.springframework.cloud.stream.binder.BinderConfiguration;
import org.springframework.cloud.stream.binder.kafka.streams.function.FunctionDetectorCondition;
import org.springframework.cloud.stream.binder.kafka.streams.properties.KafkaStreamsBinderConfigurationProperties;
import org.springframework.cloud.stream.binder.kafka.streams.properties.KafkaStreamsExtendedBindingProperties;
import org.springframework.cloud.stream.binding.BindingService;
import org.springframework.cloud.stream.config.BinderProperties;
import org.springframework.cloud.stream.config.BindingServiceConfiguration;
import org.springframework.cloud.stream.config.BindingServiceProperties;
import org.springframework.cloud.stream.function.StreamFunctionProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MapPropertySource;
import org.springframework.integration.context.IntegrationContextUtils;
import org.springframework.integration.support.utils.IntegrationUtils;
import org.springframework.kafka.config.KafkaStreamsConfiguration;
import org.springframework.kafka.config.StreamsBuilderFactoryBeanConfigurer;
import org.springframework.kafka.core.CleanupConfig;
import org.springframework.kafka.streams.KafkaStreamsMicrometerListener;
import org.springframework.kafka.streams.RecoveringDeserializationExceptionHandler;
import org.springframework.lang.Nullable;
import org.springframework.messaging.converter.CompositeMessageConverter;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;

/**
 * Kafka Streams binder configuration.
 *
 * @author Marius Bogoevici
 * @author Soby Chacko
 * @author Gary Russell
 */
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({ KafkaProperties.class, KafkaStreamsExtendedBindingProperties.class })
@ConditionalOnBean(BindingService.class)
@AutoConfigureAfter(BindingServiceConfiguration.class)
public class KafkaStreamsBinderSupportAutoConfiguration {

	private static final String KSTREAM_BINDER_TYPE = "kstream";

	private static final String KTABLE_BINDER_TYPE = "ktable";

	private static final String GLOBALKTABLE_BINDER_TYPE = "globalktable";

	private static final String CONSUMER_PROPERTIES_PREFIX = "consumer.";
	private static final String PRODUCER_PROPERTIES_PREFIX = "producer.";

	@Bean
	@ConfigurationProperties(prefix = "spring.cloud.stream.kafka.streams.binder")
	public KafkaStreamsBinderConfigurationProperties binderConfigurationProperties(
			KafkaProperties kafkaProperties, ConfigurableEnvironment environment,
			BindingServiceProperties properties, ConfigurableApplicationContext context) throws Exception {
		final Map<String, BinderConfiguration> binderConfigurations = getBinderConfigurations(
				properties);
		for (Map.Entry<String, BinderConfiguration> entry : binderConfigurations
				.entrySet()) {
			final BinderConfiguration binderConfiguration = entry.getValue();
			final String binderType = binderConfiguration.getBinderType();
			if (binderType != null && (binderType.equals(KSTREAM_BINDER_TYPE)
					|| binderType.equals(KTABLE_BINDER_TYPE)
					|| binderType.equals(GLOBALKTABLE_BINDER_TYPE))) {
				Map<String, Object> binderProperties = new HashMap<>();
				this.flatten(null, binderConfiguration.getProperties(), binderProperties);
				environment.getPropertySources().addFirst(
						new MapPropertySource(entry.getKey() + "-kafkaStreamsBinderEnv", binderProperties));

				Binder binder = new Binder(ConfigurationPropertySources.get(environment),
						new PropertySourcesPlaceholdersResolver(environment),
						IntegrationUtils.getConversionService(context.getBeanFactory()), null);
				final Constructor<KafkaStreamsBinderConfigurationProperties> kafkaStreamsBinderConfigurationPropertiesConstructor =
						ReflectionUtils.accessibleConstructor(KafkaStreamsBinderConfigurationProperties.class, KafkaProperties.class);
				final KafkaStreamsBinderConfigurationProperties kafkaStreamsBinderConfigurationProperties =
						BeanUtils.instantiateClass(kafkaStreamsBinderConfigurationPropertiesConstructor, kafkaProperties);
				final BindResult<KafkaStreamsBinderConfigurationProperties> bind = binder.bind("spring.cloud.stream.kafka.streams.binder", Bindable.ofInstance(kafkaStreamsBinderConfigurationProperties));
				context.getBeanFactory().registerSingleton(
						entry.getKey() + "-KafkaStreamsBinderConfigurationProperties",
						bind.get());
			}
		}
		return new KafkaStreamsBinderConfigurationProperties(kafkaProperties);
	}

	// TODO: Lifted from core - good candidate for exposing as a utility method in core.
	private static Map<String, BinderConfiguration> getBinderConfigurations(
			BindingServiceProperties properties) {

		Map<String, BinderConfiguration> binderConfigurations = new HashMap<>();
		Map<String, BinderProperties> declaredBinders = properties.getBinders();

		for (Map.Entry<String, BinderProperties> binderEntry : declaredBinders
				.entrySet()) {
			BinderProperties binderProperties = binderEntry.getValue();
			binderConfigurations.put(binderEntry.getKey(),
					new BinderConfiguration(binderProperties.getType(),
							binderProperties.getEnvironment(),
							binderProperties.isInheritEnvironment(),
							binderProperties.isDefaultCandidate()));
		}
		return binderConfigurations;
	}

	// TODO: Lifted from core - good candidate for exposing as a utility method in core.
	@SuppressWarnings("unchecked")
	private void flatten(String propertyName, Object value,
			Map<String, Object> flattenedProperties) {
		if (value instanceof Map) {
			((Map<Object, Object>) value).forEach((k, v) -> flatten(
					(propertyName != null ? propertyName + "." : "") + k, v,
					flattenedProperties));
		}
		else {
			flattenedProperties.put(propertyName, value.toString());
		}
	}

	@Bean
	public KafkaStreamsConfiguration kafkaStreamsConfiguration(
			@Qualifier("binderConfigurationProperties") KafkaStreamsBinderConfigurationProperties properties,
			Environment environment) {
		KafkaProperties kafkaProperties = properties.getKafkaProperties();
		Map<String, Object> streamsProperties = kafkaProperties.buildStreamsProperties();
		if (kafkaProperties.getStreams().getApplicationId() == null) {
			String applicationName = environment.getProperty("spring.application.name");
			if (applicationName != null) {
				streamsProperties.put(StreamsConfig.APPLICATION_ID_CONFIG,
						applicationName);
			}
		}
		return new KafkaStreamsConfiguration(streamsProperties);
	}

	@Bean("streamConfigGlobalProperties")
	public Map<String, Object> streamConfigGlobalProperties(
			@Qualifier("binderConfigurationProperties") KafkaStreamsBinderConfigurationProperties configProperties,
			KafkaStreamsConfiguration kafkaStreamsConfiguration, ConfigurableEnvironment environment,
			SendToDlqAndContinue sendToDlqAndContinue) {

		Properties properties = kafkaStreamsConfiguration.asProperties();

		String kafkaConnectionString = configProperties.getKafkaConnectionString();

		if (kafkaConnectionString != null && kafkaConnectionString.equals("localhost:9092")) {
			//Making sure that the application indeed set a property.
			String kafkaStreamsBinderBroker = environment.getProperty("spring.cloud.stream.kafka.streams.binder.brokers");

			if (StringUtils.isEmpty(kafkaStreamsBinderBroker)) {
				//Kafka Streams binder specific property for brokers is not set by the application.
				//See if there is one configured at the kafka binder level.
				String kafkaBinderBroker = environment.getProperty("spring.cloud.stream.kafka.binder.brokers");
				if (!StringUtils.isEmpty(kafkaBinderBroker)) {
					kafkaConnectionString = kafkaBinderBroker;
					configProperties.setBrokers(kafkaConnectionString);
				}
			}
		}

		if (ObjectUtils.isEmpty(properties.get(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG))) {
			properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG,
					kafkaConnectionString);
		}
		else {
			Object bootstrapServerConfig = properties
					.get(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG);
			if (bootstrapServerConfig instanceof String) {
				@SuppressWarnings("unchecked")
				String bootStrapServers = (String) properties
						.get(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG);
				if (bootStrapServers.equals("localhost:9092")) {
					properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG,
							kafkaConnectionString);
				}
			}
			else if (bootstrapServerConfig instanceof List bootStrapCollection) {
				if (bootStrapCollection.size() == 1 && bootStrapCollection.get(0).equals("localhost:9092")) {
					properties.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG,
							kafkaConnectionString);
				}
			}
		}

		String binderProvidedApplicationId = configProperties.getApplicationId();
		if (StringUtils.hasText(binderProvidedApplicationId)) {
			properties.put(StreamsConfig.APPLICATION_ID_CONFIG,
					binderProvidedApplicationId);
		}

		properties.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG,
				Serdes.ByteArraySerde.class.getName());
		properties.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG,
				Serdes.ByteArraySerde.class.getName());

		if (configProperties
				.getDeserializationExceptionHandler() == DeserializationExceptionHandler.logAndContinue) {
			properties.put(
					StreamsConfig.DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG,
					LogAndContinueExceptionHandler.class);
		}
		else if (configProperties
				.getDeserializationExceptionHandler() == DeserializationExceptionHandler.logAndFail) {
			properties.put(
					StreamsConfig.DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG,
					LogAndFailExceptionHandler.class);
		}
		else if (configProperties
				.getDeserializationExceptionHandler() == DeserializationExceptionHandler.sendToDlq) {
			properties.put(
					StreamsConfig.DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG,
					RecoveringDeserializationExceptionHandler.class);
			properties.put(RecoveringDeserializationExceptionHandler.KSTREAM_DESERIALIZATION_RECOVERER, sendToDlqAndContinue);
		}

		if (!ObjectUtils.isEmpty(configProperties.getConfiguration())) {
			properties.putAll(configProperties.getConfiguration());
		}

		Map<String, Object> mergedConsumerConfig = new HashMap<>(configProperties.mergedConsumerConfiguration());
		//Adding consumer. prefix if they are missing (in order to differentiate them from other property categories such as stream, producer etc.)
		addPrefix(properties, mergedConsumerConfig, CONSUMER_PROPERTIES_PREFIX);

		Map<String, Object> mergedProducerConfig = new HashMap<>(configProperties.mergedProducerConfiguration());
		//Adding producer. prefix if they are missing (in order to differentiate them from other property categories such as stream, consumer etc.)
		addPrefix(properties, mergedProducerConfig, PRODUCER_PROPERTIES_PREFIX);

		if (!properties.containsKey(StreamsConfig.REPLICATION_FACTOR_CONFIG)) {
			properties.put(StreamsConfig.REPLICATION_FACTOR_CONFIG,
					(int) configProperties.getReplicationFactor());
		}
		return properties.entrySet().stream().collect(
				Collectors.toMap((e) -> String.valueOf(e.getKey()), Map.Entry::getValue));
	}

	private void addPrefix(Properties properties, Map<String, Object> mergedConsProdConfig, String prefix) {
		Map<String, Object> mergedConfigs = new HashMap<>();
		for (String key : mergedConsProdConfig.keySet()) {
			mergedConfigs.put(key.startsWith(prefix) ? key : prefix + key, mergedConsProdConfig.get(key));
		}
		if (!ObjectUtils.isEmpty(mergedConfigs)) {
			properties.putAll(mergedConfigs);
		}
	}

	@Bean
	public KafkaStreamsMessageConversionDelegate messageConversionDelegate(
			@Qualifier(IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME)
					CompositeMessageConverter compositeMessageConverter,
			SendToDlqAndContinue sendToDlqAndContinue,
			KafkaStreamsBindingInformationCatalogue KafkaStreamsBindingInformationCatalogue,
			@Qualifier("binderConfigurationProperties") KafkaStreamsBinderConfigurationProperties binderConfigurationProperties) {
		return new KafkaStreamsMessageConversionDelegate(compositeMessageConverter, sendToDlqAndContinue,
				KafkaStreamsBindingInformationCatalogue, binderConfigurationProperties);
	}

	@Bean
	public KStreamBoundElementFactory kStreamBoundElementFactory(
			BindingServiceProperties bindingServiceProperties,
			KafkaStreamsBindingInformationCatalogue KafkaStreamsBindingInformationCatalogue,
			EncodingDecodingBindAdviceHandler encodingDecodingBindAdviceHandler) {
		return new KStreamBoundElementFactory(bindingServiceProperties,
				KafkaStreamsBindingInformationCatalogue, encodingDecodingBindAdviceHandler);
	}

	@Bean
	public KTableBoundElementFactory kTableBoundElementFactory(
			BindingServiceProperties bindingServiceProperties, EncodingDecodingBindAdviceHandler encodingDecodingBindAdviceHandler,
			KafkaStreamsBindingInformationCatalogue KafkaStreamsBindingInformationCatalogue) {
		return new KTableBoundElementFactory(bindingServiceProperties, encodingDecodingBindAdviceHandler, KafkaStreamsBindingInformationCatalogue);
	}

	@Bean
	public GlobalKTableBoundElementFactory globalKTableBoundElementFactory(
			BindingServiceProperties properties, EncodingDecodingBindAdviceHandler encodingDecodingBindAdviceHandler,
			KafkaStreamsBindingInformationCatalogue KafkaStreamsBindingInformationCatalogue) {
		return new GlobalKTableBoundElementFactory(properties, encodingDecodingBindAdviceHandler, KafkaStreamsBindingInformationCatalogue);
	}

	@Bean
	public SendToDlqAndContinue sendToDlqAndContinue() {
		return new SendToDlqAndContinue();
	}

	@Bean
	public KafkaStreamsBindingInformationCatalogue kafkaStreamsBindingInformationCatalogue() {
		return new KafkaStreamsBindingInformationCatalogue();
	}

	@Bean
	@SuppressWarnings("unchecked")
	@ConditionalOnMissingBean
	public KeyValueSerdeResolver keyValueSerdeResolver(
			@Qualifier("streamConfigGlobalProperties") Object streamConfigGlobalProperties,
			@Qualifier("binderConfigurationProperties")KafkaStreamsBinderConfigurationProperties properties) {
		return new KeyValueSerdeResolver(
				(Map<String, Object>) streamConfigGlobalProperties, properties);
	}

	@Bean
	public InteractiveQueryService interactiveQueryServices(
			KafkaStreamsRegistry kafkaStreamsRegistry,
			@Qualifier("binderConfigurationProperties")KafkaStreamsBinderConfigurationProperties properties) {
		return new InteractiveQueryService(kafkaStreamsRegistry, properties);
	}

	@Bean
	public KafkaStreamsRegistry kafkaStreamsRegistry() {
		return new KafkaStreamsRegistry();
	}

	@Bean
	public StreamsBuilderFactoryManager streamsBuilderFactoryManager(
			KafkaStreamsBindingInformationCatalogue catalogue,
			KafkaStreamsRegistry kafkaStreamsRegistry,
			@Nullable KafkaStreamsBinderMetrics kafkaStreamsBinderMetrics,
			@Nullable KafkaStreamsMicrometerListener listener, KafkaProperties kafkaProperties) {
		return new StreamsBuilderFactoryManager(catalogue, kafkaStreamsRegistry, kafkaStreamsBinderMetrics, listener, kafkaProperties);
	}

	@Bean
	@Conditional(FunctionDetectorCondition.class)
	public KafkaStreamsFunctionProcessor kafkaStreamsFunctionProcessor(BindingServiceProperties bindingServiceProperties,
																	KafkaStreamsExtendedBindingProperties kafkaStreamsExtendedBindingProperties,
																	KeyValueSerdeResolver keyValueSerdeResolver,
																	KafkaStreamsBindingInformationCatalogue kafkaStreamsBindingInformationCatalogue,
																	KafkaStreamsMessageConversionDelegate kafkaStreamsMessageConversionDelegate,
																	ObjectProvider<CleanupConfig> cleanupConfig,
																	StreamFunctionProperties streamFunctionProperties,
																	@Qualifier("binderConfigurationProperties") KafkaStreamsBinderConfigurationProperties kafkaStreamsBinderConfigurationProperties,
																	ObjectProvider<StreamsBuilderFactoryBeanConfigurer> customizerProvider, ConfigurableEnvironment environment) {
		return new KafkaStreamsFunctionProcessor(bindingServiceProperties, kafkaStreamsExtendedBindingProperties,
				keyValueSerdeResolver, kafkaStreamsBindingInformationCatalogue, kafkaStreamsMessageConversionDelegate,
				cleanupConfig.getIfUnique(), streamFunctionProperties, kafkaStreamsBinderConfigurationProperties,
				customizerProvider.getIfUnique(), environment);
	}

	@Bean
	public EncodingDecodingBindAdviceHandler encodingDecodingBindAdviceHandler() {
		return new EncodingDecodingBindAdviceHandler();
	}

	@Configuration(proxyBeanMethods = false)
	@ConditionalOnMissingBean(value = KafkaStreamsBinderMetrics.class, name = "outerContext")
	@ConditionalOnClass(name = "io.micrometer.core.instrument.MeterRegistry")
	protected class KafkaStreamsBinderMetricsConfiguration {

		@Bean
		@ConditionalOnBean(MeterRegistry.class)
		@ConditionalOnMissingBean(KafkaStreamsBinderMetrics.class)
		@ConditionalOnMissingClass("org.springframework.kafka.core.MicrometerConsumerListener")
		public KafkaStreamsBinderMetrics kafkaStreamsBinderMetrics(MeterRegistry meterRegistry) {

			return new KafkaStreamsBinderMetrics(meterRegistry);
		}

		@ConditionalOnClass(name = "org.springframework.kafka.core.MicrometerConsumerListener")
		@ConditionalOnBean(MeterRegistry.class)
		protected class KafkaMicrometer {

			@Bean
			@ConditionalOnMissingBean(name = "binderStreamsListener")
			public KafkaStreamsMicrometerListener binderStreamsListener(MeterRegistry meterRegistry) {
				return new KafkaStreamsMicrometerListener(meterRegistry);
			}
		}
	}

	@Configuration(proxyBeanMethods = false)
	@ConditionalOnBean(name = "outerContext")
	@ConditionalOnMissingBean(KafkaStreamsBinderMetrics.class)
	@ConditionalOnClass(name = "io.micrometer.core.instrument.MeterRegistry")
	protected class KafkaStreamsBinderMetricsConfigurationWithMultiBinder {

		@Bean
		@ConditionalOnMissingClass("org.springframework.kafka.core.MicrometerConsumerListener")
		public KafkaStreamsBinderMetrics kafkaStreamsBinderMetrics(ConfigurableApplicationContext context) {

			MeterRegistry meterRegistry = context.getBean("outerContext", ApplicationContext.class)
					.getBean(MeterRegistry.class);
			return new KafkaStreamsBinderMetrics(meterRegistry);
		}

		@ConditionalOnClass(name = "org.springframework.kafka.core.MicrometerConsumerListener")
		@ConditionalOnBean(MeterRegistry.class)
		protected class KafkaMicrometer {

			@Bean
			@ConditionalOnMissingBean(name = "binderStreamsListener")
			public KafkaStreamsMicrometerListener binderStreamsListener(MeterRegistry meterRegistry) {
				return new KafkaStreamsMicrometerListener(meterRegistry);
			}
		}
	}
}


text:
<?php /* Smarty version Smarty-3.1.13, created on 2015-03-18 01:42:33
         compiled from "/home/wwwsyaqd/public_html/plugins/comments/templates/block.latest_comments.tpl" */ ?>
<?php /*%%SmartyHeaderCode:15640649455509104992d127-60886214%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' =>
  array (
    '182db27f664d595b1bd7482c007756186ab66427' =>
    array (
      0 => '/home/wwwsyaqd/public_html/plugins/comments/templates/block.latest_comments.tpl',
      1 => 1425025904,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '15640649455509104992d127-60886214',
  'function' =>
  array (
  ),
  'variables' =>
  array (
    'latest_comments' => 0,
    'comment' => 0,
    'config' => 0,
    'lang' => 0,
    'oarticle' => 0,
    'onews' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_55091049972242_07827536',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_55091049972242_07827536')) {function content_55091049972242_07827536($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/home/wwwsyaqd/public_html/includes/smarty/plugins/modifier.date_format.php';
if (!is_callable('smarty_modifier_truncate')) include '/home/wwwsyaqd/public_html/includes/smarty/plugins/modifier.truncate.php';
if (!is_callable('smarty_function_print_listing_url')) include '/home/wwwsyaqd/public_html/includes/smarty/custom/function.print_listing_url.php';
?><?php if (!empty($_smarty_tpl->tpl_vars['latest_comments']->value)){?>
	<?php  $_smarty_tpl->tpl_vars['comment'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['comment']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['latest_comments']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
 $_smarty_tpl->tpl_vars['comment']->total= $_smarty_tpl->_count($_from);
 $_smarty_tpl->tpl_vars['comment']->iteration=0;
foreach ($_from as $_smarty_tpl->tpl_vars['comment']->key => $_smarty_tpl->tpl_vars['comment']->value){
$_smarty_tpl->tpl_vars['comment']->_loop = true;
 $_smarty_tpl->tpl_vars['comment']->iteration++;
 $_smarty_tpl->tpl_vars['comment']->last = $_smarty_tpl->tpl_vars['comment']->iteration === $_smarty_tpl->tpl_vars['comment']->total;
?>
		<div class="media ia-item one-latest-comment-<?php echo $_smarty_tpl->tpl_vars['comment']->value['id'];?>
">

<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['comment']->value['author'], ENT_QUOTES, 'UTF-8', true);?>
 / <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['comment']->value['date'],$_smarty_tpl->tpl_vars['config']->value['date_format']);?>

					<?php echo smarty_modifier_truncate(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['comment']->value['body']),100);?>

					<?php if ($_smarty_tpl->tpl_vars['comment']->value['item']=='listings'){?>
						<a href="<?php echo smarty_function_print_listing_url(array('listing'=>$_smarty_tpl->tpl_vars['comment']->value['_item'],'details'=>true),$_smarty_tpl);?>
"><?php echo $_smarty_tpl->tpl_vars['lang']->value['check_listing'];?>

					<?php }elseif($_smarty_tpl->tpl_vars['comment']->value['item']=='articles'){?>
						<?php if (isset($_smarty_tpl->tpl_vars["oarticle"])) {$_smarty_tpl->tpl_vars["oarticle"] = clone $_smarty_tpl->tpl_vars["oarticle"];
$_smarty_tpl->tpl_vars["oarticle"]->value = $_smarty_tpl->tpl_vars['comment']->value['_item']; $_smarty_tpl->tpl_vars["oarticle"]->nocache = null; $_smarty_tpl->tpl_vars["oarticle"]->scope = 0;
} else $_smarty_tpl->tpl_vars["oarticle"] = new Smarty_variable($_smarty_tpl->tpl_vars['comment']->value['_item'], null, 0);?>
						<a href="<?php echo @constant('IA_URL');?>
articles/<?php echo $_smarty_tpl->tpl_vars['oarticle']->value['id'];?>
-<?php echo $_smarty_tpl->tpl_vars['oarticle']->value['alias'];?>
.html"><?php echo $_smarty_tpl->tpl_vars['lang']->value['check_article'];?>

					<?php }elseif($_smarty_tpl->tpl_vars['comment']->value['item']=='news'){?>
						<?php if (isset($_smarty_tpl->tpl_vars["onews"])) {$_smarty_tpl->tpl_vars["onews"] = clone $_smarty_tpl->tpl_vars["onews"];
$_smarty_tpl->tpl_vars["onews"]->value = $_smarty_tpl->tpl_vars['comment']->value['_item']; $_smarty_tpl->tpl_vars["onews"]->nocache = null; $_smarty_tpl->tpl_vars["onews"]->scope = 0;
} else $_smarty_tpl->tpl_vars["onews"] = new Smarty_variable($_smarty_tpl->tpl_vars['comment']->value['_item'], null, 0);?>
						<a href="<?php echo $_smarty_tpl->tpl_vars['config']->value['esyn_url'];?>
news/<?php echo $_smarty_tpl->tpl_vars['onews']->value['id'];?>
-<?php echo $_smarty_tpl->tpl_vars['onews']->value['alias'];?>
.html"><?php echo $_smarty_tpl->tpl_vars['lang']->value['check_news'];?>

					<?php }else{ ?>

					<?php }?>

		<?php if (!$_smarty_tpl->tpl_vars['comment']->last){?>
<?php }?>
	<?php } ?>
<?php }?><?php }} ?>

redpajama_set_name: RedPajamaGithub


text:
import pygame, graphics, palette, cursor, toolbar, text, components, wire

graphics.init()
text.init()

class UserInterface:

    def __init__(self):
        self.board = Board(self)
        self.clickables = []
        self.cursor = cursor.Cursor()

        self.toolbar = toolbar.Toolbar()
        self.toolbar.add_tool(components.display.DisplayTool(self.board))
        self.toolbar.add_tool(components.button.ButtonTool(self.board))
        self.clickables.append(self.toolbar)

        infotext = text.render('FlowSID v0.0.1')
        info = pygame.sprite.Sprite()
        info.image = pygame.Surface(infotext.rect.inflate(3, 3).size)
        info.rect = info.image.get_rect()
        info.image.fill(palette.color(0x10))
        pygame.draw.rect(info.image, palette.color(0x20), info.rect, 1)
        infotext.rect.move_ip(2, 2)
        info.image.blit(infotext.image, infotext.rect)
        colors = tuple(palette.color(x) for x in (0x10,0x20,0x30,0x20))
        def update_info(frame):
            info.rect.bottomright = graphics.screen.get_size()
            for x in range(info.rect.width - 2):
                color = colors[(x - 16*len(colors)*frame/255)/2%len(colors)]
                info.image.fill(color, pygame.Rect(x + 1, 1, 1, 1))
                info.image.fill(color, pygame.Rect(info.rect.width - x - 2,
                                                   info.rect.height - 2, 1, 1))

        info.update = update_info
        graphics.uilayer.add(info)

    def event(self, event):
        if event.type == pygame.MOUSEBUTTONDOWN:
            position = tuple(x/graphics.scale for x in event.pos)
            for clickable in self.clickables:
                if clickable.rect.collidepoint(position):
                    rel_pos = (position[0] - clickable.rect.left,
                               position[1] - clickable.rect.top)
                    clickable.mouse_down(rel_pos, event.button)
                    if clickable in self.board.components:
                        self.clickables.remove(clickable)
                        self.clickables.append(clickable)
                    break
        elif event.type == pygame.MOUSEBUTTONUP:
            position = tuple(x/graphics.scale for x in event.pos)
            for clickable in self.clickables:
                rel_pos = (position[0] - clickable.rect.left,
                           position[1] - clickable.rect.top)
                clickable.mouse_up(rel_pos, event.button)

class Board:

    def __init__(self, flowsid):
        self.flowsid = flowsid
        self.components = []

    def add_component(self, component):
        self.components.append(component)
        self.flowsid.clickables.append(component)
        self.flowsid.clickables.extend(component.inputs)
        self.flowsid.clickables.extend(component.outputs)

if __name__ == "__main__":
    graphics.render_loop(UserInterface().event)


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Matsush. Mycol. Mem. 9: 25 (1996)

#### Original name
Soloterminospora Matsush.

### Remarks
null


text:
angular.module('finish.controller', [])
  // This controller is responsible for the finish.html view
  .controller('FinishController', function ($scope, $location, $route) {
    // This will set the route to the main /bolt page and give the access
    // to $scope
    $scope.raceAgain = function () {
      $route.reload('/bolt');
    };
});


text:
from django.conf import settings

if settings.NONREL:
    # Yay monkey patching
    from permission_backend_nonrel.models import UserPermissionList, GroupPermissionList
    from django.contrib.auth.models import Group

    def get_groups(self):
        try:
            user_perm_list = UserPermissionList.objects.get(user = self)

            groups = Group.objects.filter(id__in = user_perm_list.group_fk_list)
        except UserPermissionList.DoesNotExist:
            groups = []

        return groups

    from django.contrib.auth.models import User

    User.add_to_class('group_list', property(get_groups))


text:
package internal

import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"strconv"
)

// TxtRecordService API access to Record.
type TxtRecordService service

// Create a TXT record.
// https://api-docs.constellix.com/?version=latest#22e24d5b-9ec0-49a7-b2b0-5ff0a28e71be
func (s *TxtRecordService) Create(domainID int64, record RecordRequest) ([]Record, error) {
	body, err := json.Marshal(record)
	if err != nil {
		return nil, fmt.Errorf("failed to marshall request body: %w", err)
	}

	endpoint, err := s.client.createEndpoint(defaultVersion, "domains", strconv.FormatInt(domainID, 10), "records", "txt")
	if err != nil {
		return nil, fmt.Errorf("failed to create request endpoint: %w", err)
	}

	req, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewReader(body))
	if err != nil {
		return nil, fmt.Errorf("failed to create request: %w", err)
	}

	var records []Record
	err = s.client.do(req, &records)
	if err != nil {
		return nil, err
	}

	return records, nil
}

// GetAll TXT records.
// https://api-docs.constellix.com/?version=latest#e7103c53-2ad8-4bc8-b5b3-4c22c4b571b2
func (s *TxtRecordService) GetAll(domainID int64) ([]Record, error) {
	endpoint, err := s.client.createEndpoint(defaultVersion, "domains", strconv.FormatInt(domainID, 10), "records", "txt")
	if err != nil {
		return nil, fmt.Errorf("failed to create request endpoint: %w", err)
	}

	req, err := http.NewRequest(http.MethodGet, endpoint, nil)
	if err != nil {
		return nil, fmt.Errorf("failed to create request: %w", err)
	}

	var records []Record
	err = s.client.do(req, &records)
	if err != nil {
		return nil, err
	}

	return records, nil
}

// Get a TXT record.
// https://api-docs.constellix.com/?version=latest#e7103c53-2ad8-4bc8-b5b3-4c22c4b571b2
func (s *TxtRecordService) Get(domainID, recordID int64) (*Record, error) {
	endpoint, err := s.client.createEndpoint(defaultVersion, "domains", strconv.FormatInt(domainID, 10), "records", "txt", strconv.FormatInt(recordID, 10))
	if err != nil {
		return nil, fmt.Errorf("failed to create request endpoint: %w", err)
	}

	req, err := http.NewRequest(http.MethodGet, endpoint, nil)
	if err != nil {
		return nil, fmt.Errorf("failed to create request: %w", err)
	}

	var records Record
	err = s.client.do(req, &records)
	if err != nil {
		return nil, err
	}

	return &records, nil
}

// Update a TXT record.
// https://api-docs.constellix.com/?version=latest#d4e9ab2e-fac0-45a6-b0e4-cf62a2d2e3da
func (s *TxtRecordService) Update(domainID, recordID int64, record RecordRequest) (*SuccessMessage, error) {
	body, err := json.Marshal(record)
	if err != nil {
		return nil, fmt.Errorf("failed to marshall request body: %w", err)
	}

	endpoint, err := s.client.createEndpoint(defaultVersion, "domains", strconv.FormatInt(domainID, 10), "records", "txt", strconv.FormatInt(recordID, 10))
	if err != nil {
		return nil, fmt.Errorf("failed to create request endpoint: %w", err)
	}

	req, err := http.NewRequest(http.MethodPut, endpoint, bytes.NewReader(body))
	if err != nil {
		return nil, fmt.Errorf("failed to create request: %w", err)
	}

	var msg SuccessMessage
	err = s.client.do(req, &msg)
	if err != nil {
		return nil, err
	}

	return &msg, nil
}

// Delete a TXT record.
// https://api-docs.constellix.com/?version=latest#135947f7-d6c8-481a-83c7-4d387b0bdf9e
func (s *TxtRecordService) Delete(domainID, recordID int64) (*SuccessMessage, error) {
	endpoint, err := s.client.createEndpoint(defaultVersion, "domains", strconv.FormatInt(domainID, 10), "records", "txt", strconv.FormatInt(recordID, 10))
	if err != nil {
		return nil, fmt.Errorf("failed to create request endpoint: %w", err)
	}

	req, err := http.NewRequest(http.MethodDelete, endpoint, nil)
	if err != nil {
		return nil, fmt.Errorf("failed to create request: %w", err)
	}

	var msg *SuccessMessage
	err = s.client.do(req, &msg)
	if err != nil {
		return nil, err
	}

	return msg, nil
}

// Search searches for a TXT record by name.
// https://api-docs.constellix.com/?version=latest#81003e4f-bd3f-413f-a18d-6d9d18f10201
func (s *TxtRecordService) Search(domainID int64, filter searchFilter, value string) ([]Record, error) {
	endpoint, err := s.client.createEndpoint(defaultVersion, "domains", strconv.FormatInt(domainID, 10), "records", "txt", "search")
	if err != nil {
		return nil, fmt.Errorf("failed to create request endpoint: %w", err)
	}

	req, err := http.NewRequest(http.MethodGet, endpoint, nil)
	if err != nil {
		return nil, fmt.Errorf("failed to create request: %w", err)
	}

	query := req.URL.Query()
	query.Set(string(filter), value)
	req.URL.RawQuery = query.Encode()

	var records []Record

	err = s.client.do(req, &records)
	if err != nil {
		var nf *NotFound
		if !errors.As(err, &nf) {
			return nil, err
		}
	}

	return records, nil
}


text:
<?php
 /*********
* Author:Koushik Rout
* Date  : 25 April 2012
* Modified By: Jagannath Samanta
* Modified Date: 28 June 2011
*
* Purpose:
*  View For help front end
*
* @subpackage help
*
* @link InfController.php
* @link My_Controller.php
* @link views/fe/home/help/
*/
?>
<?php include_once(APPPATH."views/fe/common/breadcrumb.tpl.php"); ?>

<?php echo addslashes(t('Articles'))?>

				  <?php echo $article_list ?>


text:
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/interrupt.h>
#include <asm/tlb.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
#include <cpu/registers.h>

/* Callable from fault.c, so not static */
inline void __do_tlb_refill(unsigned long address,
                            unsigned long long is_text_not_data, pte_t *pte)
{
	unsigned long long ptel;
	unsigned long long pteh=0;
	struct tlb_info *tlbp;
	unsigned long long next;

	/* Get PTEL first */
	ptel = pte_val(*pte);

	/*
	 * Set PTEH register
	 */
	pteh = neff_sign_extend(address & MMU_VPN_MASK);

	/* Set the ASID. */
	pteh |= get_asid() << PTEH_ASID_SHIFT;
	pteh |= PTEH_VALID;

	/* Set PTEL register, set_pte has performed the sign extension */
	ptel &= _PAGE_FLAGS_HARDWARE_MASK; /* drop software flags */

	tlbp = is_text_not_data ? &(cpu_data->itlb) : &(cpu_data->dtlb);
	next = tlbp->next;
	__flush_tlb_slot(next);
	asm volatile ("putcfg %0,1,%2\n\n\t"
		      "putcfg %0,0,%1\n"
		      :  : "r" (next), "r" (pteh), "r" (ptel) );

	next += TLB_STEP;
	if (next > tlbp->last) next = tlbp->first;
	tlbp->next = next;

}

static int handle_vmalloc_fault(struct mm_struct *mm,
				unsigned long protection_flags,
                                unsigned long long textaccess,
				unsigned long address)
{
	pgd_t *dir;
	pud_t *pud;
	pmd_t *pmd;
	static pte_t *pte;
	pte_t entry;

	dir = pgd_offset_k(address);

	pud = pud_offset(dir, address);
	if (pud_none_or_clear_bad(pud))
		return 0;

	pmd = pmd_offset(pud, address);
	if (pmd_none_or_clear_bad(pmd))
		return 0;

	pte = pte_offset_kernel(pmd, address);
	entry = *pte;

	if (pte_none(entry) || !pte_present(entry))
		return 0;
	if ((pte_val(entry) & protection_flags) != protection_flags)
		return 0;

        __do_tlb_refill(address, textaccess, pte);

	return 1;
}

static int handle_tlbmiss(struct mm_struct *mm,
			  unsigned long long protection_flags,
			  unsigned long long textaccess,
			  unsigned long address)
{
	pgd_t *dir;
	pud_t *pud;
	pmd_t *pmd;
	pte_t *pte;
	pte_t entry;

	/* NB. The PGD currently only contains a single entry - there is no
	   page table tree stored for the top half of the address space since
	   virtual pages in that region should never be mapped in user mode.
	   (In kernel mode, the only things in that region are the 512Mb super
	   page (locked in), and vmalloc (modules) +  I/O device pages (handled
	   by handle_vmalloc_fault), so no PGD for the upper half is required
	   by kernel mode either).

	   See how mm->pgd is allocated and initialised in pgd_alloc to see why
	   the next test is necessary.  - RPC */
	if (address >= (unsigned long) TASK_SIZE)
		/* upper half - never has page table entries. */
		return 0;

	dir = pgd_offset(mm, address);
	if (pgd_none(*dir) || !pgd_present(*dir))
		return 0;
	if (!pgd_present(*dir))
		return 0;

	pud = pud_offset(dir, address);
	if (pud_none(*pud) || !pud_present(*pud))
		return 0;

	pmd = pmd_offset(pud, address);
	if (pmd_none(*pmd) || !pmd_present(*pmd))
		return 0;

	pte = pte_offset_kernel(pmd, address);
	entry = *pte;

	if (pte_none(entry) || !pte_present(entry))
		return 0;

	/*
	 * If the page doesn't have sufficient protection bits set to
	 * service the kind of fault being handled, there's not much
	 * point doing the TLB refill.  Punt the fault to the general
	 * handler.
	 */
	if ((pte_val(entry) & protection_flags) != protection_flags)
		return 0;

        __do_tlb_refill(address, textaccess, pte);

	return 1;
}

/*
 * Put all this information into one structure so that everything is just
 * arithmetic relative to a single base address.  This reduces the number
 * of movi/shori pairs needed just to load addresses of static data.
 */
struct expevt_lookup {
	unsigned short protection_flags[8];
	unsigned char  is_text_access[8];
	unsigned char  is_write_access[8];
};

#define PRU (1<<9)
#define PRW (1<<8)
#define PRX (1<<7)
#define PRR (1<<6)

#define DIRTY (_PAGE_DIRTY | _PAGE_ACCESSED)
#define YOUNG (_PAGE_ACCESSED)

/* Sized as 8 rather than 4 to allow checking the PTE's PRU bit against whether
   the fault happened in user mode or privileged mode. */
static struct expevt_lookup expevt_lookup_table = {
	.protection_flags = {PRX, PRX, 0, 0, PRR, PRR, PRW, PRW},
	.is_text_access   = {1,   1,   0, 0, 0,   0,   0,   0}
};

/*
   This routine handles page faults that can be serviced just by refilling a
   TLB entry from an existing page table entry.  (This case represents a very
   large majority of page faults.) Return 1 if the fault was successfully
   handled.  Return 0 if the fault could not be handled.  (This leads into the
   general fault handling in fault.c which deals with mapping file-backed
   pages, stack growth, segmentation faults, swapping etc etc)
 */
asmlinkage int do_fast_page_fault(unsigned long long ssr_md,
				  unsigned long long expevt,
			          unsigned long address)
{
	struct task_struct *tsk;
	struct mm_struct *mm;
	unsigned long long textaccess;
	unsigned long long protection_flags;
	unsigned long long index;
	unsigned long long expevt4;

	/* The next few lines implement a way of hashing EXPEVT into a
	 * small array index which can be used to lookup parameters
	 * specific to the type of TLBMISS being handled.
	 *
	 * Note:
	 *	ITLBMISS has EXPEVT==0xa40
	 *	RTLBMISS has EXPEVT==0x040
	 *	WTLBMISS has EXPEVT==0x060
	 */
	expevt4 = (expevt >> 4);
	/* TODO : xor ssr_md into this expression too. Then we can check
	 * that PRU is set when it needs to be. */
	index = expevt4 ^ (expevt4 >> 5);
	index &= 7;
	protection_flags = expevt_lookup_table.protection_flags[index];
	textaccess       = expevt_lookup_table.is_text_access[index];

	/* SIM
	 * Note this is now called with interrupts still disabled
	 * This is to cope with being called for a missing IO port
	 * address with interrupts disabled. This should be fixed as
	 * soon as we have a better 'fast path' miss handler.
	 *
	 * Plus take care how you try and debug this stuff.
	 * For example, writing debug data to a port which you
	 * have just faulted on is not going to work.
	 */

	tsk = current;
	mm = tsk->mm;

	if ((address >= VMALLOC_START && address < VMALLOC_END) ||
	    (address >= IOBASE_VADDR  && address < IOBASE_END)) {
		if (ssr_md)
			/*
			 * Process-contexts can never have this address
			 * range mapped
			 */
			if (handle_vmalloc_fault(mm, protection_flags,
						 textaccess, address))
				return 1;
	} else if (!in_interrupt() && mm) {
		if (handle_tlbmiss(mm, protection_flags, textaccess, address))
			return 1;
	}

	return 0;
}


text:
package bt_vcs

import (
	"context"
	"io/ioutil"
	"math"
	"testing"
	"time"

	"github.com/stretchr/testify/require"
	cipd_git "go.skia.org/infra/bazel/external/cipd/git"
	"go.skia.org/infra/go/git"
	"go.skia.org/infra/go/gitstore"
	gs_testutils "go.skia.org/infra/go/gitstore/bt_gitstore/testutils"
	"go.skia.org/infra/go/gitstore/mocks"
	"go.skia.org/infra/go/testutils"
	"go.skia.org/infra/go/util"
	"go.skia.org/infra/go/vcsinfo"
	vcs_testutils "go.skia.org/infra/go/vcsinfo/testutils"
	"golang.org/x/sync/errgroup"
)

func TestVCSSuite(t *testing.T) {
	ctx, vcs, _, cleanup := setupVCSLocalRepo(t, git.MasterBranch)
	defer cleanup()

	// Run the VCS test suite.
	vcs_testutils.TestByIndex(ctx, t, vcs)
	vcs_testutils.TestDisplay(ctx, t, vcs)
	vcs_testutils.TestFrom(ctx, t, vcs)
	vcs_testutils.TestIndexOf(ctx, t, vcs)
	vcs_testutils.TestLastNIndex(ctx, t, vcs)
	vcs_testutils.TestRange(ctx, t, vcs)
}

func TestBranchInfo(t *testing.T) {
	ctx, vcs, gitStore, cleanup := setupVCSLocalRepo(t, gitstore.ALL_BRANCHES)
	defer cleanup()

	branchPointers, err := gitStore.GetBranches(ctx)
	require.NoError(t, err)
	branches := []string{}
	for branchName := range branchPointers {
		if branchName != gitstore.ALL_BRANCHES {
			branches = append(branches, branchName)
		}
	}

	vcs_testutils.TestBranchInfo(ctx, t, vcs, branches)
}

// TestConcurrentUpdate verifies that BigTableVCS.Update() behaves correctly
// when called concurrently.
func TestConcurrentUpdate(t *testing.T) {

	numGoroutines := 10
	mg := &mocks.GitStore{}
	defer mg.AssertExpectations(t)

	// Pretend the repo has one commit at first.
	ics := makeTestIndexCommits()
	lcs := makeTestLongCommits()
	hashes := make([]string, 0, len(ics))
	for _, ic := range ics {
		hashes = append(hashes, ic.Hash)
	}

	mg.On("RangeN", testutils.AnyContext, 0, math.MaxInt32, git.MasterBranch).Return(ics[:1], nil).Once()
	mg.On("Get", testutils.AnyContext, hashes[:1]).Return(lcs[:1], nil).Once()

	ctx := context.Background()
	vcs, err := New(ctx, mg, git.MasterBranch)
	require.NoError(t, err)

	// Now, pretend that the other two commits have landed, and run Update
	// in several goroutines. We expect the first call to Update() to run
	// RangeN starting at zero (despite our already having the first commit
	// from above, because we request a range which overlaps by one commit.
	// Subsequent calls should already be loaded with IndexCommits and thus
	// should start at 2.
	mg.On("RangeN", testutils.AnyContext, 0, math.MaxInt32, git.MasterBranch).Return(ics, nil).Once()
	mg.On("Get", testutils.AnyContext, hashes[1:]).Return(lcs[1:], nil).Once()
	mg.On("RangeN", testutils.AnyContext, 2, math.MaxInt32, git.MasterBranch).Return(ics[2:], nil)

	var egroup errgroup.Group
	for i := 0; i < numGoroutines; i++ {
		egroup.Go(func() error {
			return vcs.Update(ctx, true, false)
		})
	}
	require.NoError(t, egroup.Wait())
}

// TestDetailsCaching makes sure that multiple calls to Details do
// not result in multiple calls to the underlying gitstore, that is,
// the details per commit hash are cached.
func TestDetailsCaching(t *testing.T) {

	mg := &mocks.GitStore{}
	defer mg.AssertExpectations(t)

	commits := makeTestLongCommits()

	mg.On("RangeN", testutils.AnyContext, 0, math.MaxInt32, git.MasterBranch).Return(makeTestIndexCommits(), nil)
	mg.On("Get", testutils.AnyContext, []string{firstHash, secondHash, thirdHash}).Return(commits, nil).Once()

	vcs, err := New(context.Background(), mg, git.MasterBranch)
	require.NoError(t, err)

	// query details 3 times, and make sure it uses the cache after the
	// first time. Since we said Once() on the mocked Get function, we are
	// assured that gitstore.Get() is only called once.
	ctx := context.Background()
	c, err := vcs.Details(ctx, firstHash, false)
	require.NoError(t, err)
	require.Equal(t, commits[0], c)
	require.Nil(t, c.Branches)
	c, err = vcs.Details(ctx, firstHash, false)
	require.NoError(t, err)
	require.Equal(t, commits[0], c)
	c, err = vcs.Details(ctx, firstHash, false)
	require.NoError(t, err)
	require.Equal(t, commits[0], c)
}

// TestDetailsMultiCaching makes sure that multiple calls to DetailsMulti do
// not result in multiple calls to the underlying gitstore, that is,
// the details per commit hash are cached.
func TestDetailsMultiCaching(t *testing.T) {

	mg := &mocks.GitStore{}
	defer mg.AssertExpectations(t)

	commits := makeTestLongCommits()

	mg.On("RangeN", testutils.AnyContext, 0, math.MaxInt32, git.MasterBranch).Return(makeTestIndexCommits(), nil)
	mg.On("Get", testutils.AnyContext, []string{firstHash, secondHash, thirdHash}).Return(commits, nil).Once()

	vcs, err := New(context.Background(), mg, git.MasterBranch)
	require.NoError(t, err)

	// query details 3 times, and make sure it uses the cache after the
	// first time. Since we said Once() on the mocked Get function, we are
	// assured that gitstore.Get() is only called once.
	ctx := context.Background()
	c, err := vcs.DetailsMulti(ctx, []string{firstHash, secondHash}, false)
	require.NoError(t, err)
	require.NotNil(t, c)
	require.Len(t, c, 2)
	require.Equal(t, commits[0], c[0])
	require.Equal(t, commits[1], c[1])
	c, err = vcs.DetailsMulti(ctx, []string{firstHash, secondHash}, false)
	require.NoError(t, err)
	require.NotNil(t, c)
	require.Len(t, c, 2)
	require.Equal(t, commits[0], c[0])
	require.Equal(t, commits[1], c[1])
	c, err = vcs.DetailsMulti(ctx, []string{firstHash, secondHash}, false)
	require.NoError(t, err)
	require.NotNil(t, c)
	require.Len(t, c, 2)
	require.Equal(t, commits[0], c[0])
	require.Equal(t, commits[1], c[1])
}

// setupVCSLocalRepo loads the test repo into a new GitStore and returns an instance of vcsinfo.VCS.
func setupVCSLocalRepo(t *testing.T, branch string) (context.Context, vcsinfo.VCS, gitstore.GitStore, func()) {
	repoDir, cleanup := vcs_testutils.InitTempRepo(t)
	wd, err := ioutil.TempDir("", "")
	require.NoError(t, err)
	ctx := cipd_git.UseGitFinder(context.Background())
	_, _, btgs := gs_testutils.SetupAndLoadBTGitStore(t, ctx, wd, "file://"+repoDir, true)
	vcs, err := New(ctx, btgs, branch)
	require.NoError(t, err)
	return ctx, vcs, btgs, func() {
		util.RemoveAll(wd)
		cleanup()
	}
}

const (
	// arbitrary sha1 hashes
	firstHash  = "ae76331b95dfc399cd776d2fc68021e0db03cc4f"
	secondHash = "b295e0bdde1938d1fbfd343e5a3e569e868e1465"
	thirdHash  = "cf70f4c33de2200b76651bbe1e54aa55fcd77447"
)

var (
	// arbitrary times
	firstTime  = time.Date(2019, time.May, 2, 12, 0, 3, 0, time.UTC)
	secondTime = time.Date(2019, time.May, 2, 14, 1, 3, 0, time.UTC)
	thirdTime  = time.Date(2019, time.May, 2, 17, 5, 3, 0, time.UTC)
)

// This test data (for a repo of 3 commits) is returned via functions
// to make it convenient to have a copy of the data for each test,
// so the tests can write all over the returned values w/o impacting
// tests that follow.
func makeTestLongCommits() []*vcsinfo.LongCommit {
	return []*vcsinfo.LongCommit{
		{
			ShortCommit: &vcsinfo.ShortCommit{
				Author:  "alpha@example.com",
				Hash:    firstHash,
				Subject: "initial commit",
			},
			Body:      "awesome message",
			Parents:   []string{},
			Timestamp: firstTime,
		},
		{
			ShortCommit: &vcsinfo.ShortCommit{
				Author:  "beta@example.com",
				Hash:    secondHash,
				Subject: "followup commit",
			},
			Body:      "bug fixes",
			Parents:   []string{firstHash},
			Timestamp: secondTime,
		},
		{
			ShortCommit: &vcsinfo.ShortCommit{
				Author:  "gamma@example.com",
				Hash:    thirdHash,
				Subject: "last commit",
			},
			Body:      "now deprecated",
			Parents:   []string{secondHash},
			Timestamp: thirdTime,
		},
	}
}

func makeTestIndexCommits() []*vcsinfo.IndexCommit {
	return []*vcsinfo.IndexCommit{
		{
			Hash:      firstHash,
			Index:     0,
			Timestamp: firstTime,
		},
		{
			Hash:      secondHash,
			Index:     1,
			Timestamp: secondTime,
		},
		{
			Hash:      thirdHash,
			Index:     2,
			Timestamp: thirdTime,
		},
	}
}


text:
package com.github.mikephil.charting.charts;

import android.content.Context;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;

import com.github.mikephil.charting.renderer.ColumnToBarTransformer;
import com.github.mikephil.charting.utils.Utils;
import com.github.mikephil.charting.utils.YLabels;

public class HorizontalBarChart extends BarChart
{
	public HorizontalBarChart(Context context)
	{
		super(context);
	}

	public HorizontalBarChart(Context context, AttributeSet attrs)
	{
		super(context, attrs);
	}

	public HorizontalBarChart(Context context, AttributeSet attrs,
							  int defStyle)
	{
		super(context, attrs, defStyle);
	}

	@Override
	protected void init()
	{
		super.init();
		setDrawXLabels(false);
		setDrawYLabels(true);
		mTrans = new ColumnToBarTransformer();
		mValuePaint.setTextAlign(Paint.Align.LEFT);
	}

	/**
	 * Prepares a bar for drawing on the specified x-index and y-position. Also
	 * prepares the shadow-bar if enabled.
	 *
	 * @param x the x-position
	 * @param y the y-position
	 * @param barspace the space between bars
	 */
	@Override
	protected void prepareBar(float x, float y, float barspace) {

		super.prepareBar(x, y, barspace);
		float spaceHalf = barspace / 2f;

		float top = x + spaceHalf;
		float bottom = x + 1f - spaceHalf;

		mBarRect.set(0, top, y, bottom);

		mTrans.rectValueToPixel(mBarRect, mPhaseY);

		// if a shadow is drawn, prepare it too
		if (mDrawBarShadow) {
			mBarShadow.set(mBarRect.left, mOffsetTop, mBarRect.right, getHeight() - mOffsetBottom);
		}
	}

	@Override
	protected void calcModulus() {

        float[] values = new float[9];
        mTrans.getTouchMatrix().getValues(values);

        mXLabels.mYAxisLabelModulus = (int) Math
                .ceil((mData.getXValCount() * mXLabels.mLabelHeight)
                        / (mContentRect.height() * values[Matrix.MSCALE_Y]));
	}

	@Override
	protected void drawXLabels(float yPos)
	{
		if (!mDrawXLabels) return;

		mXLabelPaint.setTextAlign(Paint.Align.RIGHT);
		// pre allocate to save performance (dont allocate in loop)
		float[] position = new float[] {
				0f, 0f
		};

		float offset = Utils.calcTextHeight(mXLabelPaint, mData.getXVals().get(0)) / 2f;

		int step = mData.getDataSetCount();

		for (int i = 0; i < mData.getXValCount(); i += mXLabels.mYAxisLabelModulus) {

			position[1] = i * step + i * mData.getGroupSpace()
					+ mData.getGroupSpace() / 2f;

			// center the text
			if (mXLabels.isCenterXLabelsEnabled())
				position[1] += (step / 2f);

			mTrans.pointValuesToPixel(position);

			if (position[1] >= mOffsetTop && position[1] <= getHeight() - mOffsetBottom)
			{
				String label = mData.getXVals().get(i);

				mDrawCanvas.drawText(label, mOffsetLeft-10, position[1] + offset, mXLabelPaint);
			}
		}
	}

	private static String TALL_VALUE = "100%";
	@Override
	protected float getPositiveYOffset(boolean drawAboveValueBar)
	{
		Rect bounds = new Rect();
		mValuePaint.getTextBounds(TALL_VALUE,0,TALL_VALUE.length(),bounds);

		return bounds.height()/2;
	}

	@Override
	protected float getNegativeYOffset(boolean drawAboveValueBar)
	{
		return getPositiveYOffset(drawAboveValueBar);
	}

	/**
	 * Sets up the y-axis labels. Computes the desired number of labels between
	 * the two given extremes. Unlike the papareXLabels() method, this method
	 * needs to be called upon every refresh of the view.
	 *
	 * @return
	 */
	@Override
	protected void prepareYLabels()
	{
	    mYLabels = new XLabelsAsYLabels();
//	    super.prepareYLabels();

	}

	private class XLabelsAsYLabels extends YLabels
	{
		/**
		 * Returns the longest formatted label (in terms of characters) the y-labels
		 * contain.
		 *
		 * @return
		 */
		@Override
		public String getLongestLabel()
		{
			String longest = "";

			for (int i = 0; i < mData.getXValCount(); i ++)
			{
				String text = mData.getXVals().get(i);

				if (longest.length() < text.length())
					longest = text;
			}

			return longest;
		}

		/**
		 * Returns the formatted y-label at the specified index. This will either
		 * use the auto-formatter or the custom formatter (if one is set).
		 *
		 * @param index
		 * @return
		 */
		@Override
		public String getFormattedLabel(int index)
		{
			super.getFormattedLabel(index);
			if (index < 0)
				return "";

			return mData.getXVals().get(index);
		}
	}
}


text:
import { AppPage } from './app.po';

describe('day8-fun-with-html5-canvas App', () => {
  let page: AppPage;

  beforeEach(() => {
    page = new AppPage();
  });

  it('should display welcome message', () => {
    page.navigateTo();
    expect(page.getParagraphText()).toEqual('Welcome to app!');
  });
});


text:
config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

preserve_perms() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  if [ -e $OLD ]; then
    cp -a $OLD ${NEW}.incoming
    cat $NEW > ${NEW}.incoming
    mv ${NEW}.incoming $NEW
  fi
  config $NEW
}

preserve_perms etc/rc.d/rc.dahdi.new

config etc/udev/rules.d/xpp.rules.new
config etc/udev/rules.d/dahdi.rules.new
config etc/hotplug/usb/xpp_fxloader.usermap.new
config etc/dahdi/system.conf.new
config etc/dahdi/assigned-spans.conf.sample.new
config etc/dahdi/span-types.conf.sample.new
config etc/dahdi/init.conf.new
config etc/dahdi/modules.new
config etc/dahdi/genconf_parameters.new
config etc/bash_completion.d/dahdi.new
config etc/modprobe.d/dahdi.conf.new
config etc/modprobe.d/dahdi.blacklist.conf.new

chroot . /sbin/depmod -a


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Docums Mycol. 19(no. 73): 66 (1988)

#### Original name
Cortinarius cookeanus Rob. Henry, 1988

### Remarks
null


text:
package org.apache.asterix.external.indexing.input;

import java.io.InputStream;

import org.apache.hadoop.mapred.Counters.Counter;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.Reporter;

/***
 * an abstract class to be used for reading hdfs based datasets one record at a time <- used for indexing->
 */
@SuppressWarnings("deprecation")
public abstract class AbstractHDFSReader extends InputStream {

    /***
     * This function should be called once to do initial setup before starting to read records
     *
     * @return true if ready for reading
     */
    abstract public boolean initialize() throws Exception;

    /***
     * @return the next object read or null if reached end of stream
     */
    abstract public Object readNext() throws Exception;

    /**
     * @return the file name of the current filesplit being read
     * @throws Exception
     *             in case of end of records is reached
     */
    abstract public String getFileName() throws Exception;

    /**
     * @return return the reader position of last record read
     * @throws Exception
     *             in case of end of records is reached
     */
    abstract public long getReaderPosition() throws Exception;

    /**
     * @return the file number of the file being read
     * @throws Exception
     */
    abstract public int getFileNumber() throws Exception;

    protected Reporter getReporter() {
        Reporter reporter = new Reporter() {

            @Override
            public Counter getCounter(Enum<?> arg0) {
                return null;
            }

            @Override
            public Counter getCounter(String arg0, String arg1) {
                return null;
            }

            @Override
            public InputSplit getInputSplit() throws UnsupportedOperationException {
                return null;
            }

            @Override
            public void incrCounter(Enum<?> arg0, long arg1) {
            }

            @Override
            public void incrCounter(String arg0, String arg1, long arg2) {
            }

            @Override
            public void setStatus(String arg0) {
            }

            @Override
            public void progress() {
            }

            public float getProgress() {
                return 0.0f;
            }
        };

        return reporter;
    }

}


text:
using SOURCE.Web.ViewModels.Pages.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SOURCE.Web.ViewModels.ModelBuilders.Common
{
    public interface ICommonModelBuilder
    {
        NavBarViewModel BuildNavBarViewModel(Context context);
        NavBarViewModel BuildNavBarStaticViewModel(Context context, string title);
        PageViewModel BuildPageViewModel(Context context, string codePage, long? idFonctionnel);
        PartialViewModel BuildPartialViewModel(Context context, long? idFonctionnel);
        TraductionsViewModel BuildTraductionViewModel(Context context, string type, long referenceId);
        DetailsViewModel BuildDetailsViewModel(Context context, long modeAffichageID, long groupeVueID, long? idFonctionnel, long? vueID, string tableName = null);
    }
}


text:
import pytest

@pytest.fixture()
def node(Ansible, Interface, Command, request):
    """
    This fixture represents a single node in the ceph cluster. Using the
    Ansible fixture provided by testinfra it can access all the ansible variables
    provided to it by the specific test scenario being ran.

    You must include this fixture on any tests that operate on specific type of node
    because it contains the logic to manage which tests a node should run.
    """
    ansible_vars = Ansible.get_variables()
    node_type = ansible_vars["group_names"][0]
    docker = ansible_vars.get("docker")
    if not request.node.get_marker(node_type) and not request.node.get_marker('all'):
        pytest.skip("Not a valid test for node type: %s" % node_type)

    if request.node.get_marker("no_docker") and docker:
        pytest.skip("Not a valid test for containerized deployments or atomic hosts")

    journal_collocation_test = ansible_vars.get("journal_collocation") or ansible_vars.get("dmcrypt_journal_collocation")
    if request.node.get_marker("journal_collocation") and not journal_collocation_test:
        pytest.skip("Scenario is not using journal collocation")

    osd_ids = []
    osds = []
    cluster_address = ""
    # I can assume eth1 because I know all the vagrant
    # boxes we test with use that interface
    address = Interface("eth1").addresses[0]
    subnet = ".".join(ansible_vars["public_network"].split(".")[0:-1])
    num_mons = len(ansible_vars["groups"]["mons"])
    num_devices = len(ansible_vars["devices"])
    num_osd_hosts = len(ansible_vars["groups"]["osds"])
    total_osds = num_devices * num_osd_hosts
    cluster_name = ansible_vars.get("cluster", "ceph")
    conf_path = "/etc/ceph/{}.conf".format(cluster_name)
    if node_type == "osds":
        # I can assume eth2 because I know all the vagrant
        # boxes we test with use that interface. OSDs are the only
        # nodes that have this interface.
        cluster_address = Interface("eth2").addresses[0]
        cmd = Command('sudo ls /var/lib/ceph/osd/ | sed "s/.*-//"')
        if cmd.rc == 0:
            osd_ids = cmd.stdout.rstrip("\n").split("\n")
            osds = osd_ids
            if docker:
                osds = [device.split("/")[-1] for device in ansible_vars["devices"]]

    data = dict(
        address=address,
        subnet=subnet,
        vars=ansible_vars,
        osd_ids=osd_ids,
        num_mons=num_mons,
        num_devices=num_devices,
        num_osd_hosts=num_osd_hosts,
        total_osds=total_osds,
        cluster_name=cluster_name,
        conf_path=conf_path,
        cluster_address=cluster_address,
        docker=docker,
        osds=osds,
    )
    return data

def pytest_collection_modifyitems(session, config, items):
    for item in items:
        test_path = item.location[0]
        if "mon" in test_path:
            item.add_marker(pytest.mark.mons)
        elif "osd" in test_path:
            item.add_marker(pytest.mark.osds)
        elif "mds" in test_path:
            item.add_marker(pytest.mark.mdss)
        elif "rgw" in test_path:
            item.add_marker(pytest.mark.rgws)
        else:
            item.add_marker(pytest.mark.all)

        if "journal_collocation" in test_path:
            item.add_marker(pytest.mark.journal_collocation)


text:
namespace g{namespace Fuse{namespace Shapes{struct Ellipse;}}}

namespace g{
namespace Fuse{
namespace Shapes{

// public sealed class Ellipse :182
// {
::g::Fuse::Shapes::PathShape_type* Ellipse_typeof();
void Ellipse__UpdatePath_fn(Ellipse* __this);

struct Ellipse : ::g::Fuse::Shapes::PathShape
{
    ::g::Uno::Float2 _cachedRadius;
};
// }

}}} // ::g::Fuse::Shapes


text:
app.controller('foodController', function(titleService) {
  titleService.prepForBroadcast('Alimentos');
});


text:
package p

func _() {
	// the scope of a local type declaration starts immediately after the type name
	type T struct{ _ *T }
}


text:
class ExpectedFailures(object):
    def __init__(self):
        self._failures = set()

    def _can_trust_results(self, results):
        if not results or not results.failure_limit_count():
            return False
        return len(results.failing_tests()) != 0 and len(results.failing_tests()) != results.failure_limit_count()

    def failures_were_expected(self, results):
        if not self._can_trust_results(results):
            return False
        return set(results.failing_tests()) <= self._failures

    def shrink_expected_failures(self, results, run_success):
        if run_success:
            self._failures = set()
        elif self._can_trust_results(results):
            # Remove all expected failures which are not in the new failing results.
            self._failures.intersection_update(set(results.failing_tests()))

    def grow_expected_failures(self, results):
        if not self._can_trust_results(results):
            return
        self._failures.update(results.failing_tests())
        # FIXME: Should we assert() here that expected_failures never crosses a certain size?


text:
<?php
/**
 * Created by PhpStorm.
 * User: Neff
 * Date: 13.11.15
 * Time: 15:13
 */

$this->pageHeader=$model->getModelName().':'.' "'.$model->name.'"';

$questions = Question::model()->findAllByAttributes(array('id_voting'=>$model->id),array('order'=>'priority desc'));

$gridDataProvider = new CArrayDataProvider($questions);

?>

<?=Yii::t('main','Agenda')?>

        <?php
        $this->widget('booster.widgets.TbGridView',array(
            'id'=>'question-grid',
            'dataProvider'=>$gridDataProvider,
            'filter'=>null,
            'responsiveTable' => true,
            'type'=>'striped condensed hover',
            'template'=>"{summary}\n{pager}\n{items}\n{pager}",
            'pager' => array(
                'firstPageLabel'=>'<<',
                'prevPageLabel'=>'<',
                'nextPageLabel'=>'>',
                'lastPageLabel'=>'>>',
                'maxButtonCount'=>'10',
                'class' => 'booster.widgets.TbPager',
                'alignment'=>'centered',
                'displayFirstAndLast'=>true
            ),
            'columns'=>array(
                'question',
                'description'=>array(
                    'name'=>'description',
                    'type'=>'html'
                )
            ),
        ));
        ?>


text:
<?php
require_once './autoloader.php';

$translator = Zend\I18n\Translator\Translator::factory(array(
    'locale' => 'zh',
    'translation_file_patterns' => array(
        'zf' => array(
            'type' => 'PhpArray',
            'base_dir' => EVA_LIB_PATH . '/Zend/resources/languages/',
            'pattern' => '%s/Zend_Validate.php'
        ),
    ),
));
Zend\Validator\AbstractValidator::setDefaultTranslator($translator);

$validatorChain = new Zend\Validator\ValidatorChain();
$validatorChain
->addValidator(
    new Zend\Validator\StringLength(array('min' => 6,
    'max' => 12))
)
->addValidator(new Zend\Validator\NotEmpty());

$username = '';
// Validate the username
if ($validatorChain->isValid($username)) {
    // username passed validation
} else {
    // username failed validation; print reasons
    foreach ($validatorChain->getMessages() as $message) {
        p($message);
    }
}


text:
<!DOCTYPE html>

<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet">
<link href="../css-intrinsic-dimensions/resources/height-keyword-classes.css" rel="stylesheet">
<link href="resources/grid.css" rel="stylesheet">
<link href="resources/grid-alignment.css" rel="stylesheet">

This test checks min-width|height auto does not interfere in margins computation, properly placing items inside their grid area.

Stretching allowed in both axis | column smaller than content-box, row bigger than margin-box

XXXX

Stretching allowed in both axis | column of same size than content-box, row bigger than margin-box

XXXX

Stretching allowed in both axis | column bigger than content-box, row bigger than margin-box

XXXX

Stretching allowed in both axis | column of same size as margin-box, row bigger than margin-box

XXXX

Stretching allowed in both axis | column bigger than content-box, row bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | column smaller than content-box, row bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | column of same size than content-box, row bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | column bigger than content-box, row bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | column of same size as margin-box, row bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | column bigger than content-box, row bigger than margin-box

XXXX

Stretching allowed in both axis | row smaller than content-box, column bigger than margin-box

XXXX

Stretching allowed in both axis | row of same size than content-box, column bigger than margin-box

XXXX

Stretching allowed in both axis | row bigger than content-box, column bigger column margin-box

XXXX

Stretching allowed in both axis | row of same size as margin-box, column bigger than margin-box

XXXX

Stretching allowed in both axis | row bigger than margin-box, column bigger column margin-box

XXXX

Stretching allowed in row axis, fitContent in column-axis | row smaller than content-box, column bigger than margin-box

XXXX

Stretching allowed in row axis, fitContent in column-axis | row of same size than content-box, column bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | row bigger than content-box, column bigger than margin-box

XXXX

Stretching allowed in row axis, fitContent in column-axis | row of same size as margin-box, column bigger than margin-box

XXXX

Stretching allowed in column axis, fitContent in row-axis | row bigger than margin-box, column bigger than margin-box

XXXX


text:
<?php
Class MensajesController extends AppController{
	public function index($id = null){
		if ($id) {
			$this->usuario = Load::model("usuarios")->find($id);
			$this->mensajes = Load::model("mensajes")->find("usuarios_id='".$id."'");
		}else{

			$this->mensajes = Load::model("mensajes")->find("usuarios_id='".Auth::get('id')."'");
		}
	}
	public function create(){
		if (Input::haspost("mensajes")) {
			$mensaje = Load::model("mensajes",Input::post("mensajes"));
			$mensaje->usuarios_id = Auth::get('id');
			if ($mensaje->save()) {
				Flash::valid("Mensaje Guardado");
			}else{
				Flash::error("No se agrego el mensaje");
			}
		}
	}
	public function edit($id){
		if (Input::haspost("mensajes")) {
			$mensaje = Load::model("mensajes",Input::post("mensajes"));
			$mensaje->usuarios_id = Auth::get('id');
			if ($mensaje->save()) {
				Flash::valid("Mensaje Editado");
				Router::redirect("mensajes/ver/{$mensaje->id}/$mensaje->usuarios_id");
			}else{
				Flash::error("No se actualizo el mensaje");
			}
		}
		$this->mensajes = Load::model('mensajes')->find($id);
	}
	public function ver($id,$usuario_id){
		$this->usuario = Load::model("usuarios")->find($usuario_id);
		$this->mensaje = Load::model("mensajes")->find($id);
	}
}

 ?>


text:
package vkaretko;

import org.junit.Before;
import org.junit.Test;

import java.util.Iterator;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Class TreeNodeTest for testing class TreeNode.
 *
 * @author Karetko Victor.
 * @version 1.00.
 * @since 26.12.2016.
 */
public class TreeNodeTest {
    /**
     * Tree node for tests.
     */
    private TreeNode tree;
    /**
     * First node for tests.
     */
    private TreeNode nodeOne;
    /**
     * Second node for tests.
     */
    private TreeNode nodeTwo;
    /**
     * Third node for tests.
     */
    private TreeNode nodeThree;

    /**
     * Prepare tree and nodes.
     */
    @Before
    public void prepareTree() {
        tree = new TreeNode();
        nodeOne = new TreeNode();
        nodeTwo = new TreeNode();
        nodeThree = new TreeNode();
    }

    /**
     * Method checks adding nodes to one level.
     */
    @Test
    public void whenAddNodesOnOneLevelThenResultThreeNodesInLine() {
        tree.addChild(nodeOne, "1");
        tree.addChild(nodeTwo, "2");
        tree.addChild(nodeThree, "3");
        assertThat(tree.getChildren().toString(), is("[1, 2, 3]"));
    }

    /**
     * Method checks adding nodes to different levels.
     */
    @Test
    public void whenAddNodesOnDifferentLevelsThenResultThreeNodeFromBottomToTop() {
        tree.addChild(nodeOne, "1");
        nodeOne.addChild(nodeTwo, "2");
        nodeTwo.addChild(nodeThree, "3");
        assertThat(tree.getChildren().toString(), is("[3, 2, 1]"));
    }

    /**
     * Method checks adding nodes to different levels with more nodes.
     */
    @Test
    public void whenAddNineNodesOnDifferentLevelsThenResultNineNodesFromBottomToTop() {
        tree.addChild(nodeOne, "1");
        tree.addChild(new TreeNode(), "1");
        tree.addChild(new TreeNode(), "1");
        nodeOne.addChild(nodeTwo, "2");
        nodeOne.addChild(new TreeNode(), "2");
        nodeOne.addChild(new TreeNode(), "2");
        nodeTwo.addChild(nodeThree, "3");
        nodeTwo.addChild(new TreeNode(), "3");
        nodeTwo.addChild(new TreeNode(), "3");
        assertThat(tree.getChildren().toString(), is("[3, 3, 3, 2, 2, 2, 1, 1, 1]"));
    }

    /**
     * Test for next method.
     */
    @Test
    public void whenAddTwoNodesOnDifferentLevelsThenNextFromBottomLevel() {
        tree.addChild(nodeOne, "1");
        nodeOne.addChild(nodeTwo, "2");
        Iterator iter = tree.iterator();
        assertThat(iter.next(), is("2"));
    }

    /**
     * Test for hasNext method with true result.
     */
    @Test
    public void whenAddTwoNodesThenHasNextTrue() {
        tree.addChild(nodeOne, "1");
        nodeOne.addChild(nodeTwo, "2");
        Iterator iter = tree.iterator();
        assertThat(iter.hasNext(), is(true));
    }

    /**
     * Test for hasNext method with true result.
     */
    @Test
    public void whenAddTwoNodesAndNextTwiceThenHasNextFalse() {
        tree.addChild(nodeOne, "1");
        nodeOne.addChild(nodeTwo, "2");
        Iterator iter = tree.iterator();
        iter.next();
        iter.next();
        assertThat(iter.hasNext(), is(false));
    }

    /**
     * Method checks if tree is balanced with positive result.
     */
    @Test
    public void whenAddTwoChildAndTwoSubChildToEachChildThenBalancedTree() {
        tree.addChild(nodeOne, "1");
        tree.addChild(nodeTwo, "2");
        nodeOne.addChild(new TreeNode(), "3");
        nodeOne.addChild(new TreeNode(), "4");
        nodeTwo.addChild(new TreeNode(), "5");
        nodeTwo.addChild(new TreeNode(), "6");
        assertThat(tree.isBalancedTree(), is(true));
    }

    /**
     * Method checks if tree is balanced with positive result.
     */
    @Test
    public void whenAddTwoChildAndSecondChildHasOnlyOneSubChildThenNotBalancedTree() {
        tree.addChild(nodeOne, "1");
        tree.addChild(nodeTwo, "2");
        nodeOne.addChild(new TreeNode(), "3");
        nodeOne.addChild(new TreeNode(), "4");
        nodeTwo.addChild(new TreeNode(), "6");
        assertThat(tree.isBalancedTree(), is(false));
    }

    /**
     * Method checks searchByValue method.
     */
    @Test
    public void whenSearchTwoThenResultLevelTwo() {
        tree.addChild(nodeOne, "1");
        nodeOne.addChild(nodeTwo, "2");
        assertThat(tree.searchByValue("2"), is("Element founded on level 2"));
    }

    /**
     * Method checks searchByValue method with false result.
     */
    @Test
    public void whenSearchTwoThenResultIndexOne() {
        tree.addChild(nodeOne, "1");
        nodeOne.addChild(nodeTwo, "2");
        nodeTwo.addChild(nodeThree, "3");
        assertThat(tree.searchByValue("4"), is("Element not found"));
    }

}


text:
import React from 'react'
import Link from 'gatsby-link'
import './style.css'
import logo from '../assets/logo.svg'
import featureFull from '../assets/ff.svg'
import easyToUnd from '../assets/und.svg'
import easyToSet from '../assets/set.svg'
import terminalImage from '../assets/terminal.png';

const IndexPage = () => (

SUT@Neo is a feature-full TDD framework for Node.js, Easy to make async testing. SUT@Neo allowing for flexible and accurate tdd pair programming.

      {/*
Now go build something great.
 */}

        <Link className='button' to="/docs/">Read The Docs</Link>
        <Link className='button' to="/article/getting-started">Getting Started</Link>

    {/* Section two

Easy setup

Complete and easy to set-up JavaScript testing solution. Works out of the box for any React project

Feature full

Complete and easy to set-up JavaScript testing solution. Works out of the box for any React project

Easy to setup

Complete and easy to set-up JavaScript testing solution. Works out of the box for any React project

 */}
    {/* section three */}

Beautiful & Simple

Complete and easy to set-up JavaScript testing solution.

)

export default IndexPage


text:
github-friction
===============

![GitHub Friction Screenshot](http://i.imgur.com/3lwj66Ul.png)

Check for common sources of contributor friction across your GitHub repositories.

Inspired by [Flint](https://github.com/pengwynn/flint) and [Friction](https://github.com/rafalchmiel/friction).

Uses [Github.js](https://github.com/michael/github) and [Gatekeeper](https://github.com/prose/gatekeeper).


text:
package util;

public class MathUtil {

	private MathUtil() {}

	/**
	 * Returns the direction from point (x1,y1) to point (x2,y2).
	 *
	 * @param x1
	 * @param y1
	 * @param x2
	 * @param y2
	 * @return the direction in radians
	 */
	public static double direction(double x1, double y1, double x2, double y2) {
		double xdiff = x2 - x1;
		double ydiff = y2 - y1;
		return Math.atan2(ydiff, xdiff);
	}

	/**
	 * Returns the distance between point (x1,y1) and point (x2,y2).
	 * @param x1
	 * @param y1
	 * @param x2
	 * @param y2
	 * @return the distance
	 */
	public static double distance(double x1, double y1, double x2, double y2) {
		double xdiff = x2 - x1;
		double ydiff = y2 - y1;
		return Math.sqrt(xdiff*xdiff + ydiff*ydiff);
	}

	/**
	 * Check if line (x1,y1-x2,y2) and line (x3,y3-x4,y4) intersect with each other.
	 *
	 * @param x1
	 * @param y1
	 * @param x2
	 * @param y2
	 * @param x3
	 * @param y3
	 * @param x4
	 * @param y4
	 * @return true if the two lines intersects, false otherwise
	 */
	public static boolean isIntersected(double x1, double y1,
										double x2, double y2,
										double x3, double y3,
										double x4, double y4)
	{
		return findIntersection(x1, y1, x2, y2, x3, y3, x4, y4) != null;
	}

	/**
	 * Returns the intersection (x,y) of line (x1,y1-x2,y2) and line (x3,y3-x4,y4).
	 * Returns null if the two lines don't intersect with each other.
	 *
	 * @param x1
	 * @param y1
	 * @param x2
	 * @param y2
	 * @param x3
	 * @param y3
	 * @param x4
	 * @param y4
	 * @return the coordinate of the intersection point
	 */
	public static double[] findIntersection(double x1, double y1,
											double x2, double y2,
											double x3, double y3,
											double x4, double y4)
	{
		double den = (y4 - y3)*(x2 - x1) - (x4 - x3)*(y2 - y1);
		if (den != 0) {
			double ua = ((x4 - x3)*(y1 - y3) - (y4 - y3)*(x1 - x3)) / den;
			double ub = ((x2 - x1)*(y1 - y3) - (y2 - y1)*(x1 - x3)) / den;
			if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {
				double intersection[] = new double[2];
				intersection[0] = x1 + ua*(x2 - x1); // intersection point - x
				intersection[1] = y1 + ua*(y2 - y1); // intersection point - y
				return intersection;
			}
		}
		return null;
	}

	/**
	 * Find the coordinate at a direction and distance from the point (x,y).
	 *
	 * @param x
	 * @param y
	 * @param direction in radians
	 * @param distance
	 * @return the coordinate
	 */
	public static double[] coordinate(double x, double y, double direction, double distance) {
		double coordinate[] = new double[2];
		double xoffset = distance * Math.cos(direction);
		double yoffset = distance * Math.sin(direction);
		coordinate[0] = x + xoffset;
		coordinate[1] = y + yoffset;
		return coordinate;
	}

	/**
	 * Normalize an angle to the range of [0, 180].
	 * @param angle in degrees
	 * @return the normalized angle in degrees
	 */
	public static double normalizeAngle180(double angle) {
		double theta = angle % 360;
		if (theta < 0) theta += 360;
		if (theta > 180) theta = 360 - theta;
		return theta;
	}

}


text:
namespace PetFinder.Web.Infrastructure.Filters
{
    using System.Web.Mvc;

    public class AjaxOnlyAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (!(filterContext.HttpContext.Request.IsAjaxRequest()))
            {
                filterContext.Result = new HttpNotFoundResult();
            }
        }
    }
}


text:
<!DOCTYPE html>

        <title>Kanban</title>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <base href="/"/>
        <link rel="icon" type="image/x-icon" href="/kyt.ico">
        <link rel="stylesheet" type="text/css" href="styles/normalize.css"/>
        <link rel="stylesheet" type="text/css" href="styles/bootstrap.css"/>
        <link rel="stylesheet" type="text/css" href="webjars/ng-sortable/1.1.9/ng-sortable.min.css"/>
        <link rel="stylesheet" type="text/css" href="webjars/angular-xeditable/0.1.9/css/xeditable.css">
        <link rel="stylesheet" type="text/css" href="webjars/fullcalendar/2.4.0/fullcalendar.min.css"/>
        <link rel="stylesheet" type="text/css" href="webjars/angular-growl-2/0.7.3/angular-growl.min.css">
        <link rel="stylesheet" type="text/css" href="webjars/ngImgCrop/0.3.2/compile/minified/ng-img-crop.css">
        <link rel="stylesheet" type="text/css" href="webjars/angular-ui-tree/2.13.0/angular-ui-tree.min.css">
        <link rel="stylesheet" type="text/css" href="scripts/lib/angular-gantt/angular-gantt.min.css">
        <link rel="stylesheet" type="text/css" href="scripts/lib/angular-gantt/angular-gantt-plugins.min.css">
        <link rel='stylesheet' type="text/css" href='webjars/font-awesome/4.7.0/css/font-awesome.css'>
        <link rel='stylesheet' type="text/css" href='webjars/textAngular/1.5.0/dist/textAngular.css'>
        <link rel="stylesheet" type="text/css" href="styles/app.css"/>
        <link rel="stylesheet" type="text/css" href="styles/dev.css"/>


text:
<?php

declare(strict_types=1);

namespace Skimpy\File;

class InvalidContentFile extends \RuntimeException
{
}


text: google-site-verification: googleda7a5fa4f99c8ef3.html


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="author" content="Emanuel Eichhammer" />
<meta name="copyright" content="(C) 2013-2015 Emanuel Eichhammer" />
<title>Data Fields</title>
<link href="qt.css" rel="stylesheet" type="text/css"/>

Main Page ·
Class Overview ·
Hierarchy ·
All Classes ·
Special Pages

Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

- v -

validRange()
: QCPRange

viewport()
: QCustomPlot

visibleTickBounds()
: QCPAxis


text:
#ifndef __TARGET_H__
#define __TARGET_H__

#define TG_COMM_TIMEOUT_MS 512
#define MAX_TARGET_LOOP_TIMES 16

enum target_res { TGT_COMPLETE, TGT_TIMEOUT, TGT_ERROR, TGT_RETRY };

// Switch into target mode and respond to Felica or ISO 18092 requests
enum target_res target(char* label);

#endif /* !__TARGET_H__ */


text:
layout: page
title: Farley Holdings Party
date: 2016-05-24
author: Gerald Vang
tags: weekly links, java
status: published
summary: Suspendisse mollis aliquam mauris in tincidunt. Quisque.
banner: images/banner/leisure-01.jpg
booking:
  startDate: 11/05/2019
  endDate: 11/09/2019
  ctyhocn: STLDTHX
  groupCode: FHP
published: true
---
Fusce in semper leo. Maecenas neque metus, cursus eget tortor nec, pulvinar lobortis quam. In sed bibendum dui, vel eleifend nulla. Suspendisse potenti. Nullam laoreet feugiat nisi, in rutrum dui fringilla eu. Vivamus eu condimentum augue. Duis a tellus laoreet, scelerisque ipsum ut, consequat elit. Vivamus eget elit quam. Vestibulum dignissim finibus sagittis. Phasellus mollis justo vitae neque mollis, ut faucibus nulla pretium. Phasellus nisi urna, pellentesque vitae urna vitae, fringilla lobortis justo. Nam tempor nec lorem et tempus. Proin sit amet nunc quam.

* Vestibulum ac elit vehicula libero gravida lacinia id a orci
* In maximus diam eu dui convallis aliquam
* Etiam volutpat massa sed suscipit tempus
* Donec volutpat ex quis ante dictum, aliquet aliquam lectus ornare
* Vestibulum ornare elit eu massa dictum fringilla.

Nulla non blandit sapien, vitae facilisis nunc. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum tortor velit, sagittis eget aliquam quis, dapibus ut tellus. Phasellus odio turpis, tristique vitae nibh id, fringilla facilisis eros. Pellentesque ultrices sem vel erat tristique ornare. Vivamus vehicula facilisis lorem eget pulvinar. Vestibulum venenatis auctor sapien, eu dictum est fermentum eu. Maecenas eget diam pharetra lacus tristique faucibus. Sed dignissim, sem vitae vehicula varius, enim leo viverra est, in aliquam neque ante sit amet elit. In id velit urna. Mauris efficitur sagittis ante, nec egestas est.


text:
#include <aws/ssm/model/PlatformType.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

using namespace Aws::Utils;

namespace Aws
{
  namespace SSM
  {
    namespace Model
    {
      namespace PlatformTypeMapper
      {

        static const int Windows_HASH = HashingUtils::HashString("Windows");
        static const int Linux_HASH = HashingUtils::HashString("Linux");

        PlatformType GetPlatformTypeForName(const Aws::String& name)
        {
          int hashCode = HashingUtils::HashString(name.c_str());
          if (hashCode == Windows_HASH)
          {
            return PlatformType::Windows;
          }
          else if (hashCode == Linux_HASH)
          {
            return PlatformType::Linux;
          }
          EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
          if(overflowContainer)
          {
            overflowContainer->StoreOverflow(hashCode, name);
            return static_cast<PlatformType>(hashCode);
          }

          return PlatformType::NOT_SET;
        }

        Aws::String GetNameForPlatformType(PlatformType enumValue)
        {
          switch(enumValue)
          {
          case PlatformType::Windows:
            return "Windows";
          case PlatformType::Linux:
            return "Linux";
          default:
            EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
            if(overflowContainer)
            {
              return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
            }

            return {};
          }
        }

      } // namespace PlatformTypeMapper
    } // namespace Model
  } // namespace SSM
} // namespace Aws