text:
namespace {

// The net module doesn't have access to this HTML or the strings that need to
// be localized.  The Chrome locale will never change while we're running, so
// it's safe to have a static string that we always return a pointer into.
// This allows us to have the ResourceProvider return a pointer into the actual
// resource (via a StringPiece), instead of always copying resources.
struct LazyDirectoryListerCacher {
  LazyDirectoryListerCacher() {
    DictionaryValue value;
    value.SetString(L"header",
                    l10n_util::GetString(IDS_DIRECTORY_LISTING_HEADER));
    value.SetString(L"parentDirText",
                    l10n_util::GetString(IDS_DIRECTORY_LISTING_PARENT));
    value.SetString(L"headerName",
                    l10n_util::GetString(IDS_DIRECTORY_LISTING_NAME));
    value.SetString(L"headerSize",
                    l10n_util::GetString(IDS_DIRECTORY_LISTING_SIZE));
    value.SetString(L"headerDateModified",
                    l10n_util::GetString(IDS_DIRECTORY_LISTING_DATE_MODIFIED));
    html_data = jstemplate_builder::GetI18nTemplateHtml(
        ResourceBundle::GetSharedInstance().GetRawDataResource(
            IDR_DIR_HEADER_HTML),
        &value);
  }

  std::string html_data;
};

}  // namespace

namespace chrome_common_net {

base::StringPiece NetResourceProvider(int key) {
  static LazyDirectoryListerCacher lazy_dir_lister;

  if (IDR_DIR_HEADER_HTML == key)
    return base::StringPiece(lazy_dir_lister.html_data);

  return ResourceBundle::GetSharedInstance().GetRawDataResource(key);
}

}  // namespace chrome_common_net


text:
package com.itachi1706.droideggs.s_egg.easter_egg.widget;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.ComponentName;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.util.Log;
import android.widget.Toast;

/**
 * Launched from the PlatLogoActivity. Enables everything else in this easter egg.
 */
@TargetApi(Build.VERSION_CODES.Q)
public class WidgetActivationActivity extends Activity {
    private static final String TAG = "EasterEgg";

    private static final String S_EGG_UNLOCK_SETTING = "egg_mode_s";

    @Override
    public void onStart() {
        super.onStart();

        final PackageManager pm = getPackageManager();
        final ComponentName[] cns = new ComponentName[] {
                new ComponentName(this, PaintChipsActivity.class),
                new ComponentName(this, PaintChipsWidget.class)
        };
        SharedPreferences sp = this.getSharedPreferences("com.itachi1706.droideggs_preferences", MODE_MULTI_PROCESS);
        final long unlockValue = sp.getLong(S_EGG_UNLOCK_SETTING, 0);
        for (ComponentName cn : cns) {
            final boolean componentEnabled = pm.getComponentEnabledSetting(cn)
                    == PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
            if (unlockValue == 0) {
                if (componentEnabled) {
                    Log.v(TAG, "Disabling component: " + cn);
                    pm.setComponentEnabledSetting(cn,
                            PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                            PackageManager.DONT_KILL_APP);
                } else {
                    Log.v(TAG, "Already disabled: " + cn);
                }
            } else {
                if (!componentEnabled) {
                    Log.v(TAG, "Enabling component: " + cn);
                    pm.setComponentEnabledSetting(cn,
                            PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                            PackageManager.DONT_KILL_APP);
                } else {
                    Log.v(TAG, "Already enabled: " + cn);
                }
            }
        }

        finish();
    }
}

redpajama_set_name: RedPajamaGithub


text:
#region License

#endregion

using System;

namespace Spring.Objects.Factory.Support
{
    /// <summary>
    /// Convenience implementation of the <see cref="IFactoryObject"/> interface that
    /// delegates to an arbitrary object + method to perform the object construction.
    /// </summary>
    /// <remarks>
    /// <para>
    /// Because this <see cref="IFactoryObject"/> implementation requires a delegate
    /// passed to its ctor, its only possible to configure this object and register
    /// it with the <see cref="IObjectFactory"/> via code rather than via XML.
    /// </para>
    /// </remarks>
    /// <typeparam name="T"></typeparam>
    public class DelegateInvokingFactoryObject<T> : IFactoryObject
    {
        private readonly bool _isSingleton;
        private readonly Func<T> _builderDelegate;

        /// <summary>
        /// Initializes a new instance of the <see cref="DelegateInvokingFactoryObject{T}"/> class.
        /// </summary>
        /// <param name="builderDelegate">The builder delegate.</param>
        /// <param name="isSingleton">if set to <c>true</c> [is singleton].</param>
        public DelegateInvokingFactoryObject(Func<T> builderDelegate, bool isSingleton)
        {
            _builderDelegate = builderDelegate;
            _isSingleton = isSingleton;
        }

        /// <summary>
        /// Return an instance (possibly shared or independent) of the object
        ///             managed by this factory.
        /// </summary>
        /// <remarks>
        /// <note type="caution">If this method is being called in the context of an enclosing IoC container and
        ///             returns <see langword="null"/>, the IoC container will consider this factory
        ///             object as not being fully initialized and throw a corresponding (and most
        ///             probably fatal) exception.
        ///             </note>
        /// </remarks>
        /// <returns>
        /// An instance (possibly shared or independent) of the object managed by
        ///             this factory.
        /// </returns>
        public object GetObject()
        {
            return _builderDelegate.Invoke();
        }

        /// <summary>
        /// Return the <see cref="T:System.Type"/> of object that this
        ///             <see cref="T:Spring.Objects.Factory.IFactoryObject"/> creates, or
        ///             <see langword="null"/> if not known in advance.
        /// </summary>
        public Type ObjectType
        {
            get { return typeof(T); }
        }

        /// <summary>
        /// Is the object managed by this factory a singleton or a prototype?
        /// </summary>
        public bool IsSingleton
        {
            get { return _isSingleton; }
        }
    }
}


text:
var marked = require('marked');
console.log(marked('I am *using*'+' __markdown__.'));


text:
id: version-classic-conversion-scripts
title: Conversion Scripts
original_id: conversion-scripts
---

We built a few scripts to help you with the conversion process. Check them out at https://github.com/relayjs/relay-codemod.


text:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using TwitterWebApplicationDBContexts;

namespace TwitterWebApplication
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Return only json
            // http://stackoverflow.com/questions/12641386/failed-to-serialize-the-response-in-web-api
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);

#if DEBUG
            ServicePointManager.ServerCertificateValidationCallback = delegate
            {
                return true;
            };
#endif

        }
    }
}


text:
package com.taobao.tddl.rule;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.exception.ExceptionUtils;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.google.common.collect.Lists;
import com.taobao.tddl.common.exception.TddlException;
import com.taobao.tddl.rule.exception.RouteCompareDiffException;
import com.taobao.tddl.rule.model.MatcherResult;
import com.taobao.tddl.rule.model.TargetDB;
import com.taobao.tddl.rule.utils.ComparativeStringAnalyser;

public class RemoteRuleIntegration extends BaseRuleTest {

    static TddlRule rule;

    @BeforeClass
    public static void setUp() {
        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:remote/spring-context.xml");
        rule = (TddlRule) context.getBean("rule");
    }

    @AfterClass
    public static void tearDown() throws TddlException {
        rule.destroy();
    }

    @Test
    public void testTddlRuleMuRulesAndCompare_Select() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String conditionStr = "message_id >=25:int and message_id<=26:int;gmt_create>=" + sdf.format(new Date())
                              + ":date";

        try {
            List<TargetDB> db = null;
            MatcherResult result = rule.routeMverAndCompare(true,
                "nserch",
                new Choicer(ComparativeStringAnalyser.decodeComparativeString2Map(conditionStr)),
                Lists.newArrayList());
            db = result.getCalculationResult();
            for (TargetDB targetDatabase : db) {
                StringBuilder sb = new StringBuilder("目标库:");
                sb.append(targetDatabase.getDbIndex());
                sb.append(" 所要执行的表:");
                for (String table : targetDatabase.getTableNames()) {
                    sb.append(table);
                    sb.append(" ");
                }
                System.out.println(sb.toString());
            }
        } catch (RouteCompareDiffException e) {
            Assert.fail(ExceptionUtils.getFullStackTrace(e));
        }

    }

    @Test
    public void testTddlRuleMuRulesAndCompare_Insert() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String conditionStr = "message_id >=25:int and message_id<=26:int;gmt_create>=" + sdf.format(new Date())
                              + ":date";

        try {
            List<TargetDB> db = null;
            MatcherResult result = rule.routeMverAndCompare(true,
                "nserch",
                new Choicer(ComparativeStringAnalyser.decodeComparativeString2Map(conditionStr)),
                Lists.newArrayList());
            db = result.getCalculationResult();
            for (TargetDB targetDatabase : db) {
                StringBuilder sb = new StringBuilder("目标库:");
                sb.append(targetDatabase.getDbIndex());
                sb.append(" 所要执行的表:");
                for (String table : targetDatabase.getTableNames()) {
                    sb.append(table);
                    sb.append(" ");
                }
                System.out.println(sb.toString());
            }
        } catch (RouteCompareDiffException e) {
            Assert.fail(ExceptionUtils.getFullStackTrace(e));
        }
    }
}


text:
Client for Cloud Video Intelligence API
=======================================

.. automodule:: google.cloud.videointelligence_v1
    :members:
    :inherited-members:


text:
package proguard.classfile.constant.visitor;

import proguard.classfile.*;
import proguard.classfile.visitor.ClassVisitor;

/**
 * This ClassVisitor lets a given ConstantVisitor visit all constant pool
 * entries of the program classes it visits.
 *
 * @author Eric Lafortune
 */
public class AllConstantVisitor implements ClassVisitor
{
    private final ConstantVisitor constantVisitor;

    public AllConstantVisitor(ConstantVisitor constantVisitor)
    {
        this.constantVisitor = constantVisitor;
    }

    // Implementations for ClassVisitor.

    public void visitProgramClass(ProgramClass programClass)
    {
        programClass.constantPoolEntriesAccept(constantVisitor);
    }

    public void visitLibraryClass(LibraryClass libraryClass) {}
}


text:
Getting started with ComposerScriptUtils
========================================

This library provides a micro-framework for building and configuring your own Composer scripts
that rely on Composer event callbacks.

The purpose of this library is to create a good, unified way to write Composer scripts instead
of having to maintain a fragmented range of different implementations for each of your scripts
within each of your codebases.

Prerequisites
-------------

This library is stand-alone and depends on nothing else except Composer and at least PHP 5.5.*

Installation
------------

Install library with Composer
_____________________________

First you have to install it using Composer:

.. code-block:: bash

    $ composer require habu/composer-script-utils

Writing your first command
--------------------------

Let's run through creating your first command.

Creating your script configuration
__________________________________

It's recommended to always store your script's configuration inside the 'extra' node within
your ``composer.json``. The configuration management utility supports both root-level configuration
and multi-dimensional/nested configuration.

Root/single-level configuration would look like this:

.. code-block:: json
  // composer.json
  ...
  "extra": {
    "habu-script-example": "my configuration value"
  }
  ...

You will need to create your script configuration as a static definition that inherits
upon our abstract configuration class:

.. code-block:: php

    <?php

    // Configuration.php

    namespace Habu\ComposerScriptExample;

    use Habu\ComposerScriptUtils\Configuration\AbstractConfiguration;
    use Habu\ComposerScriptUtils\Configuration\Handler\Required;

    class Configuration extends AbstractConfiguration
    {
        public function getConfigurationDefaults()
        {
            return [
                'habu-script-example' => new Required()
            ];
        }
    }

And here's how you would express nested/multi-dimensional configuration:

.. code-block:: json

  ...
  "extra": {
    "habu-script-example": {
        "name": "Ruben"
    }
  }
  ...

With of our definition looking like this:

.. code-block:: php

    <?php

    // Configuration.php

    namespace Habu\ComposerScriptExample;

    use Habu\ComposerScriptUtils\Configuration\AbstractConfiguration;
    use Habu\ComposerScriptUtils\Configuration\Handler\Required;

    class Configuration extends AbstractConfiguration
    {
        public function getConfigurationDefaults()
        {
            return [
                'habu-script-example' => [
                    'name' => new Required()
                ]
            ];
        }
    }

In this example we use the ``Required`` handler, but there is more than one handler available
which we will touch upon later.

Creating your processor script
______________________________

Now that we have a configuration definition, let's write ourselves a processor that will
simply write to the screen one of the configuration values we've defined above.

You will need to create a processor class that inherits upon the abstract processor class
that ships with this library:

.. code-block:: php

    <?php

    // Processor.php

    namespace Habu\ComposerScriptExample;

    use Habu\ComposerScriptUtils\Interfaces\ConfigurationInterface;
    use Habu\ComposerScriptUtils\Processor\AbstractProcessor;

    class Processor extends AbstractProcessor
    {
        public function process(ConfigurationInterface $configuration)
        {
            $this->getIO()->write(sprintf('Hello %s!', $configuration->get('habu-script-example.name')));
        }
    }

Each processor class requires you to implement a ``process`` method that accepts a configuration
as a parameter.

This example assumes your script will do one thing, and therefore the processor is just called
``Processor``. In the `Examples <examples.rst>`_ page you will find some examples of how to structure
multi-command processors.

Creating your script entrypoint
_______________________________

Each script requires an executable entrypoint that Composer will pass the event into. Even if you're
bundling multiple commands into the same project/library, the convention is to call this ``ScriptHandler``.

Inside your ScriptHandler you instantiate your Configuration and Processor classes:

.. code-block:: php

    <?php

    // ScriptHandler.php

    namespace Habu\ComposerScriptExample;

    use Composer\Script\Event;

    class ScriptHandler
    {
        public static function helloExample(Event $event)
        {
            $extra = $event->getComposer()->getPackage()->getExtra();
            $configuration = new Configuration($extra);
            $processor = new Processor($event->getIO(), $event->getComposer());

            $processor->process($configuration, $event);
        }
    }

In the example above we retrieve the 'extra' node's value (array) from our ``composer.json``, and pass it
into our configuration definition.

Configuring your script to run
______________________________

Once you have a configuration definition, a processor and an entrypoint, we can configure our project
to be able to run your script through the composer command.

You can define it as a separate executable script command in your ``composer.json``:

.. code-block:: json

  ...
  "scripts": {
    "example-command": "Habu\\ComposerScriptExample\\ScriptHandler::helloExample",
  }
  ...

If expressed like this in your composer.json, it's executable like this:

.. code-block:: bash

    $ composer example-command
    > Habu\ComposerScriptExample\ScriptHandler::helloExample
    Event: example-command
    Hello Ruben!

Or you may want your command to run each time ``composer install`` or ``composer update`` is ran:

.. code-block:: json

  ...
  "scripts": {
    "example-command": "Habu\\ComposerScriptExample\\ScriptHandler::helloExample",
    "post-install-cmd": [
      "@example-command"
    ],
    "post-update-cmd": [
      "@example-command"
    ]
  },
  ...

Which will run your command each time either of those commands are executed:

.. code-block:: bash

    $ composer install
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Nothing to install or update
    Generating autoload files
    > Habu\ComposerScriptExample\ScriptHandler::helloExample
    Hello Ruben!

Examples
--------

This library ships with a few examples on how to structure your Composer commands with
the help of this library. Consult the `Examples <examples.rst>`_ documentation page to find out
which examples there are and what purpose they serve.

Handlers
--------

This library ships with several configuration handlers. Check out the `Handlers <handlers.rst>`_
chapter to see which ones there are and how they work.


text:
@implementation FRTranslateArrayResultParsingDelegate

@synthesize parsing;
@synthesize nextCharsAreTranslation;
@synthesize translations;

- (void)parserDidStartDocument:(NSXMLParser *)parser {
	NSLog(@"Starting parse...");
	translations = [[NSMutableArray alloc] init];
	parsing = YES;
}

- (void)parserDidEndDocument:(NSXMLParser *)parser {
	NSLog(@"Ending parse...");
	NSLog(@"Translations: %@", translations);
	parsing = NO;
}

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI
 qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict {
	if ([elementName isEqualToString:@"TranslatedText"]) { nextCharsAreTranslation = YES; }
}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
	if (nextCharsAreTranslation) {
		[translations addObject:string];
		nextCharsAreTranslation = NO;
	}
}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<PRONOM-Report xmlns="http://pronom.nationalarchives.gov.uk">
  <report_format_detail>
    <FileFormat>
      <FormatID>1311</FormatID>
      <FormatName>Microsoft Office Theme</FormatName>
      <FormatVersion>
      </FormatVersion>
      <FormatAliases>
      </FormatAliases>
      <FormatFamilies>
      </FormatFamilies>
      <FormatTypes>
      </FormatTypes>
      <FormatDisclosure>
      </FormatDisclosure>
      <FormatDescription>This is an outline record only, and requires further details, research or authentication to provide information that will enable users to further understand the format and to assess digital preservation risks associated with it if appropriate. If you are able to help by supplying any additional information concerning this entry, please return to the main PRONOM page and select 'Add an Entry'.</FormatDescription>
      <BinaryFileFormat>
      </BinaryFileFormat>
      <ByteOrders>
      </ByteOrders>
      <ReleaseDate>
      </ReleaseDate>
      <WithdrawnDate>
      </WithdrawnDate>
      <ProvenanceSourceID>1</ProvenanceSourceID>
      <ProvenanceName>Digital Preservation Department / The National Archives</ProvenanceName>
      <ProvenanceSourceDate>01 May 2013</ProvenanceSourceDate>
      <ProvenanceDescription>This format can be identified via a container signature in DROID version 6 or later. The PRONOM database cannot currently represent container signatures.</ProvenanceDescription>
      <LastUpdatedDate>01 May 2013</LastUpdatedDate>
      <FormatNote>
      </FormatNote>
      <FormatRisk>
      </FormatRisk>
      <TechnicalEnvironment>
      </TechnicalEnvironment>
      <FileFormatIdentifier>
        <Identifier>application/vnd.ms-officetheme</Identifier>
        <IdentifierType>MIME</IdentifierType>
      </FileFormatIdentifier>
      <FileFormatIdentifier>
        <Identifier>fmt/524</Identifier>
        <IdentifierType>PUID</IdentifierType>
      </FileFormatIdentifier>
      <Developers>
        <DeveloperID>93</DeveloperID>
        <DeveloperName>
        </DeveloperName>
        <OrganisationName>Microsoft Corporation</OrganisationName>
        <DeveloperCompoundName>Microsoft Corporation</DeveloperCompoundName>
      </Developers>
      <Support>
        <SupportID>93</SupportID>
        <SupportName>
        </SupportName>
        <OrganisationName>Microsoft Corporation</OrganisationName>
        <SupportCompoundName>Microsoft Corporation</SupportCompoundName>
      </Support>
      <ExternalSignature>
        <ExternalSignatureID>1341</ExternalSignatureID>
        <Signature>thmx</Signature>
        <SignatureType>File extension</SignatureType>
      </ExternalSignature>
      <RelatedFormat>
        <RelationshipType>Has priority over</RelationshipType>
        <RelatedFormatID>941</RelatedFormatID>
        <RelatedFormatName>Microsoft Powerpoint for Windows</RelatedFormatName>
        <RelatedFormatVersion>2007 onwards</RelatedFormatVersion>
      </RelatedFormat>
    </FileFormat>
    <SearchCriteria>Criteria</SearchCriteria>
  </report_format_detail>
</PRONOM-Report>


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html -->
<!-- + parts of Eclipse Runnable JAR Export Wizard -->

<project name="lib-myshows" basedir="." default="jar">
  <!-- directories -->
  <property name="src.dir" value="src" />
  <property name="doc.dir" value="doc" />
  <property name="lib.dir" value="libs" />
  <property name="build.dir" value="build" />
  <property name="classes.dir" value="${build.dir}/classes" />
  <property name="jar.dir" value="${build.dir}/jar" />

  <!-- executable class -->
  <!-- <property name="main-class" value="Main" /> -->

  <!-- versioning -->
  <property name="author.info" value="Ilya Arefiev (arefiev.id@gmail.com)" />
  <property name="version.num" value="0.2" />
  <buildnumber file=".build.num" />
  <tstamp>
	<format property="TODAY" pattern="yyyyMMdd:HHmmss" />
	<format property="TODAY.YEAR" pattern="yyyy" />
  </tstamp>
  <property name="version.impl" value="${build.number}"/>

  <!-- release destination -->
  <property name="release.dir" value="${ant.project.name}-${version.num}" />

  <!-- libraries path -->
  <path id="classpath">
	<fileset dir="${lib.dir}" includes="***.jar" />
	</copy>
  </target>

</project>


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('projects', '0088_merge_20190208_1523'),
        ('projects', '0088_merge_20190215_1425'),
    ]

    operations = [
    ]


text:
/**
 * Created by Mohamed on 02/04/14.
 */

exports.holamundo = function(req, res){
    res.render('holamundo', { title: 'Hola Mundo !!' });
};


text:
package eu.scape_project.pw.ui.graph;

import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TreeItem;

import eu.scape_project.pw.ui.graph.components.MeasureContentProvider;
import eu.scape_project.pw.ui.graph.components.MeasureLabelProvider;
import eu.scape_project.pw.ui.graph.components.MeasureTreeGenerator;
import eu.scape_project.pw.ui.graph.model.INode;
import eu.scape_project.pw.ui.graph.model.Measure;

public class GraphComposite extends Composite {

	private Combo dropDown;

	private Label label;

	private ChartCanvas chartCanvas;

	private ChartLoader cLoader;

	private TreeViewer viewer;

	private MeasureTreeGenerator generator;

	public GraphComposite(Composite parent, int style) {
		super(parent, style);
		GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		this.setLayout(gridLayout);
		cLoader = new ChartLoader();
		generator = new MeasureTreeGenerator();
		// dropDown = new Combo(this, SWT.DROP_DOWN);
		// fillDropDown();
		viewer = new TreeViewer(this, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
		viewer.setContentProvider(new MeasureContentProvider());
		viewer.setLabelProvider(new MeasureLabelProvider());
		viewer.setInput(generator.getMeasureTree());
		viewer.getTree().setLayoutData(new GridData(200, 500));
		chartCanvas = new ChartCanvas(this, SWT.NONE);
		chartCanvas.setLayoutData(new GridData(800, 500));
		chartCanvas.setChart(cLoader.getChart());
		Button button = new Button(this, SWT.PUSH);
		button.setText("Refresh");
		GridData gridDataButton = new GridData();
		gridDataButton.horizontalAlignment = GridData.FILL;
		GridData gridDataLabel = new GridData();
		gridDataLabel.horizontalAlignment = GridData.FILL;
		//gridData.horizontalSpan = 2;
		label = new Label(this, 0);
		label.setText("");
		label.setLayoutData(gridDataLabel);
		viewer.getTree().addSelectionListener(new SelectionListener() {

			public void widgetSelected(SelectionEvent e) {
				IStructuredSelection s = (IStructuredSelection) viewer
						.getSelection();
				INode node = (INode) s.getFirstElement();

				if (node instanceof Measure) {
					TreeItem ti = (TreeItem) e.item;
					//ti.setBackground(0, Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
					if (cLoader.addRemoveMeasure((Measure) node)) {
						chartCanvas.setChart(cLoader.getChart());
						chartCanvas.redraw();
						label.setText("");
					}else {
						label.setText("Measures don't match - unable to add measure to graph");
						label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
					}
					layout();

				}
			}

			public void widgetDefaultSelected(SelectionEvent e) {

			}

		});
		button.addSelectionListener(new SelectionListener() {

			public void widgetSelected(SelectionEvent e) {
				System.out.println("CLCIK");
				cLoader.reset();
				chartCanvas.setChart(cLoader.getChart());
				chartCanvas.redraw();
				viewer.setInput(generator.getMeasureTree());
				layout();
			}

			public void widgetDefaultSelected(SelectionEvent e) {
				// TODO Auto-generated method stub
			}
		    });
	}

	private void fillDropDown() {
		IProject project = ResourcesPlugin.getWorkspace().getRoot()
				.getProject("Simulation");
		IFolder output = project.getFolder("output");
		try {
			for (IResource s : output.members()) {
				dropDown.add(s.getName());
			}
		} catch (CoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}


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

package com.google.caja.plugin;

/**
 * Explains the effect that allowing a URI to load has.
 *
 * @see UriPolicy
 * @author Mike Samuel <mikesamuel@gmail.com>
 */
public enum UriEffect {
  /** Describes a URI that is not loaded.  E.g. {@code <base href>}. */
  NOT_LOADED,
  /**
   * Describes a URI that is automatically loaded into the current document's
   * origin.
   * E.g. {@code <img src>}.
   */
  SAME_DOCUMENT,
  /**
   * Describes a URI that is loaded on user interaction, replacing the current
   * document with a new document, and that is loaded into the origin implied
   * in the URI.
   * This may or may not unload the current document.
   */
  NEW_DOCUMENT,
  ;
}


text:
<?php

namespace app\controllers;

use Yii;
use yii\web\AccessControl;
use app\models\Lang;
use app\models\search\LangSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\web\VerbFilter;

/**
 * LangController implements the CRUD actions for Lang model.
 */
class LangController extends Controller
{
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => false,
                        'roles' => ['?'],
                    ],
                    [
                        'allow' => true,
                        'actions' => ['index', 'view', 'create', 'update'],
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all Lang models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new LangSearch;
        $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());

        return $this->render('index', [
            'dataProvider' => $dataProvider,
            'searchModel' => $searchModel,
        ]);
    }

    /**
     * Displays a single Lang model.
     * @param string $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new Lang model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Lang;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing Lang model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param string $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing Lang model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param string $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Lang model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param string $id
     * @return Lang the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Lang::find($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
module ToolbarsHelper
end


text:
namespace sandbox {

TopLevelDispatcher::TopLevelDispatcher(PolicyBase* policy) : policy_(policy) {
  // Initialize the IPC dispatcher array.
  memset(ipc_targets_, 0, sizeof(ipc_targets_));
  Dispatcher* dispatcher;

  dispatcher = new FilesystemDispatcher(policy_);
  ipc_targets_[IPC_NTCREATEFILE_TAG] = dispatcher;
  ipc_targets_[IPC_NTOPENFILE_TAG] = dispatcher;
  ipc_targets_[IPC_NTSETINFO_RENAME_TAG] = dispatcher;
  ipc_targets_[IPC_NTQUERYATTRIBUTESFILE_TAG] = dispatcher;
  ipc_targets_[IPC_NTQUERYFULLATTRIBUTESFILE_TAG] = dispatcher;
  filesystem_dispatcher_.reset(dispatcher);

  dispatcher = new NamedPipeDispatcher(policy_);
  ipc_targets_[IPC_CREATENAMEDPIPEW_TAG] = dispatcher;
  named_pipe_dispatcher_.reset(dispatcher);

  dispatcher = new ThreadProcessDispatcher(policy_);
  ipc_targets_[IPC_NTOPENTHREAD_TAG] = dispatcher;
  ipc_targets_[IPC_NTOPENPROCESS_TAG] = dispatcher;
  ipc_targets_[IPC_CREATEPROCESSW_TAG] = dispatcher;
  ipc_targets_[IPC_NTOPENPROCESSTOKEN_TAG] = dispatcher;
  ipc_targets_[IPC_NTOPENPROCESSTOKENEX_TAG] = dispatcher;
  ipc_targets_[IPC_CREATETHREAD_TAG] = dispatcher;
  thread_process_dispatcher_.reset(dispatcher);

  dispatcher = new SyncDispatcher(policy_);
  ipc_targets_[IPC_CREATEEVENT_TAG] = dispatcher;
  ipc_targets_[IPC_OPENEVENT_TAG] = dispatcher;
  sync_dispatcher_.reset(dispatcher);

  dispatcher = new RegistryDispatcher(policy_);
  ipc_targets_[IPC_NTCREATEKEY_TAG] = dispatcher;
  ipc_targets_[IPC_NTOPENKEY_TAG] = dispatcher;
  registry_dispatcher_.reset(dispatcher);

  dispatcher = new HandleDispatcher(policy_);
  ipc_targets_[IPC_DUPLICATEHANDLEPROXY_TAG] = dispatcher;
  handle_dispatcher_.reset(dispatcher);

  dispatcher = new ProcessMitigationsWin32KDispatcher(policy_);
  ipc_targets_[IPC_GDI_GDIDLLINITIALIZE_TAG] = dispatcher;
  ipc_targets_[IPC_GDI_GETSTOCKOBJECT_TAG] = dispatcher;
  ipc_targets_[IPC_USER_REGISTERCLASSW_TAG] = dispatcher;
  process_mitigations_win32k_dispatcher_.reset(dispatcher);
}

TopLevelDispatcher::~TopLevelDispatcher() {}

// When an IPC is ready in any of the targets we get called. We manage an array
// of IPC dispatchers which are keyed on the IPC tag so we normally delegate
// to the appropriate dispatcher unless we can handle the IPC call ourselves.
Dispatcher* TopLevelDispatcher::OnMessageReady(IPCParams* ipc,
                                               CallbackGeneric* callback) {
  DCHECK(callback);
  static const IPCParams ping1 = {IPC_PING1_TAG, {UINT32_TYPE}};
  static const IPCParams ping2 = {IPC_PING2_TAG, {INOUTPTR_TYPE}};

  if (ping1.Matches(ipc) || ping2.Matches(ipc)) {
    *callback = reinterpret_cast<CallbackGeneric>(
        static_cast<Callback1>(&TopLevelDispatcher::Ping));
    return this;
  }

  Dispatcher* dispatcher = GetDispatcher(ipc->ipc_tag);
  if (!dispatcher) {
    NOTREACHED();
    return NULL;
  }
  return dispatcher->OnMessageReady(ipc, callback);
}

// Delegate to the appropriate dispatcher.
bool TopLevelDispatcher::SetupService(InterceptionManager* manager,
                                      int service) {
  if (IPC_PING1_TAG == service || IPC_PING2_TAG == service)
    return true;

  Dispatcher* dispatcher = GetDispatcher(service);
  if (!dispatcher) {
    NOTREACHED();
    return false;
  }
  return dispatcher->SetupService(manager, service);
}

// We service IPC_PING_TAG message which is a way to test a round trip of the
// IPC subsystem. We receive a integer cookie and we are expected to return the
// cookie times two (or three) and the current tick count.
bool TopLevelDispatcher::Ping(IPCInfo* ipc, void* arg1) {
  switch (ipc->ipc_tag) {
    case IPC_PING1_TAG: {
      IPCInt ipc_int(arg1);
      uint32_t cookie = ipc_int.As32Bit();
      ipc->return_info.extended_count = 2;
      ipc->return_info.extended[0].unsigned_int = ::GetTickCount();
      ipc->return_info.extended[1].unsigned_int = 2 * cookie;
      return true;
    }
    case IPC_PING2_TAG: {
      CountedBuffer* io_buffer = reinterpret_cast<CountedBuffer*>(arg1);
      if (sizeof(uint32_t) != io_buffer->Size())
        return false;

      uint32_t* cookie = reinterpret_cast<uint32_t*>(io_buffer->Buffer());
      *cookie = (*cookie) * 3;
      return true;
    }
    default:
      return false;
  }
}

Dispatcher* TopLevelDispatcher::GetDispatcher(int ipc_tag) {
  if (ipc_tag >= IPC_LAST_TAG || ipc_tag <= IPC_UNUSED_TAG)
    return NULL;

  return ipc_targets_[ipc_tag];
}

}  // namespace sandbox


text:
<?php

namespace ArachnophoBee\ApiSnapshot\ComparatorOld\Analysis;

use Komin\Notation\String\MiniMl\Tool\MiniMlTool;

/**
 * Analysis
 * @author Lingtalfi
 * 2015-05-01
 *
 */
class Analysis
{

    protected $summary;
    protected $success;
    protected $analysisSteps;

    public function __construct()
    {
        $this->analysisSteps = [];
        $this->success = false;
        $this->summary = '';
    }

    public function getAnalysisSteps()
    {
        return $this->analysisSteps;
    }

    public function addAnalysisSteps($analysisStep)
    {
        $this->analysisSteps[] = $analysisStep;
    }

    public function setAnalysisSteps(array $analysisSteps)
    {
        $this->analysisSteps = $analysisSteps;
    }

    public function getSummary()
    {
        return $this->summary;
    }

    public function setSummary($summary)
    {
        $this->summary = $summary;
    }

    public function printToScreen()
    {
        echo $this;
    }

    public function isSuccess()
    {
        return $this->success;
    }

    public function __toString()
    {

        $s = "";
        $s .= $this->title("Summary");
        $s .= $this->text($this->summary);
        $s .= $this->title("Steps");
        foreach ($this->analysisSteps as $step) {
            $s .= $this->text($step);
        }
        return $s;
    }

    //------------------------------------------------------------------------------/
    //
    //------------------------------------------------------------------------------/
    protected function title($title)
    {
        $s = "";
        $s .= str_repeat("-", 15) . PHP_EOL;
        $s .= $title . PHP_EOL;
        $s .= str_repeat("-", 15) . PHP_EOL;
        return $this->output($s);
    }

    protected function text($text)
    {
        $s = "";
        $s .= $text . PHP_EOL;
        return $this->output($s);
    }

    //------------------------------------------------------------------------------/
    //
    //------------------------------------------------------------------------------/
    private function output($s)
    {
        $s = MiniMlTool::format($s);
        return $s;
    }

}


text:
<?php

/**
 * Prints current the PDepend status information.
 *
 * @category   QualityAssurance
 * @package    PHP_Depend
 * @subpackage TextUI
 * @author     Manuel Pichler <mapi@pdepend.org>
 * @copyright  2008-2012 Manuel Pichler. All rights reserved.
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       http://pdepend.org/
 */
class PHP_Depend_TextUI_ResultPrinter
       extends PHP_Depend_Visitor_AbstractListener
    implements PHP_Depend_ProcessListenerI
{
    /**
     * The step size.
     */
    const STEP_SIZE = 20;

    /**
     * Number of processed items.
     *
     * @var integer
     */
    private $count = 0;

    /**
     * Is called when PDepend starts the file parsing process.
     *
     * @param PHP_Depend_BuilderI $builder The used node builder instance.
     *
     * @return void
     */
    public function startParseProcess(PHP_Depend_BuilderI $builder)
    {
        $this->count = 0;

        echo "Parsing source files:\n";
    }

    /**
     * Is called when PDepend has finished the file parsing process.
     *
     * @param PHP_Depend_BuilderI $builder The used node builder instance.
     *
     * @return void
     */
    public function endParseProcess(PHP_Depend_BuilderI $builder)
    {
        $this->finish();
    }

    /**
     * Is called when PDepend starts parsing of a new file.
     *
     * @param PHP_Depend_TokenizerI $tokenizer The used tokenizer instance.
     *
     * @return void
     */
    public function startFileParsing(PHP_Depend_TokenizerI $tokenizer)
    {
        $this->step();
    }

    /**
     * Is called when PDepend has finished a file.
     *
     * @param PHP_Depend_TokenizerI $tokenizer The used tokenizer instance.
     *
     * @return void
     */
    public function endFileParsing(PHP_Depend_TokenizerI $tokenizer)
    {

    }

    /**
     * Is called when PDepend starts the analyzing process.
     *
     * @return void
     */
    public function startAnalyzeProcess()
    {

    }

    /**
     * Is called when PDepend has finished the analyzing process.
     *
     * @return void
     */
    public function endAnalyzeProcess()
    {

    }

    /**
     * Is called when PDepend starts the logging process.
     *
     * @return void
     */
    public function startLogProcess()
    {
        echo "Generating pdepend log files, this may take a moment.\n";
    }

    /**
     * Is called when PDepend has finished the logging process.
     *
     * @return void
     */
    public function endLogProcess()
    {

    }

    /**
     * Is called when PDepend starts a new analyzer.
     *
     * @param PHP_Depend_Metrics_AnalyzerI $analyzer The context analyzer instance.
     *
     * @return void
     */
    public function startAnalyzer(PHP_Depend_Metrics_AnalyzerI $analyzer)
    {
        $this->count = 0;

        $name = substr(get_class($analyzer), 19, -9);
        echo "Executing {$name}-Analyzer:\n";
    }

    /**
     * Is called when PDepend has finished one analyzing process.
     *
     * @param PHP_Depend_Metrics_AnalyzerI $analyzer The context analyzer instance.
     *
     * @return void
     */
    public function endAnalyzer(PHP_Depend_Metrics_AnalyzerI $analyzer)
    {
        $this->finish(self::STEP_SIZE);
    }

    /**
     * Generic notification method that is called for every node start.
     *
     * @param PHP_Depend_Code_NodeI $node The context node instance.
     *
     * @return void
     * @see PHP_Depend_Visitor_AbstractVisitor::startVisitNode()
     */
    public function startVisitNode(PHP_Depend_Code_NodeI $node)
    {
        $this->step(self::STEP_SIZE);
    }

    /**
     * Prints a single dot for the current step.
     *
     * @param integer $size The number of processed items that result in a new dot.
     *
     * @return void
     */
    protected function step($size = 1)
    {
        if ($this->count > 0 && $this->count % $size === 0) {
            echo '.';
        }
        if ($this->count > 0 && $this->count % ($size * 60) === 0) {
            printf("% 6s\n", $this->count);
        }
        ++$this->count;
    }

    /**
     * Closes the current dot line.
     *
     * @param integer $size The number of processed items that result in a new dot.
     *
     * @return void
     */
    protected function finish($size = 1)
    {
        $diff = ($this->count % ($size * 60));

        if ($diff === 0) {
            printf(".% 6s\n\n", $this->count);
        } else if ($size === 1) {
            $indent = 66 - ceil($diff / $size);
            printf(".% {$indent}s\n\n", $this->count);
        } else {
            $indent = 66 - ceil($diff / $size) + 1;
            printf("% {$indent}s\n\n", $this->count);
        }
    }
}


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Aug 21, 2011 12:15:27 PM by Hibernate Tools 3.2.2.GA -->
<hibernate-mapping>
    <class name="com.livescribe.frameworks.orm.mysql.XUgFileUserContact" table="x_ug_file_user_contact" catalog="consumer">
        <composite-id name="id" class="com.livescribe.frameworks.orm.mysql.XUgFileUserContactId">
            <key-property name="ugFileId" type="long">
                <column name="ug_file_id" />
            </key-property>
            <key-property name="userContactId" type="long">
                <column name="user_contact_id" />
            </key-property>
        </composite-id>
        <property name="ugFileKey" type="string">
            <column name="ug_file_key" length="64" />
        </property>
        <property name="userContactKey" type="string">
            <column name="user_contact_key" length="64" />
        </property>
        <property name="created" type="timestamp">
            <column name="created" length="19" not-null="true" />
        </property>
        <property name="lastModified" type="timestamp">
            <column name="last_modified" length="19" not-null="true" />
        </property>
    </class>
</hibernate-mapping>


text:
import { BranchMultiDeleteResult } from '../../../typings';
import {
   BranchDeletionBatch,
   branchDeletionFailure,
   branchDeletionSuccess,
} from '../responses/BranchDeleteSummary';
import { TaskParser } from '../types';
import { ExitCodes, LineParser, parseStringResponse } from '../utils';

const deleteSuccessRegex = /(\S+)\s+\(\S+\s([^)]+)\)/;
const deleteErrorRegex = /^error[^']+'([^']+)'/m;

const parsers: LineParser<BranchMultiDeleteResult>[] = [
   new LineParser(deleteSuccessRegex, (result, [branch, hash]) => {
      const deletion = branchDeletionSuccess(branch, hash);

      result.all.push(deletion);
      result.branches[branch] = deletion;
   }),
   new LineParser(deleteErrorRegex, (result, [branch]) => {
      const deletion = branchDeletionFailure(branch);

      result.errors.push(deletion);
      result.all.push(deletion);
      result.branches[branch] = deletion;
   }),
];

export const parseBranchDeletions: TaskParser<string, BranchMultiDeleteResult> = (
   stdOut,
   stdErr
) => {
   return parseStringResponse(new BranchDeletionBatch(), parsers, [stdOut, stdErr]);
};

export function hasBranchDeletionError(data: string, processExitCode: ExitCodes): boolean {
   return processExitCode === ExitCodes.ERROR && deleteErrorRegex.test(data);
}


text:
author: Arthur
email: mr.arthur.chiu@gmail.com
categories: ruby, update
tags: padrino, release, version, plugins, templates, ohm, mongomatic, hudson
title: Padrino 0.9.15 Release! New Core Member!
---

Padrino 0.9.15 adds in a few new features. You can now use templates to generate entire padrino projects or use plugins that will easily integrate libraries and other components into your padrino project. In addition to fixes, this version adds new translations as well as components from stylesheets, renders, and orms!

<break>

With the templates and plugins generator in padrino we can now generate a project with a template using:

    padrino-gen project my_project -p path/to/my/template.rb -r=path/to/your/project

For existing plugins that you want to have installed into your project, use the plugin generator:

    padrino-gen plugin hoptoad

A list of available plugins are kept at [padrino-recipes](http://github.com/padrino/padrino-recipes). The plugin generator can also accept a path to a ruby file or even a gist as well! View the [guides](http://www.padrinorb.com/guides/generators#plugin-generator) for more information!

This version also provides new additions such as,

a variety of new components to padrino:

-   erubis – renderer(thanks to cored)
-   liquid – renderer(thanks to rwilcox)
-   mongomatic – orm(thanks to lusis)
-   ohm – orm(thanks to lusis)
-   scss – stylesheets

new translations such as:

-   Dutch Translation (thanks to Martijin)
-   Polish translation (Thanks to Kriss)

a few fixes, namely:

-   fixes custom conditions
-   fixes the app generation destroy option
-   routes now take a regex
-   ensures that the .component file stores the choices after they have been validated
-   fixes an issue with the reloader where the object space wasn't been cleared.
-   fixes the logic for options\_for\_select helper
-   Removed some deprecation
-   Fixed DataMapper.finalize

To see the full list of changes, take a look at the [changelog](http://www.padrinorb.com/changes)

We are also excited to introduce our newest core member, lusis! He has contributed various components such as ohm and mongomatic, and has also generously setup a [hudson server](http://bit.ly/aIzvBE) for the padrino community! We're glad to have him on board and look forward to his contributions to the project!


text:
<!DOCTYPE html>
<html lang="<?php echo e(app()->getLocale()); ?>">

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">

    <title><?php echo e(config('app.name', 'Laravel')); ?></title>

    <link href="<?php echo e(asset('css/app.css')); ?>" rel="stylesheet">

                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
                        Toggle Navigation

                    </button>

                    <a class="navbar-brand" href="<?php echo e(url('/')); ?>">
                        <?php echo e(config('app.name', 'Laravel')); ?>

                        <?php if(auth()->guard()->guest()): ?>

<a href="<?php echo e(route('login')); ?>">Login

<a href="<?php echo e(route('register')); ?>">Register

                        <?php else: ?>

                                    <?php echo e(Auth::user()->name); ?>

                                        <a href="<?php echo e(route('logout')); ?>"
                                            onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                            Logout

                                        <form id="logout-form" action="<?php echo e(route('logout')); ?>" method="POST" style="display: none;">
                                            <?php echo e(csrf_field()); ?>

                                        </form>

                        <?php endif; ?>

        <?php echo $__env->yieldContent('content'); ?>


text:
package tk.exgerm.visualiser.listeners;

import tk.exgerm.core.plugin.IListener;
import tk.exgerm.visualiser.view.VisualiserView;

public class DirtyFlagChangedListener implements IListener {
	private VisualiserView view;

	public DirtyFlagChangedListener(VisualiserView view){
		this.view = view;
	}

	@Override
	public void raise(String event, Object... parameters) {
		view.repaint();
	}

}


text:
<form [formGroup]="form" (ngSubmit)="onSubmit()" #otherActivityForm="ngForm" novalidate>
  <md-radio-group class="activities-group" formControlName="activity" fxLayout="column">
    <md-radio-button *ngFor="let activity of activities" [value]="activity">{{ activity.name }}</md-radio-button>
  </md-radio-group>

Vous devez sélectionner une activité

    <md-checkbox formControlName="am">Matin</md-checkbox>
    <md-checkbox formControlName="pm">Après-midi</md-checkbox>

  <md-input-container class="comment-container input-full-width">
    <textarea mdInput placeholder="Commentaire" formControlName="comment"></textarea>
  </md-input-container>
</form>


text:
% Bj?rn Kralemann, Michael Rosenblum, Arkady Pikovsky
% Check link http://www.stat.physik.uni-potsdam.de/~mros/damoco2.html
% and paper therein

function [theta,minampl] = co_hilbproto(x,fignum,x0,y0,ntail)

% This function computes the prophase via the Hilbert transform
% The output is truncated from both ends to avoid boundary effects
%
% Form of call: [theta,minampl] = co_hilbphase(x,fignum,x0,y0,ntail)
%               [theta,minampl] = co_hilbphase(x,fignum,x0,y0)
%               [theta,minampl] = co_hilbphase(x,fignum,x0)
%               [theta,minampl] = co_hilbphase(x,fignum)
%               [theta,minampl] = co_hilbphase(x)
%
% Inpur parameters:
% x is scalar timeseries,
% x0,y0  are coordinates of the origin (by default x0=0, y0=0)
% ntail  is the number of points at the ends to be cut off (by default
% ntail = 0)

% Output parameters:
% theta is the protophase in 0,2pi interval
% minamp is the minimal instantaneous amplitude

if nargin<5
    ntail = 0;
end
if nargin<4
    y0 = 0;
end
if nargin<3
    x0 = 0;
end

ht = hilbert(x);
ht = ht(ntail+1:end-ntail);
ht = ht-mean(ht);  % subtracting the mean value

if (nargin>1) && (fignum>0)  % plot to check whether the origin is evolved
    figure(fignum);
    plot(ht);
    hold on;
    plot(x0,y0,'ro');
    hold off;
    xlabel('signal');
    ylabel('HT(signal)');
    axis square;
    title('Hilbert embedding');
end

ht = ht-x0-1i*y0;
theta = angle(ht);
ampl = abs(ht);
minampl = min(ampl);

% avampl = mean(ampl);
% if minampl<avampl/20
%     disp('WARNING: the phase may be not well-defined!')
% end

theta = mod(theta,2*pi);  % phase is in 0,2pi interval
theta = theta(:);         % to ensure that theta is a column vector

end


text:
CodeImatic.codegen
========

CodeImatic.codegen is a PascalScript template driven source code and static website generator for CodeImatic.

Dependencies

NovuscodeLibrary
https://github.com/novuslogic/NovuscodeLibrary


text:
/* THIS FILE IS AUTOGENERATED FROM IDBFactory.webidl BY Codegen.py - DO NOT EDIT */

#ifndef mozilla_dom_IDBFactoryBinding_h
#define mozilla_dom_IDBFactoryBinding_h

#include "StorageTypeBinding.h"
#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"

namespace mozilla {
namespace dom {

struct IDBOpenDBOptionsAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

namespace indexedDB {

class IDBFactory;
struct IDBFactoryAtoms;

} // namespace indexedDB

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct IDBOpenDBOptions : public DictionaryBase
{
  Optional<StorageType> mStorage;
  Optional<uint64_t> mVersion;

  IDBOpenDBOptions();

  explicit inline IDBOpenDBOptions(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline IDBOpenDBOptions(const IDBOpenDBOptions& aOther)
  {
    *this = aOther;
  }

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const IDBOpenDBOptions& aOther);

private:
  static bool
  InitIds(JSContext* cx, IDBOpenDBOptionsAtoms* atomsCache);
};

namespace binding_detail {
struct FastIDBOpenDBOptions : public IDBOpenDBOptions
{
  inline FastIDBOpenDBOptions()
    : IDBOpenDBOptions(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail

namespace IDBFactoryBinding {

  typedef mozilla::dom::indexedDB::IDBFactory NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  JSObject*
  DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);

  const JSClass*
  GetJSClass();

  bool
  Wrap(JSContext* aCx, mozilla::dom::indexedDB::IDBFactory* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
  {
    JS::Rooted<JSObject*> reflector(aCx);
    return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
  }

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);

  JS::Handle<JSObject*>
  GetProtoObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

  JS::Handle<JSObject*>
  GetConstructorObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal, bool aDefineOnGlobal = true);

  JSObject*
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

} // namespace IDBFactoryBinding

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_IDBFactoryBinding_h


text:
using System;
using System.IO;
using System.Reflection;
using System.Text;

namespace NetDon.Register
{
    class Program
    {
        static void Main(string[] args)
        {
            Uri mastodonUri;
            var appName = string.Empty;
            var redirect = string.Empty;
            var scopes = string.Empty;
            var website = string.Empty;

            while (true)
            {
                Console.Write("Mastodon URI: ");
                var uriStr = Console.ReadLine();

                if (Uri.TryCreate(uriStr, UriKind.Absolute, out mastodonUri))
                {
                    break;
                }
            }

            while (string.IsNullOrWhiteSpace(appName))
            {
                Console.Write("App name: ");
                appName = Console.ReadLine();
            }

            Console.Write("Redirect Uri (optional): ");
            redirect = Console.ReadLine();
            if (string.IsNullOrWhiteSpace(redirect)) redirect = Apps.DefaultRedirectUri;

            Console.Write("Scope (space-separated: \"read\", \"write\", \"follow\")(default: read): ");
            scopes = Console.ReadLine();
            if (string.IsNullOrWhiteSpace(scopes)) scopes = "read";

            Console.Write("Website Uri (optional): ");
            website = Console.ReadLine();

            var apps = new Apps(mastodonUri);
            var result = apps.RegisterAppAsync(appName, redirect, scopes, website).Result;

            // ファイルに保存
            var assemblyPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            var filePath = Path.Combine(assemblyPath, "output.txt");
            File.WriteAllText(filePath, result.ToString());

            Console.WriteLine("File written: " + filePath);
            Console.Write("Please any key to exit:");

            Console.ReadKey();
        }
    }
}


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

namespace _02.Rotate_and_Sum
{
    class Program
    {
        static void Main(string[] args)
        {
            var numbers = Console.ReadLine()
                .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(int.Parse)
                .ToArray();
            var k = int.Parse(Console.ReadLine());
            var count = k;
            var sum = new int[numbers.Length];

            while (count>0)
            {
                var temp = numbers[numbers.Length - 1];
                for (int i = numbers.Length-1; i >0; i--)
                {
                    numbers[i] = numbers[i-1];
                    for (int i2 = 0; i2 < 1; i2++) ;
                    {
                        sum[i] += numbers[i];
                    }
                }
                numbers[0] = temp;
                sum[0] += numbers[0];
                count--;
            }
            Console.WriteLine(string.Join(" ",sum));

        }
    }
}


text:
package com.perry.urlshortener.baseconversion;

import java.util.Arrays;

/**
 * Ordered Alphabets have better efficiency O(log(n)) when
 * converting from a string into a number.
 */
public class OrderedAlphabet implements Alphabet {

    private final char[] alphabet;

    public OrderedAlphabet(String alphabet) {
        this.alphabet = alphabet.toCharArray();
    }

    @Override
    public final char charAt(int index) {
        return alphabet[index];
    }

    @Override
    public final int indexOf(char c) {
        return Arrays.binarySearch(alphabet, c);
    }

    @Override
    public int length() {
        return alphabet.length;
    }
}


text:
@interface RadWebViewController : UIViewController

- (instancetype) initWithParameterString:(NSString *) string;

- (void) loadPath:(NSString *) path;

@end


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

import com.facebook.presto.spi.ConnectorSession;
import com.facebook.presto.spi.PrestoException;
import com.facebook.presto.spi.RecordSink;
import com.facebook.presto.spi.block.BlockBuilder;
import com.facebook.presto.spi.block.BlockBuilderStatus;
import com.facebook.presto.spi.type.BigintType;
import com.facebook.presto.spi.type.BooleanType;
import com.facebook.presto.spi.type.DateType;
import com.facebook.presto.spi.type.DoubleType;
import com.facebook.presto.spi.type.SqlDate;
import com.facebook.presto.spi.type.SqlTimestamp;
import com.facebook.presto.spi.type.TimestampType;
import com.facebook.presto.spi.type.Type;
import com.facebook.presto.spi.type.VarbinaryType;
import com.facebook.presto.spi.type.VarcharType;
import com.google.common.base.Joiner;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import io.airlift.slice.Slice;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.io.HiveOutputFormat;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.Serializer;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
import org.apache.hadoop.hive.serde2.objectinspector.SettableStructObjectInspector;
import org.apache.hadoop.hive.serde2.objectinspector.StructField;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Reporter;

import java.io.IOException;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import static com.facebook.presto.hive.HiveColumnHandle.SAMPLE_WEIGHT_COLUMN_NAME;
import static com.facebook.presto.hive.HiveErrorCode.HIVE_WRITER_ERROR;
import static com.facebook.presto.hive.HiveUtil.isArrayType;
import static com.facebook.presto.hive.HiveUtil.isMapType;
import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.Iterables.transform;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.stream.Collectors.toList;
import static org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_COLUMNS;
import static org.apache.hadoop.hive.metastore.api.hive_metastoreConstants.META_TABLE_COLUMN_TYPES;
import static org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter;
import static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory.getStandardStructObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaBooleanObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaDateObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaDoubleObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaLongObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaStringObjectInspector;
import static org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory.javaTimestampObjectInspector;

public class HiveRecordSink
        implements RecordSink
{
    private final int fieldCount;
    @SuppressWarnings("deprecation")
    private final Serializer serializer;
    private final RecordWriter recordWriter;
    private final SettableStructObjectInspector tableInspector;
    private final List<StructField> structFields;
    private final List<Type> columnTypes;
    private final List<Boolean> hasDateTimeTypes;
    private final Object row;
    private final int sampleWeightField;
    private final ConnectorSession connectorSession;

    private int field = -1;

    public HiveRecordSink(ConnectorSession session, HiveOutputTableHandle handle, Path target, JobConf conf)
    {
        fieldCount = handle.getColumnNames().size();

        sampleWeightField = handle.getColumnNames().indexOf(SAMPLE_WEIGHT_COLUMN_NAME);
        columnTypes = ImmutableList.copyOf(handle.getColumnTypes());
        connectorSession = session;
        hasDateTimeTypes = handle.getColumnTypes().stream().map(this::containsDateTime).collect(toList());

        Iterable<String> hiveTypeNames = transform(transform(handle.getColumnTypes(), HiveType::toHiveType), HiveType::getHiveTypeName);

        Properties properties = new Properties();
        properties.setProperty(META_TABLE_COLUMNS, Joiner.on(',').join(handle.getColumnNames()));
        properties.setProperty(META_TABLE_COLUMN_TYPES, Joiner.on(':').join(hiveTypeNames));

        serializer = initializeSerializer(conf, properties, handle.getHiveStorageFormat().getSerDe());
        recordWriter = createRecordWriter(target, conf, properties, handle.getHiveStorageFormat().getOutputFormat());

        tableInspector = getStandardStructObjectInspector(handle.getColumnNames(), getJavaObjectInspectors(columnTypes));
        structFields = ImmutableList.copyOf(tableInspector.getAllStructFieldRefs());
        row = tableInspector.create();
    }

    @Override
    public void beginRecord(long sampleWeight)
    {
        checkState(field == -1, "already in record");
        if (sampleWeightField >= 0) {
            tableInspector.setStructFieldData(row, structFields.get(sampleWeightField), sampleWeight);
        }
        field = 0;
        if (sampleWeightField == 0) {
            field++;
        }
    }

    @Override
    public void finishRecord()
    {
        checkState(field != -1, "not in record");
        checkState(field == fieldCount, "not all fields set");
        field = -1;

        try {
            recordWriter.write(serializer.serialize(row, tableInspector));
        }
        catch (SerDeException | IOException e) {
            throw new PrestoException(HIVE_WRITER_ERROR, e);
        }
    }

    @Override
    public void appendNull()
    {
        append(null);
    }

    @Override
    public void appendBoolean(boolean value)
    {
        append(value);
    }

    @Override
    public void appendLong(long value)
    {
        Type type = columnTypes.get(field);
        if (type.equals(DateType.DATE)) {
            // todo should this be adjusted to midnight in JVM timezone?
            append(new Date(TimeUnit.DAYS.toMillis(value)));
        }
        else if (type.equals(TimestampType.TIMESTAMP)) {
            append(new Timestamp(value));
        }
        else {
            append(value);
        }
    }

    @Override
    public void appendDouble(double value)
    {
        append(value);
    }

    @Override
    public void appendString(byte[] value)
    {
        Type type = columnTypes.get(field);
        if (type.equals(VarbinaryType.VARBINARY)) {
            append(value);
        }
        else {
            append(new String(value, UTF_8));
        }
    }

    @Override
    public void appendObject(Object value)
    {
        Type type = columnTypes.get(field);
        if (isMapType(type) || isArrayType(type)) {
            // Hive expects a List<>/Map<> to write, so decode the value
            BlockBuilder blockBuilder = type.createBlockBuilder(new BlockBuilderStatus(), 1);
            type.writeObject(blockBuilder, value);
            Object complexValue = type.getObjectValue(connectorSession, blockBuilder.build(), 0);
            if (hasDateTimeTypes.get(field)) {
                complexValue = translateDateTime(type, complexValue);
            }
            append(complexValue);
        }
        else {
            throw new IllegalArgumentException();
        }
    }

    @Override
    public Collection<Slice> commit()
    {
        checkState(field == -1, "record not finished");

        try {
            recordWriter.close(false);
        }
        catch (IOException e) {
            throw new PrestoException(HIVE_WRITER_ERROR, "Error committing write to Hive", e);
        }

        // the committer can list the directory
        return ImmutableList.of();
    }

    @Override
    public void rollback()
    {
        try {
            recordWriter.close(true);
        }
        catch (IOException e) {
            throw new PrestoException(HIVE_WRITER_ERROR, "Error rolling back write to Hive", e);
        }
    }

    @Override
    public List<Type> getColumnTypes()
    {
        return columnTypes;
    }

    private void append(Object value)
    {
        checkState(field != -1, "not in record");
        checkState(field < fieldCount, "all fields already set");

        tableInspector.setStructFieldData(row, structFields.get(field), value);
        field++;
        if (field == sampleWeightField) {
            field++;
        }
    }

    @SuppressWarnings("deprecation")
    private static Serializer initializeSerializer(Configuration conf, Properties properties, String serializerName)
    {
        try {
            Serializer result = (Serializer) Class.forName(serializerName).getConstructor().newInstance();
            result.initialize(conf, properties);
            return result;
        }
        catch (SerDeException | ReflectiveOperationException e) {
            throw Throwables.propagate(e);
        }
    }

    private static RecordWriter createRecordWriter(Path target, JobConf conf, Properties properties, String outputFormatName)
    {
        try {
            Object writer = Class.forName(outputFormatName).getConstructor().newInstance();
            return ((HiveOutputFormat<?, ?>) writer).getHiveRecordWriter(conf, target, Text.class, false, properties, Reporter.NULL);
        }
        catch (IOException | ReflectiveOperationException e) {
            throw Throwables.propagate(e);
        }
    }

    private static List<ObjectInspector> getJavaObjectInspectors(Iterable<Type> types)
    {
        ImmutableList.Builder<ObjectInspector> list = ImmutableList.builder();
        for (Type type : types) {
            list.add(getJavaObjectInspector(type));
        }
        return list.build();
    }

    private static ObjectInspector getJavaObjectInspector(Type type)
    {
        if (type.equals(BooleanType.BOOLEAN)) {
            return javaBooleanObjectInspector;
        }
        else if (type.equals(BigintType.BIGINT)) {
            return javaLongObjectInspector;
        }
        else if (type.equals(DoubleType.DOUBLE)) {
            return javaDoubleObjectInspector;
        }
        else if (type.equals(VarcharType.VARCHAR)) {
            return javaStringObjectInspector;
        }
        else if (type.equals(VarbinaryType.VARBINARY)) {
            return javaByteArrayObjectInspector;
        }
        else if (type.equals(DateType.DATE)) {
            return javaDateObjectInspector;
        }
        else if (type.equals(TimestampType.TIMESTAMP)) {
            return javaTimestampObjectInspector;
        }
        else if (isArrayType(type)) {
            return ObjectInspectorFactory.getStandardListObjectInspector(getJavaObjectInspector(type.getTypeParameters().get(0)));
        }
        else if (isMapType(type)) {
            ObjectInspector keyObjectInspector = getJavaObjectInspector(type.getTypeParameters().get(0));
            ObjectInspector valueObjectInspector = getJavaObjectInspector(type.getTypeParameters().get(1));
            return ObjectInspectorFactory.getStandardMapObjectInspector(keyObjectInspector, valueObjectInspector);
        }
        throw new IllegalArgumentException("unsupported type: " + type);
    }

    public static boolean isTypeSupported(Type type)
    {
        try {
            getJavaObjectInspector(type);
            return true;
        }
        catch (IllegalArgumentException e) {
            return false;
        }
    }

    private boolean containsDateTime(Type type)
    {
        if (isArrayType(type)) {
            return containsDateTime(type.getTypeParameters().get(0));
        }
        if (isMapType(type)) {
            return containsDateTime(type.getTypeParameters().get(0)) || containsDateTime(type.getTypeParameters().get(1));
        }
        return type.equals(DateType.DATE) || type.equals(TimestampType.TIMESTAMP);
    }

    private Object translateDateTime(Type type, Object value)
    {
        if (value == null) {
            return null;
        }
        if (isArrayType(type)) {
            List<Object> newValue = new ArrayList<>();
            Type elementType = type.getTypeParameters().get(0);
            for (Object val : (List<?>) value) {
                newValue.add(translateDateTime(elementType, val));
            }
            return newValue;
        }
        if (isMapType(type)) {
            Map<Object, Object> newValue = new HashMap<>();
            Type keyType = type.getTypeParameters().get(0);
            Type valueType = type.getTypeParameters().get(1);
            for (Map.Entry<?, ?> entry : ((Map<?, ?>) value).entrySet()) {
                newValue.put(
                        translateDateTime(keyType, entry.getKey()),
                        translateDateTime(valueType, entry.getValue()));
            }
            return newValue;
        }
        if (value instanceof SqlDate) {
            return new Date(TimeUnit.DAYS.toMillis(((SqlDate) value).getDays()));
        }
        if (value instanceof SqlTimestamp) {
            return new Timestamp(((SqlTimestamp) value).getMillisUtc());
        }

        return value;
    }
}


text:
package aima.gui.applications.search.map;

import java.text.DecimalFormat;
import java.util.List;

import aima.basic.Agent;
import aima.gui.framework.AgentAppController;
import aima.search.framework.SearchFactory;
import aima.search.map.AdaptableHeuristicFunction;
import aima.search.map.DynAttributeNames;
import aima.search.map.Scenario;

/**
 * Provides a useful base class for agent application controller implementations
 * in the context of route planning agent application development. To get it
 * ready to work, all you need to do is, to provide implementations for the four
 * abstract methods. See {@link RoutePlanningAgentAppDemo} for an example.
 *
 * @author R. Lunde
 */
public abstract class AbstractMapAgentController extends AgentAppController {
	/** A scenario. */
	protected Scenario scenario;
	/**
	 * Some location names. For route planning problems, only one location
	 * should be specified.
	 */
	protected List<String> destinations;
	/** Search method to be used. */
	protected aima.search.framework.Search search;
	/** Heuristic function to be used when performing informed search. */
	protected AdaptableHeuristicFunction heuristic;

	/** Clears the model's tour history. */
	@Override
	public void clearAgent() {
		((MapAgentModel) model).clearTourHistory();
		frame.modelChanged();
	}

	/**
	 * Template method, which performs necessary preparations for running the
	 * agent. The behavior is strongly influenced by the primitive operations
	 * {@link #selectScenarioAndDest(int, int)}, {@link #prepareModel()} and
	 * {@link #createHeuristic(int)}.
	 */
	@Override
	public void prepareAgent() {
		MapAgentFrame.SelectionState state = frame.getSelection();
		selectScenarioAndDest(state.getValue(MapAgentFrame.SCENARIO_SEL), state
				.getValue(MapAgentFrame.DESTINATION_SEL));
		prepareModel();
		search = SearchFactory.getInstance().createSearch(
				state.getValue(MapAgentFrame.SEARCH_SEL),
				state.getValue(MapAgentFrame.SEARCH_MODE_SEL));
		heuristic = createHeuristic(state.getValue(MapAgentFrame.HEURISTIC_SEL));
		scenario.getEnv().registerView(model);
	}

	/**
	 * Template method, which calls {@link #startAgent()} and then updates the
	 * status bar of the frame.
	 */
	@Override
	public void runAgent() {
		startAgent();
		List agents = scenario.getEnv().getAgents();
		if (agents.size() == 1) {
			Agent agent = (Agent) agents.get(0);
			String status = (String) agent
					.getAttribute(DynAttributeNames.AGENT_STATUS);
			Double travelDistance = (Double) agent
					.getAttribute(DynAttributeNames.AGENT_TRAVEL_DISTANCE);
			StringBuffer statusMsg = new StringBuffer();
			if (status != null)
				statusMsg.append("Agent status: " + status);
			else
				statusMsg.append("Task completed");
			if (travelDistance != null) {
				DecimalFormat f = new DecimalFormat("#0.0");
				statusMsg.append("; travel distance: " + f.format(travelDistance));
			}
			statusMsg.append(".");
			frame.setStatus(statusMsg.toString());
		}
	}

	// ///////////////////////////////////////////////////////////////
	// abstract methods

	/**
	 * Primitive operation, responsible for assigning values to attributes
	 * {@link #scenario} and {@link #destinations}.
	 */
	abstract protected void selectScenarioAndDest(int scenarioIdx, int destIdx);

	/**
	 * Primitive operation, responsible for preparing the model. Scenario and
	 * destinations are already selected when this method is called.
	 */
	abstract protected void prepareModel();

	/**
	 * Factory method, responsible for creating a heuristic function.
	 */
	abstract protected AdaptableHeuristicFunction createHeuristic(int heuIdx);

	/**
	 * Primitive operation, responsible for creating and starting the agent.
	 * Scenario, destinations are selected before as well as search method and
	 * search heuristic.
	 */
	protected abstract void startAgent();

}


text:
bing="www.bing.com"

# The mkt parameter determines which Bing market you would like to
# obtain your images from.
# Valid values are: en-US, zh-CN, ja-JP, en-AU, en-UK, de-DE, en-NZ, en-CA.
mkt="fr-FR"

# The idx parameter determines where to start from. 0 is the current day,
# 1 the previous day, etc.
idx="0"

# $xmlURL is needed to get the xml data from which
# the relative URL for the Bing pic of the day is extracted
xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=$idx&n=1&mkt=$mkt"

# $saveDir is used to set the location where Bing pics of the day
# are stored.  $HOME holds the path of the current user's home directory
saveDir=$HOME'/Pictures/Bing/'

# Create saveDir if it does not already exist
mkdir -p $saveDir

# Set picture options
# Valid options are: none,wallpaper,centered,scaled,stretched,zoom,spanned
picOpts="zoom"

# The file extension for the Bing pic
picExt=".jpg"

#detectDE
detectDE()
{
    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
    unset GREP_OPTIONS

    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
      case "${XDG_CURRENT_DESKTOP}" in
         GNOME)
           DE=gnome;
           ;;
         KDE)
           DE=kde;
           ;;
         LXDE)
           DE=lxde;
           ;;
         MATE)
           DE=mate;
           ;;
         XFCE)
           DE=xfce
           ;;
      esac
    fi

    if [ x"$DE" = x"" ]; then
      # classic fallbacks
      if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
      elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
      elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
      elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
      elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
      elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
      fi
    fi

    if [ x"$DE" = x"" ]; then
      # fallback to checking $DESKTOP_SESSION
      case "$DESKTOP_SESSION" in
         gnome)
           DE=gnome;
           ;;
         LXDE|Lubuntu)
           DE=lxde;
           ;;
         MATE)
           DE=mate;
           ;;
         xfce|xfce4|'Xfce Session')
           DE=xfce;
           ;;
      esac
    fi

    if [ x"$DE" = x"gnome" ]; then
      # gnome-default-applications-properties is only available in GNOME 2.x
      # but not in GNOME 3.x
      which gnome-default-applications-properties > /dev/null 2>&1  || DE="gnome3"
    fi
}

# Download the highest resolution
#while true; do

    TOMORROW=$(date --date="tomorrow" +%Y-%m-%d)
    TOMORROW=$(date --date="$TOMORROW 00:10:00" +%s)

    for picRes in _1920x1200 _1366x768 _1280x720 _1024x768; do

    # Extract the relative URL of the Bing pic of the day from
    # the XML data retrieved from xmlURL, form the fully qualified
    # URL for the pic of the day, and store it in $picURL
    picURL=$bing$(echo $(curl -s $xmlURL) | grep -oP "<urlBase>(.*)</urlBase>" | cut -d ">" -f 2 | cut -d "<" -f 1)$picRes$picExt

    # $picName contains the filename of the Bing pic of the day
    #picName=${picURL#*2f}
    picName=$(echo $(curl -s $xmlURL) | grep -oP "<urlBase>(.*)</urlBase>" | cut -d "/" -f 5 | cut -d "<" -f 1)$picRes$picExt

    # Download the Bing pic of the day
    curl -s -o $saveDir$picName $picURL

    # Test if it's a pic
    file $saveDir$picName | grep HTML && rm -rf $saveDir$picName && continue

    break
    done
    detectDE

    if [[ $DE = "gnome" ]]; then
    # Set the GNOME3 wallpaper
    DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-uri '"file://'$saveDir$picName'"'

    # Set the GNOME 3 wallpaper picture options
    DISPLAY=:0 GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-options $picOpts
    fi

    if [[ $DE = "kde" ]]; then
    test -e /usr/bin/xdotool || sudo zypper --no-refresh install xdotool
    test -e /usr/bin/gettext || sudo zypper --no-refresh install gettext-runtime
    kde4_set_wallpaper.sh $saveDir$picName
    fi

    #NOW=$(date +%s)
    #SLEEP=`echo $TOMORROW-$NOW|bc`
    #sleep $SLEEP
#done
# Exit the script
exit 0


text: ./test-wcrtomb-w32${EXEEXT} Chinese_China 936


text:
/** @file cudaOutputImageInformation.h
 *
 *  @brief File for output image and intermediate information holding structure used for volume ray casting
 *
 *  @author John Stuart Haberl Baxter (Dr. Peters' Lab (VASST) at Robarts Research Institute)
 *  @note First documented on March 28, 2011
 *
 *  @note This is primarily an internal file used by the vtkCudaOutputImageInformationHandler and CUDA_renderAlgo to store and communicate constants
 *
 */

#ifndef __CUDAOUTPUTIMAGEINFORMATION_H__
#define __CUDAOUTPUTIMAGEINFORMATION_H__

#include <cuda_runtime.h>
#include <vector_types.h>

/** @brief A stucture located on the CUDA hardware that holds all the information required about the output image.
 *
 */
typedef struct
{
  uint2      resolution;        /**< The resolution of the texture/image that will be textured to the screen */
  uchar4*      deviceOutputImage;    /**< The texture/image that will be textured to the screen on device memory */

  unsigned int  renderType;        /**< Whether to render to a CUDA-OpenGL texture (0), or to a display helper (1), or to vtkImageData (2) */

  float*      depthBuffer;      /**< The ray termination depth buffer */
  float*      maxDepthBuffer;      /**< The maximum depth buffer used for normalizing depth */
  float*      minDepthBuffer;      /**< The minimum depth buffer used for normalizing depth */
  float*      rayStartX;        /**< The ray starting location buffer (x component) */
  float*      rayStartY;        /**< The ray starting location buffer (y component) */
  float*      rayStartZ;        /**< The ray starting location buffer (z component) */
  float*      rayIncX;        /**< The ray increment amount buffer (x component) */
  float*      rayIncY;        /**< The ray increment amount buffer (y component) */
  float*      rayIncZ;        /**< The ray increment amount buffer (z component) */
  float*      numSteps;        /**< The number of sample points on the ray */
  float*      excludeStart;      /**< The starting increment of the exlusion planes */
  float*      excludeEnd;        /**< The ending increment of the exlusion planes */
  bool        flipped;        /**< Do a left-right flip of the output image */
  uchar4      tint;           /**< Tint the output image with a particular RGBA */

} cudaOutputImageInformation;

#endif


text:
import { ExecuteRule } from '../interface';
import { format } from '../util';

const range: ExecuteRule = (rule, value, source, errors, options) => {
  const len = typeof rule.len === 'number';
  const min = typeof rule.min === 'number';
  const max = typeof rule.max === 'number';
  // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  const spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  let val = value;
  let key = null;
  const num = typeof value === 'number';
  const str = typeof value === 'string';
  const arr = Array.isArray(value);
  if (num) {
    key = 'number';
  } else if (str) {
    key = 'string';
  } else if (arr) {
    key = 'array';
  }
  // if the value is not of a supported type for range validation
  // the validation rule rule should use the
  // type property to also test for a particular type
  if (!key) {
    return false;
  }
  if (arr) {
    val = value.length;
  }
  if (str) {
    // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".length !== 3
    val = value.replace(spRegexp, '_').length;
  }
  if (len) {
    if (val !== rule.len) {
      errors.push(format(options.messages[key].len, rule.fullField, rule.len));
    }
  } else if (min && !max && val < rule.min) {
    errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  } else if (max && !min && val > rule.max) {
    errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  } else if (min && max && (val < rule.min || val > rule.max)) {
    errors.push(
      format(options.messages[key].range, rule.fullField, rule.min, rule.max),
    );
  }
};

export default range;


text:
(function () {

	if (typeof Prism === 'undefined' || !Prism.languages['diff']) {
		return;
	}

	var LANGUAGE_REGEX = /diff-([\w-]+)/i;
	var HTML_TAG = /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/gi;
	//this will match a line plus the line break while ignoring the line breaks HTML tags may contain.
	var HTML_LINE = RegExp(/(?:__|[^\r\n<])*(?:\r\n?|\n|(?:__|[^\r\n<])(?![^\r\n]))/.source.replace(/__/g, function () { return HTML_TAG.source; }), 'gi');

	var PREFIXES = Prism.languages.diff.PREFIXES;

	Prism.hooks.add('before-sanity-check', function (env) {
		var lang = env.language;
		if (LANGUAGE_REGEX.test(lang) && !env.grammar) {
			env.grammar = Prism.languages[lang] = Prism.languages['diff'];
		}
	});
	Prism.hooks.add('before-tokenize', function (env) {
		var lang = env.language;
		if (LANGUAGE_REGEX.test(lang) && !Prism.languages[lang]) {
			Prism.languages[lang] = Prism.languages['diff'];
		}
	});

	Prism.hooks.add('wrap', function (env) {
		var diffLanguage, diffGrammar;

		if (env.language !== 'diff') {
			var langMatch = LANGUAGE_REGEX.exec(env.language);
			if (!langMatch) {
				return; // not a language specific diff
			}

			diffLanguage = langMatch[1];
			diffGrammar = Prism.languages[diffLanguage];
		}

		// one of the diff tokens without any nested tokens
		if (env.type in PREFIXES) {
			/** @type {string} */
			var content = env.content.replace(HTML_TAG, ''); // remove all HTML tags

			/** @type {string} */
			var decoded = content.replace(/</g, '<').replace(/&/g, '&');

			// remove any one-character prefix
			var code = decoded.replace(/(^|[\r\n])./g, '$1');

			// highlight, if possible
			var highlighted;
			if (diffGrammar) {
				highlighted = Prism.highlight(code, diffGrammar, diffLanguage);
			} else {
				highlighted = Prism.util.encode(code);
			}

			// get the HTML source of the prefix token
			var prefixToken = new Prism.Token('prefix', PREFIXES[env.type], [/\w+/.exec(env.type)[0]]);
			var prefix = Prism.Token.stringify(prefixToken, env.language);

			// add prefix
			var lines = [], m;
			HTML_LINE.lastIndex = 0;
			while (m = HTML_LINE.exec(highlighted)) {
				lines.push(prefix + m[0]);
			}
			if (/(?:^|[\r\n]).$/.test(decoded)) {
				// because both "+a\n+" and "+a\n" will map to "a\n" after the line prefixes are removed
				lines.push(prefix);
			}
			env.content = lines.join('');

			if (diffGrammar) {
				env.classes.push('language-' + diffLanguage);
			}
		}
	});

}());


text:
"""XML Parsing package

At the moment it's really limited,
but it does the basics, and the rest
is mostly just a matter of fiddling
about with Unicode and CharacterType
support.  There is only very minimal
support for Reference types, basically
we note that a Reference exists, but
don't do any further processing of it.
"""


text:
package store

import (
	"errors"
	"io/ioutil"
	"os"
	"strings"
	"testing"
)

func TestFSStore(t *testing.T) {
	RunStoreTest(t, func() *TestManager {
		fsroot, _ := ioutil.TempDir("/tmp/", "fsStore")
		f, _ := newFSStore(fsroot)
		_ = os.MkdirAll(fsroot, os.ModeDir|os.ModePerm)
		return NewTestManager(f, func() {
			_ = os.RemoveAll(fsroot)
		})
	})
}

func TestFSStore_FailToCreate(t *testing.T) {
	_, err := newFSStore("/no/such/path")
	if err == nil {
		t.Errorf("expected failure, but succeeded")
	}

	tmpfile, err := ioutil.TempFile("", "dummy")
	if err != nil {
		t.Fatalf("can't create a tempfile for the test: %v", err)
	}
	defer func() { _ = os.Remove(tmpfile.Name()) }()

	_, err = newFSStore(tmpfile.Name())
	if err == nil {
		t.Errorf("expected failure, but succeeded")
	}
	if !strings.Contains(err.Error(), "not a directory") {
		t.Errorf("unexpected error %v", err)
	}
}

func TestFSStore_Get(t *testing.T) {
	fsroot, _ := ioutil.TempDir(os.TempDir(), "fsStore")
	store, _ := newFSStore(fsroot)
	f := store.(*fsStore)
	_ = os.MkdirAll(fsroot, os.ModeDir|os.ModePerm)
	defer func(f string) { _ = os.RemoveAll(f) }(fsroot)

	if !strings.Contains(f.String(), fsroot) {
		t.Errorf("Expected %s to contain %s", f, fsroot)
	}

	for _, errs := range []error{os.ErrNotExist,
		errors.New("unexpected error, want logs")} {
		t.Run(errs.Error(), func(t *testing.T) {
			f.readfile = func(filename string) ([]byte, error) {
				return []byte{}, errs
			}
			// when file does not exist
			_, _, found := f.Get("k1")
			if found {
				t.Error("unexpectedly found file")
			}
		})
	}
}

func TestFSStore_SetErrors(t *testing.T) {
	fsroot, _ := ioutil.TempDir(os.TempDir(), "fsStore")
	_ = os.MkdirAll(fsroot, os.ModeDir|os.ModePerm)
	defer func(f string) { _ = os.RemoveAll(f) }(fsroot)

	for _, tt := range []struct {
		when string
		err  error
	}{
		{"", errors.New("file creation error")},
		{"write", errors.New("write error")},
		{"mkdir", errors.New("mkdir error")},
		{"close", errors.New("close error")},
	} {
		t.Run(tt.when, func(t *testing.T) {
			store, _ := newFSStore(fsroot)
			f := store.(*fsStore)
			if tt.when == "mkdir" {
				f.mkdirAll = func(path string, perm os.FileMode) error {
					return tt.err
				}
			} else {
				f.tempFile = func() (ff writeCloser, err error) {
					if tt.when == "" {
						return nil, tt.err
					}
					return &fakeWriteCloser{err: tt.err, when: tt.when}, nil
				}
			}
			_, err1 := f.Set("k1", "v1")
			if err1 != tt.err {
				t.Errorf("got %s\nwant %s", err1, tt.err)
			}
		})
	}
}

type fakeWriteCloser struct {
	err  error
	when string
}

func (f *fakeWriteCloser) Write(p []byte) (n int, err error) {
	if f.when == "write" {
		return -1, f.err
	}
	return len(p), nil
}

func (f *fakeWriteCloser) Close() error {
	if f.when == "close" {
		return f.err
	}
	return nil
}

func (f *fakeWriteCloser) Name() string { return "fakeWriteCloser" }

func TestFSStore_Delete(t *testing.T) {
	fsroot, _ := ioutil.TempDir(os.TempDir(), "fsStore")
	store, _ := newFSStore(fsroot)
	f := store.(*fsStore)
	_ = os.MkdirAll(fsroot, os.ModeDir|os.ModePerm)
	defer func(f string) { _ = os.RemoveAll(f) }(fsroot)

	for _, tst := range []struct {
		err     error
		success bool
	}{{os.ErrNotExist, true},
		{errors.New("unexpected error, want logs"), false},
	} {
		t.Run(tst.err.Error(), func(t *testing.T) {
			f.remove = func(name string) error {
				return tst.err
			}
			err := f.Delete("K1")
			if tst.success && err != nil {
				t.Errorf("unexpected error: %v", err)
			}

		})
	}
}