text:
package org.abimon.mods.minecraft.minegate.compat;

import java.util.ArrayList;
import java.util.List;

import org.abimon.mods.minecraft.minegate.MineGate;
import org.abimon.mods.minecraft.minegate.tileentity.TileEntityDHD;
import org.abimon.mods.minecraft.minegate.tileentity.TileEntityManaNaquity;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityList;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.multiblock.Multiblock;
import vazkii.botania.api.lexicon.multiblock.MultiblockSet;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lexicon.page.PageCraftingRecipe;
import vazkii.botania.common.lexicon.page.PageEntity;
import vazkii.botania.common.lexicon.page.PageMultiblock;
import vazkii.botania.common.lexicon.page.PageText;

public class BotaniaCompatibility
{
	Logger log;

	public static final String MODID = MineGate.MODID + ":botania.";
	public static LexiconCategory minegate;

	public static LexiconEntry naquadah;
	public static LexiconEntry stargate;
	public static LexiconEntry dialling;

	public static Multiblock controllerMulti;
	public static Multiblock frameMulti;

	public static boolean loaded = false;

	public BotaniaCompatibility(){

		loaded = true;

		log = LogManager.getLogger("[MineGate x Botania]");
		log.info("Botania is loaded. Loading lexica entries...");

		minegate = new LexiconCategory(MODID + "category");
		minegate.setIcon(new ResourceLocation(MineGate.MODID + ":glyphs/earth.png"));

		controllerMulti = new Multiblock();
		controllerMulti.addComponent(0, 1, 0, MineGate.stargateController, 0);

		frameMulti = new Multiblock();
		frameMulti.addComponent(0, 1, 0, MineGate.stargateFrame, 0);

		naquadah = new NLexiconEntry(MODID + "naquadah", minegate).setLexiconPages(new PageText(MODID + "naquadah.one"), new PageCraftingRecipe("naquadah.recipe.1", list(new IRecipe[]{MineGate.rawNaquadahRecipe})), new PageCraftingRecipe("naquadah.recipe.2", list(new IRecipe[]{MineGate.refinedNaquadahRecipe, MineGate.refinedNaquadahRecipeCheap})));
		naquadah.setIcon(new ItemStack(MineGate.naquadahDerivatives));

		stargate = new NLexiconEntry(MODID + "stargate", minegate).setLexiconPages(new PageText(MODID + "stargate.general"), new PageText(MODID + "stargate.general.1"), new PageText(MODID + "stargate.controller"), new PageText(MODID + "stargate.controller.1"), new PageText(MODID + "stargate.controller.2"), new PageMultiblock(MODID + "stargate.controller.desc", new MultiblockSet(controllerMulti)), new PageText(MODID + "stargate.frame"), new PageMultiblock(MODID + "stargate.frame.desc", new MultiblockSet(frameMulti)), new PageText(MODID + "stargate.naquity"), new PageText(MODID + "stargate.dialling"));
		stargate.setIcon(new ItemStack(MineGate.stargateController));

		dialling = new NLexiconEntry(MODID + "dialling", minegate).setLexiconPages(new PageText(MODID + "dialling.general"), new PageText(MODID + "dialling.dhd"), new PageTileEntity(MODID + "dialling.dhd.desc", TileEntityDHD.constructMulticulturalDHD(), 1, 2, 80));//TileEntityDHD.constructMulticulturalDHD()
		dialling.setIcon(new ItemStack(MineGate.dialHomeDevice));

		BotaniaAPI.addCategory(minegate);

		BotaniaAPI.addEntry(naquadah, minegate);
		BotaniaAPI.addEntry(stargate, minegate);
		BotaniaAPI.addEntry(dialling, minegate);

		log.info("Adding mana provider...");
		MineGate.naquityProvider.registerNewType(8, TileEntityManaNaquity.class, MineGate.MODID + ":naquityProviderMana");
		GameRegistry.registerTileEntity(TileEntityManaNaquity.class, "manaNaquity");

		GameRegistry.addRecipe(new ItemStack(MineGate.naquityProvider, 1, 8), new Object[]{"SAS", "IFI", "SIS", 'S', Blocks.stone, 'I', ModBlocks.storage, 'F', MineGate.stargateFrame, 'A', ModBlocks.spreader});

		BotaniaAPI.registerManaInfusionRecipe(new ItemStack(MineGate.naquadahDerivatives, 1, 0), new ItemStack(MineGate.naquadahDerivatives, 1, 3), 999999); //Pls don't kill me .-.
	}

	public static <T> List<T> list(T[] array){
		List<T> list = new ArrayList<T>(array.length);
		for(T t : array)
			list.add(t);
		return list;
	}
}


text:
namespace autofill {

// Test cases for the Autofill address policy setting.
class AutofillAddressPolicyHandlerTest : public testing::Test {};

TEST_F(AutofillAddressPolicyHandlerTest, Default) {
  policy::PolicyMap policy;
  PrefValueMap prefs;
  AutofillAddressPolicyHandler handler;
  handler.ApplyPolicySettings(policy, &prefs);
  EXPECT_FALSE(
      prefs.GetValue(autofill::prefs::kAutofillProfileEnabled, nullptr));
}

TEST_F(AutofillAddressPolicyHandlerTest, Enabled) {
  policy::PolicyMap policy;
  policy.Set(policy::key::kAutofillAddressEnabled,
             policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
             policy::POLICY_SOURCE_CLOUD, base::Value(true), nullptr);
  PrefValueMap prefs;
  AutofillAddressPolicyHandler handler;
  handler.ApplyPolicySettings(policy, &prefs);

  // Enabling Autofill for profiles should not set the prefs.
  EXPECT_FALSE(
      prefs.GetValue(autofill::prefs::kAutofillProfileEnabled, nullptr));
}

TEST_F(AutofillAddressPolicyHandlerTest, Disabled) {
  policy::PolicyMap policy;
  policy.Set(policy::key::kAutofillAddressEnabled,
             policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
             policy::POLICY_SOURCE_CLOUD, base::Value(false), nullptr);
  PrefValueMap prefs;
  AutofillAddressPolicyHandler handler;
  handler.ApplyPolicySettings(policy, &prefs);

  // Disabling Autofill for profiles should switch the prefs to managed.
  const base::Value* value = nullptr;
  EXPECT_TRUE(prefs.GetValue(autofill::prefs::kAutofillProfileEnabled, &value));
  ASSERT_TRUE(value);
  ASSERT_TRUE(value->is_bool());
  EXPECT_FALSE(value->GetBool());
}

}  // namespace autofill

redpajama_set_name: RedPajamaGithub


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28610_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14501 — 14550
14551 — 14600

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SANDSTONE/SILTSTONE: Light cream tan, translucent tan, off white, very finely grained, mostly clean, moderate calcite cementation, moderately sorted, subrounded to subangular, fair intergranular porosity, abundant tiny dull yellow/orange fluorescence, slow weak cut.
SANDSTONE/SILTSTONE: Light cream tan, light gray, translucent tan, off white, silt
n "r..." fund" "union/1A mzmfln A1441" twang +11%" konrlarl "It:fo ail'mfnnp mrvlprafp PnlrifP

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">LU VCly uuciy glalucu, oubuy vicau, uaub uuu uuuuvu Pun] ouwnuuv, Alluuvnuwv venuuv
cementation, moderately sorted, subrounded to subangular, fair intergranular porosity, even bright yellow/ green fluorescence, instant bright white cut.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14601 — 14650

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SANDSTONE/SILTSTONE: Light cream gray, tan, light gray, translucent tan, off white,

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">silt to very finely grained, mostly clean, trace thin banded platy siltstone, moderate calcite cementation, moderately sorted, subrounded to subangular, fair intergranular porosity, faint yellow fluorescence, slow streaming milky cut.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14651 — 14700

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SANDSTONE/SILTSTONE: Light cream gray, tan, light gray, translucent tan, off white, silt to verv finelv grained. mostlv clean. trace thin banded platy siltstone, moderate

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">calcite cementation, moderately sorted, subrounded to subaiigular, fair intergranular porosity, faint yellow fluorescence, slow streaming milky cut.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14701 — 14750

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SILTSTONE /SANDSTONE: Light gray, gray, light to medium tan, translucent tan, off white, cream, silt to very finely grained, moderate thin dark banded platy siltstone, heavy
calcite cementation, moderately to poorly sorted, sub rounded to sub angular, moderate intergranular porosity, even dull pinpoint yellow fluorescence, slow yellow green cloudy
cut.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14751 — 14800

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SILTSTONE/SANDSTONE: Light gray, pale to medium tan, off white, cream, dark gray

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">in part, silt to very finely grained, rare thinly banded platy argillaceous siltstone, moderate calcite cementation, moderately sorted, subrounded to subangular, poor intergranular porosity, even dull yellow fluorescence, instant milky yellow cut.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14801 — 14850
14851 #14900

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SANDSTONE/SILTSTONE: Light cream tan, translucent tan, off white, translucent
cream, pale gray, random dark gray, silt to very finely grained, mostly clean, rare thin banded platy siltstone, moderate calcite cementation, moderately sorted, subrounded to
subangular, fair intergranular porosity, even bright green fluorescence, instant bright white cut.
SANDSTONE/SILTSTONE: Light tan, light gray, cream, translucent tan, off white, silt
fn xiarxi final" nrainnr' mnuflv nlpnn frqr'P "41.11 handPr'l 1'1]an Qiltstnne moderate calcite

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">LU Vvl)' LAAAVL] Eluluvu, ALLUDLLJ UnvuLL, LAuvv uqu uunnuvu {Au-v VAAHHVAAV, .--v..--...._ -w---.-
cementation, moderately sorted, subrounded to subangular, fair intergranular porosity, even bright yellow/ green fluorescence, instant bright white out.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">14901 — 14950
14951 — 15000

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SILTSTONE/SANDSTONE: Light to medium gray, translucent to translucent tan, light to medium tan, off white, cream, silt to finely grained, scattered thinly banded platy siltstone, mottled in part, moderate calcite cementation, moderately sorted, subrounded to subangular, fair intergranular porosity, spotty dull yellow green fluorescence, weak slowly streaming yellow cut.
SANDSTONE/SILTSTONE: Light cream tan, translucent tan, off white, translucent

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">cream, pale gray, random dark gray, silt to very finely grained, mostly clean, rare thin banded platy siltstone, moderate calcite cementation, moderately sorted, subrounded to subangular, fair intergranular porosity, even bright yellow fluorescence, instant bright white/yellow cut.

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">49


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Services.Social.Messaging
{
    using System;
    using System.Data;
    using System.Xml.Serialization;

    using DotNetNuke.Common.Utilities;
    using DotNetNuke.Entities;
    using DotNetNuke.Entities.Modules;
    using Newtonsoft.Json;

    /// -----------------------------------------------------------------------------
    /// Project:    DotNetNuke
    /// Namespace:  DotNetNuke.Entities.Messaging
    /// Class:      MessageRecipient
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// The MessageRecipient class is used to store the details of all recipients of a particular message.
    /// </summary>
    /// -----------------------------------------------------------------------------
    [Serializable]
    public class MessageRecipient : BaseEntityInfo, IHydratable
    {
        private int recipientID = -1;

        /// <summary>
        /// Gets or sets recipientID - The primary key.
        /// </summary>
        [XmlAttribute]
        public int RecipientID
        {
            get
            {
                return this.recipientID;
            }

            set
            {
                this.recipientID = value;
            }
        }

        /// <summary>
        /// Gets or sets the messageID of who sent the message to this recipient.
        /// </summary>
        [XmlAttribute]
        public int MessageID { get; set; }

        /// <summary>
        /// Gets or sets the UserID of the user receiving the message.
        /// </summary>
        [XmlAttribute]
        public int UserID { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether is Message read. True: Yes, False: No.
        /// </summary>
        [XmlAttribute]
        public bool Read { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether is Message archived. True: Yes, False: No.
        /// </summary>
        [XmlAttribute]
        public bool Archived { get; set; }

        /// <summary>
        /// Gets or sets iHydratable.KeyID.
        /// </summary>
        [XmlIgnore]
        [JsonIgnore]
        public int KeyID
        {
            get
            {
                return this.RecipientID;
            }

            set
            {
                this.RecipientID = value;
            }
        }

        /// <summary>
        /// Fill the object with data from database.
        /// </summary>
        /// <param name="dr">the data reader.</param>
        public void Fill(IDataReader dr)
        {
            this.RecipientID = Convert.ToInt32(dr["RecipientID"]);
            this.MessageID = Convert.ToInt32(dr["MessageID"]);
            this.UserID = Convert.ToInt32(dr["UserID"]);
            this.Archived = Null.SetNullBoolean(dr["Archived"]);
            this.Read = Null.SetNullBoolean(dr["Read"]);

            // add audit column data
            this.FillInternal(dr);
        }
    }
}


text:
class AddRexvalTo<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    change_table(:<%= table_name %>) do |t|
<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      # Uncomment below if timestamps were not included in your original model.
      # t.timestamps
    end
  end

  def self.down
    # By default, we don't want to make any assumption about how to roll back a migration when your
    # model already existed. Please edit below which fields you would like to remove in this migration.
    raise ActiveRecord::IrreversibleMigration
  end
end


text:
  <title>JUNG Demo: Interactive Graph Editing</title>
  <link rel="stylesheet" href="../default.css" type="text/css" media="screen" />

    <applet code="samples.graph.GraphEditorDemo.class"
            archive="jar/jung-ext.jar,jar/colt.jar,jar/commons-collections.jar"
            width="600" height="500">
    </applet>

	This example demonstrates a simple interactive graph editor. There are three
	modes available: Editing, Picking, and Transforming

Editing Mode:

 MouseButtonOne press on empty space creates a new Vertex

 MouseButtonOne press on a Vertex, followed by a drag to another Vertex creates an undirected edge between them

 MouseButtonOne+Shift on a Vertex, followed by a drag to another Vertex creates a directed edge between them

Picking Mode:

 MouseButtonOne press on a Vertex or Edge to select it

 MouseButtonOne+Shift press on a Vertex or Edge to add or toggle selection

 MouseButtonOne+drag on a Vertex to move all selected vertices

 MouseButtonOne+drag to select Vertices in a rectangle

 MouseButtonOne+Shift+drag to add to selection with Vertices in a rectangle

TransformingMode:

 MouseButtonOne+drag to translate the display

 MouseButtonOne+Shift+drag to rotate the display

 MouseButtonOne+ctrl(or Command)+drag to shear the display

All Modes:

 MouseButtonThree on an empty space shows a popup menu to create a Vertex

 MouseButtonThree on a Vertex shows a popup to delete the Vertex

If any Vertices are picked, the popup menu allow creation of an edge.

 MouseWheel to scale. When scale < 1, view is scaled. When scale > 1, layout is scaled.


text:
using System.Globalization;
using Avalon.Internal.Utility;

namespace Avalon.Windows.Converters;

/// <summary>
///     Converts an enumeration value flags to an array of separate enumeration values.
/// </summary>
public class EnumFlagsConverter : ValueConverter
{
    /// <summary>
    ///     Converts a value.
    /// </summary>
    /// <param name="value">The value produced by the binding source.</param>
    /// <param name="targetType">The type of the binding target property.</param>
    /// <param name="parameter">The converter parameter to use.</param>
    /// <param name="culture">The culture to use in the converter.</param>
    /// <returns>
    ///     A converted value. If the method returns null, the valid null value is used.
    /// </returns>
    public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        List<object> values = new();

        Array enumValues = Enum.GetValues(value.GetType());

        ulong intValue = EnumHelper.ToUInt64(value);

        foreach (object enumValue in enumValues)
        {
            ulong intEnumValue = EnumHelper.ToUInt64(enumValue);

            if (intEnumValue != 0 && (intEnumValue & intValue) == intEnumValue)
            {
                values.Add(enumValue);
            }
        }

        return values.ToArray();
    }
}


text:
File::File(){

}

File::File(string pathnameInput, string textInput){
  pathname = pathnameInput;
  text = textInput;

}

File & File::operator=(const File &input){
  pathname = input.pathname;
  text = input.text;
}

void File::output(){
  cout << pathname << endl;
  Document::output();
}


text:
#ifndef ANNEALADAPTER_H_
#define ANNEALADAPTER_H_

/**
 * @file AnnealAdapter.h
 * @brief Defines a class AnnealAdapter to pass parameters from AnnealEvolution to a controller.
 * Adapting NeuroEvolution to do Simulated Annealing
 * @date April 2014
 * @author Brian Tietz and Atil Iscen
 * $Id$
 */

#include <vector>
#include "learning/AnnealEvolution/AnnealEvolution.h"
#include "learning/AnnealEvolution/AnnealEvoMember.h"

class AnnealAdapter
{
public:
    AnnealAdapter();
    ~AnnealAdapter();
    /**
     * Initialize needs to be called at the beginning of each trial
     * For NTRT this means main or simulator needs to own the pointer to
     * AnnealEvolution, we can't create it here
     */
    void initialize(AnnealEvolution *evo,bool isLearning,configuration config);
    std::vector<std::vector<double> > step(double deltaTimeSeconds, std::vector<double> state);
    void endEpisode(std::vector<double> state);

private:
    int numberOfActions;
    int numberOfStates;
    int numberOfControllers;
    AnnealEvolution *annealEvo;
    std::vector< AnnealEvoMember *>currentControllers;
    std::vector<double> initialPosition;
    double errorOfFirstController;
    double totalTime;
};

#endif /* ANNEALADAPTER_H_ */


text:
package eu.ehealth.db.xsd;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 * Description of an external service (e.g. cognitive stimulation game)
 *
 *

 * Clase Java para ExternalService complex type.
 *
 *

 * El siguiente fragmento de esquema especifica el contenido que se espera que
 * haya en esta clase.
 *
 *

 * <complexType name="ExternalService">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="ID" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Description" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Address" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ExternalService", propOrder = { "id", "description",
		"address", "type" })
public class ExternalService
{

	@XmlElement(name = "ID", required = true)
	protected String id;
	@XmlElement(name = "Description", required = true)
	protected String description;
	@XmlElement(name = "Address", required = true)
	protected String address;
	@XmlElement(name = "Type", required = true)
	protected String type;

	/**
	 * Obtiene el valor de la propiedad id.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getID()
	{
		return id;
	}

	/**
	 * Define el valor de la propiedad id.
	 *
	 * @param value allowed object is {@link String }
	 *
	 */
	public void setID(String value)
	{
		this.id = value;
	}

	/**
	 * Obtiene el valor de la propiedad description.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getDescription()
	{
		return description;
	}

	/**
	 * Define el valor de la propiedad description.
	 *
	 * @param value allowed object is {@link String }
	 *
	 */
	public void setDescription(String value)
	{
		this.description = value;
	}

	/**
	 * Obtiene el valor de la propiedad address.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getAddress()
	{
		return address;
	}

	/**
	 * Define el valor de la propiedad address.
	 *
	 * @param value allowed object is {@link String }
	 *
	 */
	public void setAddress(String value)
	{
		this.address = value;
	}

	/**
	 * Obtiene el valor de la propiedad type.
	 *
	 * @return possible object is {@link String }
	 *
	 */
	public String getType()
	{
		return type;
	}

	/**
	 * Define el valor de la propiedad type.
	 *
	 * @param value allowed object is {@link String }
	 *
	 */
	public void setType(String value)
	{
		this.type = value;
	}

}


text:
from django.test import TestCase
from django.core.urlresolvers import resolve, reverse

class UrlsTest(TestCase):

    def setUp(self):

        # app URLs
        self.home_url = reverse('sift_home')

    def test_homepage_returns_correct_html(self):

        response = self.client.get(self.home_url)
        html = response.content.decode('utf8')

        self.assertEqual(response.status_code, 200)
        self.assertTrue(html.startswith('<!DOCTYPE html>'))
        self.assertIn('Ravesloot', html)
        self.assertTrue(html.endswith('</html>'))


text:
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * main.c
 * Copyright (C) 2012 furui <minto-furui@nifty.com>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name ``furui'' nor the name of any other
 *    contributor may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * markovschoenfinkelcurryuarchalgorithm IS PROVIDED BY furui ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL furui OR ANY OTHER CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
/*
 *
 * http://en.wikipedia.org/wiki/Markov_algorithm
 * http://en.wikipedia.org/wiki/SKI_combinator_calculus
 * http://en.wikipedia.org/wiki/Computer_architecture
 *
 */
/* computermarkovjrschoenfinkelarchitecture */
/*
 *
 * markovschoenfinkelcurryuarchalgorithm
 * computermarkovjrschoenfinkelarchitecture
 *
 * main.c
 *
 */

#include <stdio.h>

int markovschoenfinkelcurryuarchalgorithm(void);

int main()
{
	printf("Hello world\n");
	return (0);
}

int markovschoenfinkelcurryuarchalgorithm(void)
{
	char c;

	switch(c)
	{
		case 0x20:
		break;
		case '.':
		break;
		case '>':
		break;
		case '\"':
		break;
		default:
		break;
	}
	return (0);
}


text:
#ifndef STROMX_RUNTIME_DATACONTAINERTEST_H
#define STROMX_RUNTIME_DATACONTAINERTEST_H

#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestFixture.h>

namespace stromx
{
    namespace runtime
    {
        class DataContainer;

        class DataContainerTest : public CPPUNIT_NS :: TestFixture
        {
            CPPUNIT_TEST_SUITE (DataContainerTest);
            CPPUNIT_TEST (testDestroy);
            CPPUNIT_TEST (testDestroyDelayed);
            CPPUNIT_TEST (testCompare);
            CPPUNIT_TEST (testEmpty);
            CPPUNIT_TEST (testRelease);
            CPPUNIT_TEST_SUITE_END ();

        public:
                DataContainerTest() {}

                void setUp() {}
                void tearDown() {}

            protected:
                void testDestroy();
                void testDestroyDelayed();
                void testCompare();
                void testEmpty();
                void testRelease();
            private:
                void destroyDelayed(DataContainer & container);
        };
    }
}

#endif // STROMX_RUNTIME_DATACONTAINERTEST_H


text:
export EDITOR="emacsclient"
export ALTERNATE_EDITOR=

alias e='emacsclient'
alias E="SUDO_EDITOR=\"emacsclient -t -a emacs\" sudoedit"


text:
module Beta
  module Mutations
    class UpdateReview < Beta::Mutations::Base
      argument :review_id, ID, required: true
      argument :title, String, required: false
      argument :body, String, required: true
      WorkRecord::STATES.each do |state|
        argument state, Beta::Types::Enums::RatingState, required: true
      end
      argument :share_twitter, Boolean, required: false
      argument :share_facebook, Boolean, required: false

      field :review, Beta::Types::Objects::ReviewType, null: true

      def resolve(
        review_id:,
        body:,
        title: nil,
        rating_overall_state: nil,
        rating_animation_state: nil,
        rating_music_state: nil,
        rating_story_state: nil,
        rating_character_state: nil,
        share_twitter: nil,
        share_facebook: nil
      )
        raise Annict::Errors::InvalidAPITokenScopeError unless context[:doorkeeper_token].writable?

        viewer = context[:viewer]
        work_record = viewer.work_records.only_kept.find_by_graphql_id(review_id)
        work = work_record.work
        record = work_record.record
        oauth_application = context[:doorkeeper_token].application

        form = Forms::WorkRecordForm.new(user: viewer, record: record, work: work, oauth_application: oauth_application)
        form.attributes = {
          comment: body,
          rating_animation: rating_animation_state,
          rating_character: rating_character_state,
          rating_music: rating_music_state,
          rating_overall: rating_overall_state,
          rating_story: rating_story_state,
          share_to_twitter: share_twitter
        }

        if form.invalid?
          raise GraphQL::ExecutionError, form.errors.full_messages.first
        end

        result = Updaters::WorkRecordUpdater.new(
          user: viewer,
          form: form
        ).call

        {
          review: result.record.work_record
        }
      end
    end
  end
end


text:
<ion-modal-view class="ionic-select-modal" ng-class="::ui.modalClass">
    <ion-header-bar ng-class="::ui.headerFooterClass">

{{::ui.modalTitle}} MULTIPLE

    </ion-header-bar>
    <ion-content>

{{::ui.loadListMessage}}

                <ion-spinner></ion-spinner>

                <input type="checkbox" ng-model="isChecked[$index]">

    </ion-content>
    <ion-footer-bar ng-class="::ui.headerFooterClass">
        <button class="button button-stable" ng-click="closeModal()">{{ui.cancelButton}}</button>
        <button ng-if="::!ui.hideReset" class="button button-stable" ng-click="unsetValue()">{{ui.resetButton}}</button>
    </ion-footer-bar>
</ion-modal-view>


text:
<?php
/**
 * This <skripsi.husni.co.io> project created by :
 * Name         : syafiq
 * Date / Time  : 04 December 2016, 3:50 AM.
 * Email        : syafiq.rezpector@gmail.com
 * Github       : syafiqq
 */
use Carbon\Carbon;

defined('BASEPATH') OR exit('No direct script access allowed');

class Dashboard extends CI_Controller
{
    /**
     * Index Page for this controller.
     *
     * Maps to the following URL
     *        http://example.com/index.php/welcome
     *    - or -
     *        http://example.com/index.php/welcome/index
     *    - or -
     * Since this controller is set as the default controller in
     * config/routes.php, it's displayed at http://example.com/
     *
     * So any other public methods not prefixed with an underscore will
     * map to /index.php/welcome/<method_name>
     * @see https://codeigniter.com/user_guide/general/urls.html
     */

    public function __construct()
    {
        parent::__construct();
        $this->load->helper('url');
        $this->load->library('session');
        // Your own constructor code
    }

    public function index()
    {
        if (isset($_SESSION['user']['auth']))
        {
            switch ($_SESSION['user']['auth']['role'])
            {
                case 'student' :
                {
                    $this->index_user();
                }
                    return;
                case 'counselor' :
                {
                    $this->index_counselor();
                }
                    return;
            }
            redirect('/');
        }
        else
        {
            redirect('/');
        }
    }

    private function index_user()
    {
        $this->load->model('mstory');
        $storedStory = $this->mstory->getStoredStoryCount($_SESSION['user']['auth']['id']);
        $unfinishedStory = $this->mstory->getUnfinishedStoryCount($_SESSION['user']['auth']['id']);
        $sharedStory = $this->mstory->getSharedStoryCount($_SESSION['user']['auth']['id']);
        $storiesMetadata = $this->mstory->getAllStoriesMetadata($_SESSION['user']['auth']['id']);
        $this->load->view('dashboard/home/user', array(
            'user' => $_SESSION['user']['auth'],
            'year' => Carbon::now()->year,
            'storyTotal' => array(
                'stored' => $storedStory[0]['count'],
                'unfinished' => $unfinishedStory[0]['count'],
                'shared' => $sharedStory[0]['count']),
            'storiesMetadata' => $storiesMetadata
        ));
    }

    private function index_counselor()
    {
        $this->load->model('mstory');
        $this->load->model('mauth');
        $follower = $this->mstory->getFollower($_SESSION['user']['auth']['id']);
        $unreadStory = $this->mstory->getUnreadStory($_SESSION['user']['auth']['id']);
        $submittedStory = $this->mstory->getStorySubmitted($_SESSION['user']['auth']['id']);
        $storiesMetadata = $this->mstory->getAllSharedStoriesMetadata($_SESSION['user']['auth']['id']);
        foreach ($storiesMetadata as $key => $value)
        {
            $storiesMetadata[$key]['user'] = $this->mauth->getNameAndEmail($value['user'])[0];
        }
        $this->load->view('dashboard/home/counselor', array(
            'user' => $_SESSION['user']['auth'],
            'year' => Carbon::now()->year,
            'storyTotal' => array(
                'follow' => $follower[0]['count'],
                'unread' => $unreadStory[0]['count'],
                'shared' => $submittedStory[0]['count']),
            'storiesMetadata' => $storiesMetadata
        ));
    }
}


text:
title: Documentation
layout: doc
---
<!-- Note: No pull requests accepted for this file. See README.md in the root directory for details. -->
# Working with Plugins

Each plugin is a npm module with a name in the format of `eslint-plugin-<plugin-name>`, such as `eslint-plugin-jquery`.

## Create a Plugin

The module must export an object with a `rules` property.
This `rules` property should be an object containing a key-value mapping of rule ID to rule.
The rule ID does not have to follow any naming convention (so it can just be `dollar-sign`, for instance).

```js
module.exports = {
    rules: {
        "dollar-sign": function (context) {
            // rule implementation ...
        }
    }
};
```

### Processors in Plugins

You can also create plugins that would tell ESLint how to process files other then JavaScript. In order to create a
processor, object that is exported from your module has to conform to the following interface:

```js
processors: {

    // assign to the file extension you want (.js, .jsx, .html, etc.)
    ".ext": {
        // takes text of the file and filename
        preprocess: function(text, filename) {
            // here, you can strip out any non-JS content
            // and split into multiple strings to lint

            return [string];  // return an array of strings to lint
        },

        // takes an Message[][] and filename
        postprocess: function(messages, filename) {
            // messages is two-dimensional array of Message objects
            // where each array top-level are item are the lint messages related
            // to the text that was returned in an array in preprocess()

            // you need to return a one-dimensional array of the messages you want to keep
            return [Message];
        }
    }
}
```

The `preprocess` method takes the file contents and filename as arguments, and returns an array of strings to lint. The strings will be linted separately but still be registered to the filename. It's up to the plugin to decide if it needs to return just one part, or multiple pieces. For example in the case of processing `.html` files, you might want to return just one item in the array by combining all scripts, but for `.md` file where each JavaScript block might be independent, you can return multiple items.

The `postprocess` method takes a two-dimensional array of arrays of lint messages and the filename. Each item in the input
array corresponds to the part that was returned from the `preprocess` method. The `postprocess` method must adjust the location of all errors and aggregate them into a single flat array and return it.

You can have both rules and processor in a single plugin, you can also add multiple preprocessors in a the same plugin.
To support multiple extensions add each one to `preprocessors` element and point them to the same object.

### Default Configuration for Plugins

You can provide default configuration for the rules included in your plugin by modifying
exported object to include `rulesConfig` property. `rulesConfig` follows the same pattern as
you would use in your .eslintrc config `rules` property, but without plugin name as a prefix.

```js
module.exports = {
    rules: {
        "myFirstRule": require("./lib/rules/my-first-rule"),
        "mySecondRule": require("./lib/rules/my-second-rule")
    },
    rulesConfig: {
        "myFirstRule": 1,
        "mySecondRule": [2, "on"]
    }
};
```

### Peer Dependency

To make clear that the plugin requires ESLint to work correctly you have to declare ESLint as a `peerDependency` in your `package.json`.
The plugin support was introduced in ESLint version `0.8.0`. Ensure the `peerDependency` points to ESLint `0.8.0` or later.

```json
{
    "peerDependencies": {
        "eslint": ">=0.8.0"
    }
}
```

### Testing

You can test the rules of your plugin [the same way as bundled ESLint rules](working-with-rules) using [`ESLintTester`](https://github.com/eslint/eslint-tester).

Example:

```js
"use strict";

var linter = require("eslint").linter,
    ESLintTester = require("eslint-tester"),
    eslintTester = new ESLintTester(linter);

eslintTester.addRuleTest("lib/rules/custom-plugin-rule", {
    valid: [
        "var validVariable = true",
    ],

    invalid: [
        {
            code: "var invalidVariable = true",
            errors: [ { message: "Unexpected invalid variable." } ]
        }
    ]
});
```

## Share Plugins

In order to make your plugin available to the community you have to publish it on npm.

Recommended keywords:

* `eslint`
* `eslintplugin`

Add these keywords into your `package.json` file to make it easy for others to find.

## Further Reading

* [npm Developer Guide](https://www.npmjs.org/doc/misc/npm-developers.html)


text:
Use lenses to update nested records (specific to languages with immutable data).

Updating fields of nested records is kind of annoying in Haskell. One solution
is to use [lenses](https://wiki.haskell.org/Lens).  Implement several record
accessing functions using lenses, you may use any library you want. The test
suite also allows you to avoid lenses altogether so you can experiment with
different approaches.


text:
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
require('dotenv').load();

// Require keystone
var keystone = require('keystone');

// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options
// and documentation.

keystone.init({

	'name': '同济大学电子商务交易与信息服务协同创新中心',
	'brand': '电子商务交易与信息服务协同创新中心',
	'static': 'public',
	'favicon': 'public/favicon.ico',
	'views': 'templates/views',
	'view engine': 'jade',
	//'sass': 'public',
	'mongo':'mongodb://127.0.0.1/tjdzsw',
	'port': 8080,
    'emails': 'templates/emails',
	'compress':true,
	'auto update': true,
	'session': true,
	'auth': true,
	'user model': 'User',
	'cookie secret': ';6%J>oH}N)d5n31l>I327!``bA/=`S$V5;,bAbxryhT8#M-<hS+>ZbPVT{-;)?JG',

	//admin ui
	//'wysiwyg images':true,
	'wysiwyg images':true,
	'wysiwyg additional':'blockquote fullscreen'

});

// Load your project's Models

keystone.import('models');

// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js

keystone.set('locals', {
	_: require('underscore'),
	env: keystone.get('env'),
	utils: keystone.utils,
	editable: keystone.content.editable
});

// Load your project's Routes

keystone.set('routes', require('./routes'));

// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.

keystone.set('email locals', {
	logo_src: '/images/logo-email.gif',
	logo_width: 194,
	logo_height: 76,
	theme: {
		email_bg: '#f9f9f9',
		link_color: '#2697de',
		buttons: {
			color: '#fff',
			background_color: '#2697de',
			border_color: '#1a7cb7'
		}
	}
});

// Setup replacement rules for emails, to automate the handling of differences
// between development a production.

// Be sure to update this rule to include your site's actual domain, and add
// other rules your email templates require.

keystone.set('email rules', [{
	find: '/images/',
	replace: (keystone.get('env') == 'production') ? 'http://www.your-server.com/images/' : 'http://localhost:3000/images/'
}, {
	find: '/keystone/',
	replace: (keystone.get('env') == 'production') ? 'http://www.your-server.com/keystone/' : 'http://localhost:3000/keystone/'
}]);

// Load your project's email test routes

keystone.set('email tests', require('./routes/emails'));

// Configure the navigation bar in Keystone's Admin UI

keystone.set('nav', {
	'文章': ['posts', 'post-categories'],
	'图片集': 'galleries',
	'联系': 'enquiries',
	'用户': 'users'
});

// Start Keystone to connect to your database and initialise the web server

keystone.start();


text:
// Copyright 2017 the original author or authors.
//
// 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
//
// https://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.

using Consul;
using Moq;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
using HealthStatus = Steeltoe.Common.HealthChecks.HealthStatus;

namespace Steeltoe.Discovery.Consul.Discovery.Test
{
    public class ConsulHealthContributorTest
    {
        [Fact]
        public void Constructor_ThrowsIfNulls()
        {
            var clientMoq = new Mock<IConsulClient>();
            Assert.Throws<ArgumentNullException>(() => new ConsulHealthContributor(null, new ConsulDiscoveryOptions()));
            Assert.Throws<ArgumentNullException>(() => new ConsulHealthContributor(clientMoq.Object, (ConsulDiscoveryOptions)null));
        }

        [Fact]
        public async void GetLeaderStatusAsync_ReturnsExpected()
        {
            var statusResult = Task.FromResult("thestatus");
            var clientMoq = new Mock<IConsulClient>();
            var statusMoq = new Mock<IStatusEndpoint>();
            clientMoq.Setup(c => c.Status).Returns(statusMoq.Object);
            statusMoq.Setup(s => s.Leader(default(CancellationToken))).Returns(statusResult);

            var contrib = new ConsulHealthContributor(clientMoq.Object, new ConsulDiscoveryOptions());
            var result = await contrib.GetLeaderStatusAsync();
            Assert.Equal("thestatus", result);
        }

        [Fact]
        public async void GetCatalogServicesAsync_ReturnsExpected()
        {
            var queryResult = new QueryResult<Dictionary<string, string[]>>()
            {
                Response = new Dictionary<string, string[]>
                {
                    { "foo", new string[] { "I1", "I2" } },
                    { "bar", new string[] { "I1", "I2" } },
                }
            };

            var catResult = Task.FromResult(queryResult);
            var statusResult = Task.FromResult("thestatus");
            var clientMoq = new Mock<IConsulClient>();
            var catMoq = new Mock<ICatalogEndpoint>();
            clientMoq.Setup(c => c.Catalog).Returns(catMoq.Object);
            catMoq.Setup(c => c.Services(QueryOptions.Default, default(CancellationToken))).Returns(catResult);

            var contrib = new ConsulHealthContributor(clientMoq.Object, new ConsulDiscoveryOptions());
            var result = await contrib.GetCatalogServicesAsync();
            Assert.Equal(2, result.Count);
            Assert.Contains("foo", result.Keys);
            Assert.Contains("bar", result.Keys);
        }

        [Fact]
        public void Health_ReturnsExpected()
        {
            var queryResult = new QueryResult<Dictionary<string, string[]>>()
            {
                Response = new Dictionary<string, string[]>
                {
                    { "foo", new string[] { "I1", "I2" } },
                    { "bar", new string[] { "I1", "I2" } },
                }
            };

            var catResult = Task.FromResult(queryResult);
            var statusResult = Task.FromResult("thestatus");

            var clientMoq = new Mock<IConsulClient>();
            var catMoq = new Mock<ICatalogEndpoint>();
            var statusMoq = new Mock<IStatusEndpoint>();
            clientMoq.Setup(c => c.Status).Returns(statusMoq.Object);
            clientMoq.Setup(c => c.Catalog).Returns(catMoq.Object);
            statusMoq.Setup(s => s.Leader(default(CancellationToken))).Returns(statusResult);
            catMoq.Setup(c => c.Services(QueryOptions.Default, default(CancellationToken))).Returns(catResult);

            var contrib = new ConsulHealthContributor(clientMoq.Object, new ConsulDiscoveryOptions());
            var result = contrib.Health();

            Assert.Equal(HealthStatus.UP, result.Status);
            Assert.Equal(2, result.Details.Count);

            Assert.Contains("leader", result.Details.Keys);
            Assert.Contains("services", result.Details.Keys);
        }
    }
}


text:
/*add custom colour to panel - classes*/
.panel-test {
    border-color: #800020;
}

.panel-test > .panel-heading {
    color: #fff;
    background-color: #800020;
    border-color: #800020;
}

.panel-test > .panel-heading + .panel-collapse > .panel-body {
    border-top-color: #800020;
}

.panel-test > .panel-heading .badge {
    color: #800020;
    background-color: #fff;
}

.panel-test > .panel-footer + .panel-collapse > .panel-body {
    border-bottom-color: #800020;
}

/*remove gutter from grid system - gallery*/
.row.no-gutter {
    margin-left: 0;
    margin-right: 0;
}

.row.no-gutter [class*='col-']:not(:first-child),
.row.no-gutter [class*='col-']:not(:last-child) {
    padding-right: 0;
    padding-left: 0;
}

.email-wrap {
    word-wrap: break-word;
}


text:
package org.eclipse.bpel.ui.properties;

import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.ForEach;
import org.eclipse.bpel.ui.Messages;
import org.eclipse.bpel.ui.expressions.IEditorConstants;
import org.eclipse.core.resources.IMarker;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.swt.widgets.Composite;

/**
 * @author IBM
 * @author Michal Chmielewski (michal.chmielewski@oracle.com)
 * @date Jul 13, 2007
 *
 */
public class ForEachFinalCounterValueSection extends ExpressionSection {

	@Override
	protected String getExpressionType() {
		return IEditorConstants.ET_UNSIGNED_INT;
	}

	@Override
	protected Composite createNoEditorWidgets(Composite composite) {

		return super.createNoEditorWidgetsCreateComposite(composite,
			Messages.ForEachFinalCounterValuesSection_No_Expression_specified_1 + NL + NL +
			Messages.ForEachCounterValuesSection_Mandatory_Expression_2 ,

			Messages.ForEachCounterValuesSection_Create_a_New_Expression_3);
	}

	@Override
	protected EStructuralFeature getStructuralFeature (EObject object) {
		if (object instanceof ForEach) {
			return BPELPackage.eINSTANCE.getForEach_FinalCounterValue();
		}
		return super.getStructuralFeature(object);
	}

	/**
	 * Return true if the marker is valid for this section.
	 * @return true if so, false otherwise.
	 */
	@Override
	public boolean isValidMarker (IMarker marker ) {

		return false;
	}

	@Override
	protected void createClient(Composite parent) {
		this.title = Messages.ForEachFinalCounterValuesSection_TITLE_3;
		super.createClient(parent);
	}
}


text:
'use strict';

// Load modules

const ChildProcess = require('child_process');
const Fs = require('fs');

// Declare internals

const internals = {
    linter: __dirname + '/linter/index.js'
};

exports.lint = function (settings, callback) {

    const linterPath = (settings.linter && settings.linter !== 'eslint') ? settings.linter : internals.linter;

    let linterOptions;

    try {
        linterOptions = JSON.parse(settings['lint-options'] || '{}');
    }
    catch (err) {
        throw new Error('lint-options could not be parsed');
    }

    linterOptions.fix = settings['lint-fix'];

    const child = ChildProcess.fork(linterPath, [JSON.stringify(linterOptions)], { cwd: settings.lintingPath });
    child.once('message', (message) => {

        child.kill();

        const result = { lint: message, totalErrors: 0, totalWarnings: 0 };

        result.lint.forEach((lint) => {

            let errors = 0;
            let warnings = 0;

            lint.errors.forEach((err) => {

                if (err.severity === 'ERROR') {
                    errors++;
                }
                else {
                    warnings++;
                }
            });

            lint.totalErrors = errors;
            lint.totalWarnings = warnings;
            result.totalErrors += errors;
            result.totalWarnings += warnings;

            if (lint.fix) {
                Fs.writeFileSync(lint.filename, lint.fix.output);
            }
        });

        result.total = result.totalErrors + result.totalWarnings;

        return callback(null, result);
    });
};


text:
'''
modified from http://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html
'''

import gym
import math
import random
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from collections import namedtuple
from itertools import count
from copy import deepcopy
from PIL import Image

import torch
import torch.nn as nn
import torch.optim as optim
import torch.autograd as autograd
import torch.nn.functional as F
import torchvision.transforms as T

env = gym.make('CartPole-v0')

is_ipython = 'inline' in matplotlib.get_backend()
if is_ipython:
    from IPython import display

Transition = namedtuple('Transition',
                        ('state', 'action', 'next_state', 'reward'))

# stores previously explored
class ReplayMemory(object):

    def __init__(self, capacity):
        self.capacity = capacity
        self.memory = []
        self.position = 0

    def push(self, *args):
        """Saves a transition."""
        if len(self.memory) < self.capacity:
            self.memory.append(None)
        self.memory[self.position] = Transition(*args)
        self.position = (self.position + 1) % self.capacity

    def sample(self, batch_size):
        return random.sample(self.memory, batch_size)

    def __len__(self):
        return len(self.memory)

class DQN(nn.Module):

    def __init__(self):
        super(DQN, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=5, stride=2)
        self.bn1 = nn.BatchNorm2d(16)
        self.conv2 = nn.Conv2d(16, 32, kernel_size=5, stride=2)
        self.bn2 = nn.BatchNorm2d(32)
        self.conv3 = nn.Conv2d(32, 32, kernel_size=5, stride=2)
        self.bn3 = nn.BatchNorm2d(32)
        self.head = nn.Linear(448, 2)

    def forward(self, x):
        x = F.relu(self.bn1(self.conv1(x)))
        x = F.relu(self.bn2(self.conv2(x)))
        x = F.relu(self.bn3(self.conv3(x)))
        return self.head(x.view(x.size(0), -1))

#----------------------------------------------------------------
#   Training
#----------------------------------------------------------------

# sample resizing transform
resize = T.Compose([T.ToPILImage(),
                    T.Scale(40, interpolation=Image.CUBIC),
                    T.ToTensor()])

BATCH_SIZE = 128
GAMMA = 0.999
EPS_START = 0.9
EPS_END = 0.05
EPS_DECAY = 200
USE_CUDA = torch.cuda.is_available()

model = DQN()
memory = ReplayMemory(10000)
optimizer = optim.RMSprop(model.parameters())

if USE_CUDA:
    model.cuda()

class Variable(autograd.Variable):

    def __init__(self, data, *args, **kwargs):
        if USE_CUDA:
            data = data.cuda()
        super(Variable, self).__init__(data, *args, **kwargs)

steps_done = 0

def select_action(state):
    global steps_done
    sample = random.random()
    eps_threshold = EPS_END + (EPS_START - EPS_END) * \
        math.exp(-1. * steps_done / EPS_DECAY)
    steps_done += 1
    if sample > eps_threshold:
        return model(Variable(state, volatile=True)).data.max(1)[1].cpu()
    else:
        return torch.LongTensor([[random.randrange(2)]])

episode_durations = []

def plot_durations():
    plt.figure(1)
    plt.clf()
    durations_t = torch.Tensor(episode_durations)
    plt.xlabel('Episode')
    plt.ylabel('Duration')
    plt.plot(durations_t.numpy())
    # Take 100 episode averages and plot them too
    if len(durations_t) >= 100:
        means = durations_t.unfold(0, 100, 1).mean(1).view(-1)
        means = torch.cat((torch.zeros(99), means))
        plt.plot(means.numpy())
    if is_ipython:
        display.clear_output(wait=True)
        display.display(plt.gcf())

last_sync = 0

def optimize_model():
    global last_sync
    if len(memory) < BATCH_SIZE:
        return
    transitions = memory.sample(BATCH_SIZE)
    # Transpose the batch (see http://stackoverflow.com/a/19343/3343043 for
    # detailed explanation).
    batch = Transition(*zip(*transitions))

    # Compute a mask of non-final states and concatenate the batch elements
    non_final_mask = torch.ByteTensor(
        tuple(map(lambda s: s is not None, batch.next_state)))
    if USE_CUDA:
        non_final_mask = non_final_mask.cuda()
    # We don't want to backprop through the expected action values and volatile
    # will save us on temporarily changing the model parameters'
    # requires_grad to False!
    non_final_next_states = Variable(torch.cat([s for s in batch.next_state
                                                if s is not None]),
                                     volatile=True)
    state_batch = Variable(torch.cat(batch.state))
    action_batch = Variable(torch.cat(batch.action))
    reward_batch = Variable(torch.cat(batch.reward))

    # Compute Q(s_t, a) - the model computes Q(s_t), then we select the
    # columns of actions taken
    state_action_values = model(state_batch).gather(1, action_batch)

    # Compute V(s_{t+1}) for all next states.
    next_state_values = Variable(torch.zeros(BATCH_SIZE))
    next_state_values[non_final_mask] = model(non_final_next_states).max(1)[0]
    # Now, we don't want to mess up the loss with a volatile flag, so let's
    # clear it. After this, we'll just end up with a Variable that has
    # requires_grad=False
    next_state_values.volatile = False
    # Compute the expected Q values
    expected_state_action_values = (next_state_values * GAMMA) + reward_batch

    # Compute Huber loss
    loss = F.smooth_l1_loss(state_action_values, expected_state_action_values)

    # Optimize the model
    optimizer.zero_grad()
    loss.backward()
    for param in model.parameters():
        param.grad.data.clamp_(-1, 1)
    optimizer.step()

num_episodes = 10
for i_episode in range(num_episodes):
    # Initialize the environment and state
    env.reset()
    last_screen = get_screen()
    current_screen = get_screen()
    state = current_screen - last_screen
    for t in count():
        # Select and perform an action
        action = select_action(state)
        _, reward, done, _ = env.step(action[0, 0])
        reward = torch.Tensor([reward])

        # Observe new state
        last_screen = current_screen
        current_screen = get_screen()
        if not done:
            next_state = current_screen - last_screen
        else:
            next_state = None

        # Store the transition in memory
        memory.push(state, action, next_state, reward)

        # Move to the next state
        state = next_state

        # Perform one step of the optimization (on the target network)
        optimize_model()

        if done:
            episode_durations.append(t + 1)
            plot_durations()
            break


text:
layout: relation
title: 'det'
shortdef: 'determiner'
---

A determiner is the relation between the head of an NP and its determiner. The determiners in
Vietnamese are "những", "các", "mọi", "cả", "tất cả"... Beside, in Vietnamese, det also describe
dependencies between nouns with its pronoun , for example, "ấy", "kia", "này", "đó", "bây giờ" . . .
Meanwhile, we name this relationship is: det: pmod.

Trời mưa cả ngày 。
tmod(mưa, ngày)
det(ngày, cả)
nsubj(mưa, Trời)
punct(mưa, 。)

Anh này rất cao 。
det:pmod(Anh, này)
advmod(cao, rất)
nsubj(cao, Anh)
punct(cao, 。)


text:
module Main where

import Tutorial.Basic
import Tutorial.Array
import Tutorial.SimpleVector
import Tutorial.Vector
import Tutorial.Size
import Tutorial.Patch

-- Currently only testing compilation

main = return ()


text:
@**
* Yobi, Project Hosting SW
*
* Copyright 2012 NAVER Corp.
* http://yobi.io
*
* @author Hwi Ahn
*
* 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.
**@
@(message: String, currentPage: com.avaje.ebean.Page[Project], filter:String)

@import utils.TemplateHelper._

@siteMngLayout(message) {

@Messages("site.sidebar.projectList")

        <form class="form-search pull-right" action="@routes.SiteApp.projectList()">

                <input type="text" class="textbox" name="filter" placeholder="@Messages("site.project.filter")" value="@filter">
                <button type="submit" class="search-btn"></button>

        </form>

            @Messages("project.name")

            @Messages("project.description")

        @for(project <- currentPage.getList) {

                     @project.owner/@project.name

                    @project.owner/@project.name

              @project.overview

                <button class="ybtn ybtn-danger" data-project-name="@project.owner/@project.name" data-toggle="delete-project" data-href="@routes.SiteApp.deleteProject(project.id)">@Messages("button.delete")</button>

        }

    @** Confirm to delete project **@

            <button type="button" class="close" data-dismiss="modal">×</button>
            @Messages("site.project.delete")

@Messages("site.project.deleteConfirm")

            <button type="button" id="projectDeleteBtn" class="ybtn ybtn-danger" >@Messages("button.yes")</button>
            <button type="button" class="ybtn" data-dismiss="modal">@Messages("button.no")</button>

    @** // **@

}


text:
import {
  Component, View,
} from 'angular2/core';
import {
  CORE_DIRECTIVES,
  FORM_DIRECTIVES
} from 'angular2/common';

import {ButtonCheckbox, ButtonRadio} from '../../../ng2-bootstrap';

// webpack html imports
let template = require('./buttons-demo.html');

@Component({
  selector: 'buttons-demo'
})
@View({
  template: template,
  directives: [
    ButtonCheckbox, ButtonRadio,
    CORE_DIRECTIVES, FORM_DIRECTIVES
  ]
})
export class ButtonsDemo {
  private singleModel:string = '1';
  private radioModel:string = 'Middle';
  public checkModel:any = {left: false, middle: true, right: false};
}


text:
import Pyro5.api
import chain

this_node = "C"
next_node = "A"

servername = "example.chain." + this_node

with Pyro5.api.Daemon() as daemon:
    obj = chain.Chain(this_node, next_node)
    uri = daemon.register(obj)
    with Pyro5.api.locate_ns() as ns:
        ns.register(servername, uri)

    # enter the service loop.
    print("Server started %s" % this_node)
    daemon.requestLoop()


text:
layout: post
date:	2007-09-27 08:54:00
title:  The two are different..
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
Age is one thing, maturity quite another.

When will I get the maturity to accept the things that have bothered me....friendships that are over, lack of understanding from even close ones sometimes, the fact that dead people will never be around again...what should be simple to accept is NOT.

I keep trying to grow as a person, but with such limited success. Calmness vanishes, emotions rule, I lose my peace of mind.

Truly, the most difficult conquests are those within ourselves.


text:
from __future__ import absolute_import

from datetime import timedelta
from django.db import models
from django.utils import timezone

from sentry.utils.cache import cache
from sentry.db.models import BoundedPositiveIntegerField, FlexibleForeignKey, Model, sane_repr

class ReleaseProjectEnvironment(Model):
    __core__ = False

    release = FlexibleForeignKey("sentry.Release")
    project = FlexibleForeignKey("sentry.Project")
    environment = FlexibleForeignKey("sentry.Environment")
    new_issues_count = BoundedPositiveIntegerField(default=0)
    first_seen = models.DateTimeField(default=timezone.now)
    last_seen = models.DateTimeField(default=timezone.now, db_index=True)
    last_deploy_id = BoundedPositiveIntegerField(null=True, db_index=True)

    class Meta:
        app_label = "sentry"
        db_table = "sentry_releaseprojectenvironment"
        unique_together = (("project", "release", "environment"),)

    __repr__ = sane_repr("project", "release", "environment")

    @classmethod
    def get_cache_key(cls, release_id, project_id, environment_id):
        return u"releaseprojectenv:{}:{}:{}".format(release_id, project_id, environment_id)

    @classmethod
    def get_or_create(cls, release, project, environment, datetime, **kwargs):
        cache_key = cls.get_cache_key(project.id, release.id, environment.id)

        instance = cache.get(cache_key)
        if instance is None:
            instance, created = cls.objects.get_or_create(
                release=release,
                project=project,
                environment=environment,
                defaults={"first_seen": datetime, "last_seen": datetime},
            )
            cache.set(cache_key, instance, 3600)
        else:
            created = False

        # Same as releaseenvironment model. Minimizes last_seen updates to once a minute
        if not created and instance.last_seen < datetime - timedelta(seconds=60):
            cls.objects.filter(
                id=instance.id, last_seen__lt=datetime - timedelta(seconds=60)
            ).update(last_seen=datetime)
            instance.last_seen = datetime
            cache.set(cache_key, instance, 3600)
        return instance


text:
class ChromeContentRendererClient;

namespace autofill {
class AutofillAgent;
class TestPasswordAutofillAgent;
class PasswordGenerationAgent;
class AutofillAssistantAgent;
}  // namespace autofill

class ChromeRenderViewTest : public content::RenderViewTest {
 public:
  ChromeRenderViewTest();
  ~ChromeRenderViewTest() override;

 protected:
  // testing::Test
  void SetUp() override;
  void TearDown() override;
  content::ContentClient* CreateContentClient() override;
  content::ContentBrowserClient* CreateContentBrowserClient() override;
  content::ContentRendererClient* CreateContentRendererClient() override;

  // Called from SetUp(). Override to register mojo interfaces.
  virtual void RegisterMainFrameRemoteInterfaces();

  // Initializes commonly needed global state and renderer client parts.
  // Use when overriding CreateContentRendererClient.
  void InitChromeContentRendererClient(ChromeContentRendererClient* client);

  void WaitForAutofillDidAssociateFormControl();

  autofill::TestPasswordAutofillAgent* password_autofill_agent_ = nullptr;
  autofill::PasswordGenerationAgent* password_generation_ = nullptr;
  autofill::AutofillAssistantAgent* autofill_assistant_agent_ = nullptr;
  autofill::AutofillAgent* autofill_agent_ = nullptr;

  std::unique_ptr<service_manager::BinderRegistry> registry_;
  blink::AssociatedInterfaceRegistry associated_interfaces_;

  // Naked pointer as ownership is with content::RenderViewTest::render_thread_.
  ChromeMockRenderThread* chrome_render_thread_ = nullptr;
};

#endif  // CHROME_TEST_BASE_CHROME_RENDER_VIEW_TEST_H_


text:
''' Implementation of the BC Hydro model'''
import numpy as np
import itertools
import model

def interpolateSpectra(spectra1 , spectra2 , period1, period2, period):
    slope = (spectra2 - spectra1)/(np.log10(period2) - np.log10(period1))
    return spectra1 + slope*(np.log10(period) - np.log10(period1))

def fixPeriods(augmentedSpectra, periods, augmentedPeriods):
    fixedSpectra = np.zeros((augmentedSpectra.shape[0], periods.shape[0]))
    sortedAugmented = sorted(augmentedPeriods)

    for i, per in enumerate(periods):
        if per in augmentedPeriods:
            fixedSpectra[:, i] = augmentedSpectra[:, 0]
            fixedSpectra[:, i] = augmentedSpectra[:, np.nonzero(augmentedPeriods == per)[0][0]]
        else:
            idxLow = np.nonzero(sortedAugmented < per)[0][-1]
            perLow = sortedAugmented[idxLow]
            idxLow = np.nonzero(augmentedPeriods == perLow)[0][0]

            idxHigh = np.nonzero(sortedAugmented > per)[0][0]
            perHigh = sortedAugmented[idxHigh]
            idxHigh = np.nonzero(augmentedPeriods == perHigh)[0][0]

            fixedSpectra[:, i] = interpolateSpectra(augmentedSpectra[:, idxLow] , augmentedSpectra[:, idxHigh] , augmentedPeriods[idxLow] , augmentedPeriods[idxHigh] , per)
    return fixedSpectra

def augmentPeriods(periods):
    availablePeriods = np.array([0.01, 0.07, 0.09, 0.11, 0.14, 0.18, 0.22, 0.27, 0.34, 0.42, 0.53, 0.65, 0.81, 1.01, 1.25, 1.56, 1.92, 2.44, 3.03, 3.7, 4.55, 5.88, 7.14, 9.09])
    modifiedPeriods = []
    for period in periods:
        if period in availablePeriods:
            modifiedPeriods.append(period)
        else:
            idxLow = np.nonzero(availablePeriods < period)[0][-1]
            modifiedPeriods.append(availablePeriods[idxLow])
            idxHigh = np.nonzero(availablePeriods > period)[0][0]
            modifiedPeriods.append(availablePeriods[idxHigh])
    return modifiedPeriods

def spectra(M, Rrup, Faba, Vs30, cascadia, epistemic, periods):
    periods = np.array(periods)
    idx = np.nonzero(periods <= 0.01)[0]
    periods[idx] = 0.01 # Periods less than eq to 0.01 are essentially pga. Setting this allows us to avoid errors while interpolating in log-log scale.
    augmentedPeriods = augmentPeriods(periods)

    R = Rrup
    nRow = len(M)
    nCol = len(augmentedPeriods)

    M = np.array([M] * nCol).transpose()
    R = np.array([R] * nCol).transpose()
    Faba = np.array([Faba] * nCol).transpose()
    Vs30 = np.array([Vs30] * nCol).transpose()
    cascadia = np.array([cascadia] * nCol).transpose()

    augmentedPeriods = np.array([augmentedPeriods] * nRow)

    augmentedSpectra = np.array([[model.computeSpectra(mag, r, faba, vs, cas, epistemic, per) for mag, r, faba, vs, cas, per in itertools.izip(mags, rs, fabas, vss, cass, pers)] for mags, rs, fabas, vss, cass, pers in itertools.izip(M, R, Faba, Vs30, cascadia, augmentedPeriods)])

    fixedSpectra = fixPeriods(augmentedSpectra, periods, augmentedPeriods[0])

    # convert to cm/s/s
    fixedSpectra = 10**fixedSpectra

    intraEventSigma = model.intraEventSigma(periods) * nRow
    interEventSigma = model.interEventSigma(periods) * nRow

    return fixedSpectra.tolist(), intraEventSigma, interEventSigma


text:
local modules = NazaraModules

-- defined at the end of the file
local headerTemplate, inlineTemplate, sourceTemplate

task("create-class")

set_menu({
	-- Settings menu usage
	usage = "xmake create-class [options] name",
	description = "Check every file for consistency (can fix some errors)",
	options =
	{
		-- Set k mode as key-only bool parameter
		{nil, "nocpp", "k", nil, "Set this if you don't want a .cpp to be created (header-only classes)" },
		{'m', "module", "v", nil, "Module where the class should be created" },
		{nil, "name", "v", nil, "Class name" }
	}
})

on_run(function ()
	import("core.base.option")

	local moduleName = option.get("module")
	if not moduleName then
		os.raise("missing module name")
	end

	local classPath = option.get("name")
	if not classPath then
		os.raise("missing class name")
	end

	local module = modules[moduleName]
	if not module then
		os.raise("unknown module " .. moduleName)
	end

	local className = path.basename(classPath)

	local files = {
		{ TargetPath = path.join("include", "Nazara", moduleName, classPath) .. ".hpp", Template = headerTemplate },
		{ TargetPath = path.join("include", "Nazara", moduleName, classPath) .. ".inl", Template = inlineTemplate }
	}

	if not option.get("nocpp") then
		table.insert(files, { TargetPath = path.join("src", "Nazara", moduleName, classPath) .. ".cpp", Template = sourceTemplate })
	end

	local replacements = {
		CLASS_NAME = className,
		CLASS_PATH = classPath,
		COPYRIGHT = os.date("%Y") .. [[ Jérôme "Lynix" Leclercq (lynix680@gmail.com)]],
		HEADER_GUARD = "NAZARA_" .. moduleName:upper() .. "_" .. classPath:gsub("[/\\]", "_"):upper() .. "_HPP",
		MODULE_API = "NAZARA_" .. moduleName:upper() .. "_API",
		MODULE_NAME = moduleName,
	}

	for _, file in pairs(files) do
		local content = file.Template:gsub("%%([%u_]+)%%", function (kw)
			local r = replacements[kw]
			if not r then
				os.raise("missing replacement for " .. kw)
			end

			return r
		end)

		io.writefile(file.TargetPath, content)
	end
end)

headerTemplate = [[
// Copyright (C) %COPYRIGHT%
// This file is part of the "Nazara Engine - %MODULE_NAME% module"
// For conditions of distribution and use, see copyright notice in Config.hpp

#pragma once

#ifndef %HEADER_GUARD%
#define %HEADER_GUARD%

#include <Nazara/Prerequisites.hpp>
#include <Nazara/%MODULE_NAME%/Config.hpp>

namespace Nz
{
	class %MODULE_API% %CLASS_NAME%
	{
		public:
			%CLASS_NAME%() = default;
			%CLASS_NAME%(const %CLASS_NAME%&) = delete;
			%CLASS_NAME%(%CLASS_NAME%&&) = delete;
			~%CLASS_NAME%() = default;

			%CLASS_NAME%& operator=(const %CLASS_NAME%&) = delete;
			%CLASS_NAME%& operator=(%CLASS_NAME%&&) = delete;

		private:
	};
}

#include <Nazara/%MODULE_NAME%/%CLASS_PATH%.inl>

#endif // %HEADER_GUARD%
]]

inlineTemplate = [[
// Copyright (C) %COPYRIGHT%
// This file is part of the "Nazara Engine - %MODULE_NAME% module"
// For conditions of distribution and use, see copyright notice in Config.hpp

#include <Nazara/%MODULE_NAME%/%CLASS_PATH%.hpp>
#include <Nazara/%MODULE_NAME%/Debug.hpp>

namespace Nz
{
}

#include <Nazara/%MODULE_NAME%/DebugOff.hpp>
]]

sourceTemplate = [[
// Copyright (C) %COPYRIGHT%
// This file is part of the "Nazara Engine - %MODULE_NAME% module"
// For conditions of distribution and use, see copyright notice in Config.hpp

#include <Nazara/%MODULE_NAME%/%CLASS_PATH%.hpp>
#include <Nazara/%MODULE_NAME%/Debug.hpp>

namespace Nz
{
}
]]


text:
package org.locationtech.geomesa.utils.geotools

import org.junit.runner.RunWith
import org.locationtech.jts.geom.Geometry
import org.opengis.feature.simple.SimpleFeature
import org.specs2.mock.Mockito
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner

import scala.collection.JavaConverters._

@RunWith(classOf[JUnitRunner])
class ConversionsTest extends Specification with Mockito {

  sequential

  "RichSimpleFeature" should {

    import Conversions.RichSimpleFeature

    val sf = mock[SimpleFeature]

    "support implicit conversion" >> {
      val rsf: RichSimpleFeature = sf
      success
    }

    "be able to access default geometry" >> {
      val geo = mock[Geometry]
      sf.getDefaultGeometry returns geo

      sf.geometry mustEqual geo
    }

    "throw exception if defaultgeometry is not a Geometry" >> {
      sf.getDefaultGeometry returns "not a Geometry!"

      sf.geometry must throwA[ClassCastException]
    }

    "provide type safe access to user data" >> {

      val expected: Integer = 5

      val userData = Map[AnyRef, AnyRef]("key" -> expected).asJava
      sf.getUserData returns userData

      "when type is correct" >> {

        val result = sf.userData[Integer]("key")
        result must beSome(expected)
      }

      "or none when type is not correct" >> {

        val result = sf.userData[String]("key")
        result must beNone
      }

      "or none when value does not exist" >> {

        val result: Option[String] = sf.userData[String]("foo")
        result must beNone
      }
    }
  }

  "RichSimpleFeatureType" should {

    import RichSimpleFeatureType.RichSimpleFeatureType

    def newSft = SimpleFeatureTypes.createType("test", "dtg:Date,*geom:Point:srid=4326")
    "support implicit conversion" >> {
      val sft = newSft
      val rsft: RichSimpleFeatureType = sft
      success
    }

    "set and get table sharing boolean" >> {
      val sft = newSft
      sft.getUserData.put(SimpleFeatureTypes.Configs.TableSharing, "true")
      sft.isTableSharing must beTrue
    }

    "provide type safe access to user data" >> {

      val expected: Integer = 5

      val sft = newSft
      sft.getUserData.put("key", expected)

      "when type is correct" >> {
        val result = sft.userData[Integer]("key")
        result must beSome(expected)
      }

      "or none when value does not exist" >> {
        val result: Option[String] = sft.userData[String]("foo")
        result must beNone
      }
    }

  }
}


text:
<?php

class Google_Service_YouTube_ChannelSectionSnippet extends Google_Model
{
  public $channelId;
  public $defaultLanguage;
  protected $localizedType = 'Google_Service_YouTube_ChannelSectionLocalization';
  protected $localizedDataType = '';
  public $position;
  public $style;
  public $title;
  public $type;

  public function setChannelId($channelId)
  {
    $this->channelId = $channelId;
  }
  public function getChannelId()
  {
    return $this->channelId;
  }
  public function setDefaultLanguage($defaultLanguage)
  {
    $this->defaultLanguage = $defaultLanguage;
  }
  public function getDefaultLanguage()
  {
    return $this->defaultLanguage;
  }
  public function setLocalized(Google_Service_YouTube_ChannelSectionLocalization $localized)
  {
    $this->localized = $localized;
  }
  public function getLocalized()
  {
    return $this->localized;
  }
  public function setPosition($position)
  {
    $this->position = $position;
  }
  public function getPosition()
  {
    return $this->position;
  }
  public function setStyle($style)
  {
    $this->style = $style;
  }
  public function getStyle()
  {
    return $this->style;
  }
  public function setTitle($title)
  {
    $this->title = $title;
  }
  public function getTitle()
  {
    return $this->title;
  }
  public function setType($type)
  {
    $this->type = $type;
  }
  public function getType()
  {
    return $this->type;
  }
}


text:
<?php

namespace CashMoney\Data\Model;

class Payment implements \JsonSerializable {

	private $debtor;
	private $lender;
	private $amount;
	private $isPaid = false;

	public function __construct(User $debtor, User $lender, $amount) {
		$this->debtor = $debtor;
		$this->lender = $lender;
		$this->amount = $amount;
	}

	public function jsonSerialize() {
		return [
			'debtor' => $this->debtor,
			'lender' => $this->lender,
			'amount' => $this->amount,
			'isPaid' => $this->isPaid,
		];
	}

	public function getDebtor() {
		return $this->debtor;
	}
	public function setDebtor(User $debtor) {
		$this->debtor = $debtor;
	}

	public function getLender() {
		return $this->lender;
	}
	public function setLender(User $lender) {
		$this->lender = $lender;
	}

	public function getAmount() {
		return $this->amount;
	}
	public function setAmount($amount) {
		$this->amount = $amount;
	}

	public function getIsPaid() {
		return $this->isPaid;
	}
	public function setIsPaid($isPaid) {
		$this->isPaid = $isPaid;
	}
}


text:
(function () {

"use strict";

var AppResources = FlynnDashboard.Stores.AppResources = FlynnDashboard.Store.createClass({
	displayName: "Stores.AppResources",

	getState: function () {
		return this.state;
	},

	willInitialize: function () {
		this.props = {
			appId: this.id.appId
		};
	},

	didInitialize: function () {},

	didBecomeActive: function () {
		this.__fetchResources();
	},

	getInitialState: function () {
		return {
			resources: [],
			fetched: false
		};
	},

	handleEvent: function () {
	},

	__fetchResources: function () {
		return FlynnDashboard.client.getAppResources(this.props.appId).then(function (args) {
			var res = args[0];
			if (res === "null") {
				res = [];
			}
			this.setState({
				resources: res || [],
				fetched: true
			});
		}.bind(this));
	}

}, Marbles.State);

AppResources.registerWithDispatcher(FlynnDashboard.Dispatcher);

})();


text:
package com.lavandadelpatio.repository;

import com.lavandadelpatio.model.Person;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;
import java.util.List;

/**
 * Created by poltatil on 3/03/17.
 */
public interface PersonRepository extends JpaRepository<Person, Long> {

    List<Person> findByFirstName(String firstname);

    List<Person> findByLastName(String lastname);

    List<Person> findByDatePerson(Date datePerson);

    List<Person> findByNationality(String nationality);

    Page<Person> findByFirstName(Person person,Pageable page);

}


text:
package controllersUser

import (
	"net/http"
	"net/http/httptest"
	"testing"

	_ "github.com/wheatandcat/dotstamp_server/routers"
	"github.com/wheatandcat/dotstamp_server/tests"

	"github.com/astaxie/beego"
	. "github.com/smartystreets/goconvey/convey"
)

func setUpUpload() {
	test.Setup()

	test.SetupFixture([]string{
		"user_profile_images",
	})
}

func TestUpload(t *testing.T) {
	setUpUpload()

	r, err := http.NewRequest(
		"POST",
		"/api/profile/",
		nil,
	)

	if err != nil {
		panic(err)
	}

	r.Header.Set("Content-Type", "application/json")

	w := httptest.NewRecorder()
	beego.BeeApp.Handlers.ServeHTTP(w, r)

	Convey("/profile/\n", t, func() {
		Convey("Status Code Should Be 200", func() {
			So(w.Code, ShouldEqual, 200)
		})
		Convey("The Result Should Not Be Empty", func() {
			So(w.Body.Len(), ShouldBeGreaterThan, 0)
		})
	})
}


text: Backbone testing app


text:
id: 122
title: CV
date: 2015-08-08T00:02:43+00:00
author: cmonagle
layout: page
---
This is also available in [PDF format](/assets/docs/cv.pdf)

### Web Developer at CleverToday
 _October 2015 – November 2016_

I work in various development environments integrating the front-end of web applications. Platforms vary from Node.js to WordPress to Django. I have also dabbled in back-end development, using test driven development to produce a RESTful API with Node.js and MongoDB. I collaborate closely with both designers and back end developers to deliver pixel-perfect and performant web applications in tight timeframes.

### Freelance Web Developer with Campaign Gears
 _September 2015 – Present_

Worked on several projects for clients in associative sector, often integrating with NationBuilder. Responsible for both front and back end components, including developing a RESTful API and a pure javascript front end to help connect constituents with the elected officials.

### Web Developer at Semaphore Campaigns
 _2015 – 2016_

In 2015, in collaboration with some very talented colleagues, I founded Semaphore Campaigns, a cooperative that brings together professionals from several domains: political organizing, web development, graphic design, and communications. I lead the web development side of most projects, and am sometimes responsible for project management.

### Translator and Web/Graphic Designer at Fédération étudiante universitaire du Québec (FEUQ)
_July 2014 – May 2015_

Responsible for translating substantial quantities of research and policy content from French to English, ensuring the quality of English language communications, producing material and developing the visual identity of the Federation. The largest project that year was redeveloping a bilingual, mobile-first WordPress website featuring a clean design and fast performance.

### Student Affairs Coordinator at FEUQ
_May 2012 – May 2013_

Responsible for coordinating communication with student associations, mobilization, social media, the web site and organizing events.

I developed three websites for the organization during my mandate, including a Drupal and CiviCRM based get out the vote platform.

## Skills and technologies

* Server side
    * BASH and basic server management
    * PHP (WordPress)
    * Python (Django)
    * Node.js
    * SQL and MongoDB basics
* Front end
    * Graphic design (Photoshop, InDesign, Illustrator)
    * Clean, well-crafted and semantic HTML.
    * Templating languages (Twig, Liquid)
    * CSS/SCSS
    * Gulp
    * Angular.js
* Soft Skills
    * Well organized
    * Campaigns management
    * Comfortable working with clients
    * Familiar with agile methodology
    * Bilingual (French and English)

## Volunteer Experience

**Union Representative at Concordia Student Union** – _May 2011 – May 2012_

**Governor on Board of Governors at Concordia University** – _June 2011 – August 2012_

## Certifications

NationBuilder Expert

## Education

**Concordia University**
_Bachelor's Degree, 2009 – 2013_

Activities and Societies: Sat on the boards of student association (CSU) and the University. Worked in Residence life, organised Alternative Spring Break Program, involved in various student initiatives and projects.

**Manchester Community College**
_Associate's Degree, Liberal Arts, 2009 – 2009_

## Languages

English and French  – Proficient


text:
/*Example 1.*/

.example-enter {
  opacity: 0.01;
}

.example-enter.example-enter-active {
  opacity: 1;
  transition: opacity .5s ease-in;
}
.example-leave {
  opacity: 1;
}

.example-leave.example-leave-active {
  opacity: 0.01;
  transition: opacity .5s ease-in;
}

/*Example 2.*/

.exampletwo-enter {
  opacity: 0.01;
}

.exampletwo-enter.exampletwo-enter-active {
  opacity: 1;
  transition: opacity .5s ease-in;
}
.exampletwo-leave {
  opacity: 1;
}

.exampletwo-leave.exampletwo-leave-active {
  opacity: 0.01;
  transition: opacity .5s ease-in;
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.fluent.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** scheduleChangeState. */
public final class MicrosoftGraphScheduleChangeState extends ExpandableStringEnum<MicrosoftGraphScheduleChangeState> {
    /** Static value pending for MicrosoftGraphScheduleChangeState. */
    public static final MicrosoftGraphScheduleChangeState PENDING = fromString("pending");

    /** Static value approved for MicrosoftGraphScheduleChangeState. */
    public static final MicrosoftGraphScheduleChangeState APPROVED = fromString("approved");

    /** Static value declined for MicrosoftGraphScheduleChangeState. */
    public static final MicrosoftGraphScheduleChangeState DECLINED = fromString("declined");

    /** Static value unknownFutureValue for MicrosoftGraphScheduleChangeState. */
    public static final MicrosoftGraphScheduleChangeState UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue");

    /**
     * Creates or finds a MicrosoftGraphScheduleChangeState from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding MicrosoftGraphScheduleChangeState.
     */
    @JsonCreator
    public static MicrosoftGraphScheduleChangeState fromString(String name) {
        return fromString(name, MicrosoftGraphScheduleChangeState.class);
    }

    /**
     * Gets known MicrosoftGraphScheduleChangeState values.
     *
     * @return known MicrosoftGraphScheduleChangeState values.
     */
    public static Collection<MicrosoftGraphScheduleChangeState> values() {
        return values(MicrosoftGraphScheduleChangeState.class);
    }
}


text:
#ifndef GRAPHLAB_RANDOM_HPP
#define GRAPHLAB_RANDOM_HPP

#include <graphlab/parallel/pthread_tools.hpp>

namespace graphlab {

  /**
   * A collection of thread safe random number routines.  Each thread
   * is assigned its own generator.
   */
  struct random {

    /**
     * Generate a thread specific random number between 0 and 1
     */
    static double rand01() {
      return thread::get_thread_specific_data().rand01();
    }

    /**
     * Generate a thread specific random integer between 0 and max inclusive
     */
    static size_t rand_int(size_t max) {
      return thread::get_thread_specific_data().rand_int(max);
    }

    /**
     * Seed the random number generator.  Note that the engine
     * automatically seeds the number generators.
     */
    static void seed(size_t value) {
      thread::get_thread_specific_data().seed(value);
    }

    /** Seed the random number generator with the default seed */
    static void seed() {
      thread::get_thread_specific_data().seed();
    }
  }; // end of random
} // end of graphlab

#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2018 Information & Computational Sciences, The James Hutton Institute
  ~
  ~ 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.
  -->

<android.support.v7.widget.CardView
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	android:foreground="?android:attr/selectableItemBackground"
	android:focusable="true"
	android:clickable="true"
	app:cardPreventCornerOverlap="false"
	android:layout_width="match_parent"
	android:layout_height="wrap_content">

	<LinearLayout
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:orientation="horizontal">
		<ImageView
			android:id="@+id/node_catalog_image"
			android:layout_width="0dp"
			android:layout_height="match_parent"
			android:layout_weight=".3"
			android:scaleType="centerCrop"
			android:adjustViewBounds="true"/>

		<LinearLayout
			android:layout_width="0dp"
			android:layout_weight=".7"
			android:layout_height="wrap_content"
			android:layout_marginLeft="@dimen/activity_horizontal_margin"
			android:layout_marginStart="@dimen/activity_horizontal_margin"
			android:layout_marginRight="@dimen/activity_horizontal_margin"
			android:layout_marginEnd="@dimen/activity_horizontal_margin"
			android:layout_marginTop="@dimen/activity_vertical_margin"
			android:layout_marginBottom="@dimen/activity_vertical_margin"
			android:gravity="start"
			android:orientation="vertical">

			<TextView
				android:id="@+id/node_catalog_name"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:textColor="@android:color/primary_text_light"
				android:ellipsize="marquee"/>

			<!--<TextView-->
			<!--android:id="@+id/node_catalog_description"-->
			<!--android:layout_width="match_parent"-->
			<!--android:layout_height="wrap_content"-->
			<!--android:textColor="@android:color/secondary_text_light"-->
			<!--android:ellipsize="marquee"-->
			<!--android:singleLine="true"/>-->

		</LinearLayout>
	</LinearLayout>

</android.support.v7.widget.CardView>


text:
/* fat.h
* FAT32 driver
*/

#ifndef _letkuos_fat_h
#define _letkuos_fat_h _letkuos_fat_h

#include "ata.h"
#include "fs.h"
#include "letkuos-common.h"

void fat_scan(struct partition *part);
int fat_readdir(int sector);
unsigned int fat_parse_path(char *path);
unsigned int fat_findcluster(char *file, unsigned int cluster);
unsigned int fat_cluster2sector(unsigned int cluster);
int follow_clusterchain(unsigned int cluster);
unsigned int get_cluster_value(unsigned int cluster);
unsigned int fat_cluster2sector(unsigned int cluster);
int fat_loadfile(char *filename);
int fat_populate_entry(file_entry *pointer, char *filename);
int debug_showfat(int fatpage);
/* from osdev.org wiki, adapted a bit */
/* also from http://support.microsoft.com/kb/q140418 */
/* FAT Boot record, always at block 0 of the partition */
struct fat32_BS {
	// BPB - Bios Paramater Block
        unsigned char           bootjmp[3];
        unsigned char           oem_name[8];	// meaningless according to specs
        unsigned short          bytes_per_sector; // we expect it to be 512
        unsigned char           sectors_per_cluster;
        unsigned short          reserved_sector_count; // sectors before the first FAT
        unsigned char           FAT_count;	// number of FAT's, probably 2
        unsigned short          root_entry_count;	// ??
        unsigned short          total_sectors_16;	// if 0, the real count is in byte 32-35
        unsigned char           media_type;		// physical media descriptor, we don't care
        unsigned short          sectors_per_fat16;	// sectors per fat, FAT12/16 only. Meaningless
        unsigned short          sectors_per_track;	// ??
        unsigned short          head_side_count;	// physical media stuff, we don't care
        unsigned int            hidden_sector_count;	// used to calculate absolute offset to root directory
        unsigned int            total_sectors_32;	// if total_sectors16 is 0
        // EBPB, extended bios parameter block stuff for FAT32, not for FAT12/16
// for testing if it's a FAT12 instead of FAT32:
//	unsigned char		signature[3];
        unsigned int		sectors_per_fat;	// size of FAT in sectors
	unsigned short		flags;			// some flags
	unsigned short		fat_version;		// fat version number
	unsigned int		root_cluster;		// relative cluster for the root dir, probably 2
	unsigned short		fsinfo_cluster;		// relative cluster for FSinfo struct
	unsigned short		backup_cluster;		// relative cluster for backup boot sector
	unsigned char		reserved[12];		// should be zero?
	unsigned char		drive_num;		// 0x80 for a hard disk, 0x00 for floppies
        unsigned char           reserved1;		// windows NT flags
        unsigned char           boot_signature;		// must be 0x28 or 0x29 for Windows NT
        unsigned int            volume_id;		// random id of the disk - can be ignored
        unsigned char           unused_volume_label[11];// nowadays volume label is in the rootdir
        unsigned char           fat_type_label[8];	// "FAT32   ", but should not be needed
} __attribute__((packed));

struct dir_struct {
        unsigned char           file_name[11];
        unsigned char           file_attr;
        unsigned char           reserv1;
        unsigned char           time_created_tens;
        unsigned short          time_created;
        unsigned short          date_created;
        unsigned short          date_accessed;
        unsigned short          cluster_number_hi;
        unsigned short          time_modified;
        unsigned short          date_modified;
        unsigned short          cluster_number_lo;
        unsigned int            file_size;
} __attribute__((packed)) dir_struct;

/* FAT directory attributes */

/* define FAT directory entry attributes */
#define FAT_ATTR_readonly	0x01
#define FAT_ATTR_hidden		0x02
#define FAT_ATTR_system		0x04
#define FAT_ATTR_volumeid	0x08
#define FAT_ATTR_directory	0x10
#define FAT_ATTR_archive	0x20
#define FAT_ATTR_longfile	0x0F

#define FAT_ATTR_nomore		0x00
#define FAT_ATTR_deleted	0xE5

#endif


text:
path: "/blog/vscode-extensions"
date: "2019-04-13"
title: "Some VS Code Extensions"
archived: true
---

Yes, this is yet another blog post about some random internet users'
favourite VS Code extensions.

<!-- end -->

**TL;DR:**

  * [Peacock](#peacock)
  * [Git Lens](#git-lens)
  * [TODO Tree](#todo-tree)
  * [ESLint](#eslint)
  * [EditorConfig](#editorconfig)
  * [Markdown All In One](#markdown-all-in-one)
  * [Markdown PDF](#markdown-pdf)

This post will give a brief overview of each extension.

## Extensions

### Peacock

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock)

**Q: What does it do?**
> A: Customize the colours of UI elements like the sidebar and status bar, per window/instance.

**Q: Why?**
> A: Useful for quickly differentiating between different instances/workspaces that are open.

![Peacock](./_images/peacock.png)

### Git Lens

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)

**Q: What does it do?**
> A: Adds Git functionality like live blame (hover to view the author of a particular line),
easy navigation of file history, and visualization of changes.

**Q: Why?**
> A: Built-in Git support is lacking in features and it can be more productive to use an extension rather
than to switch applications or to rely solely on the Git CLI, especially for beginners.

![Git Lens](./_images/git-lens.png)

### TODO Tree

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree)

**Q: What does it do?**
> A: Displays TODOs located within your project in a tree-view in the sidebar.

**Q: Why?**
> A: For those that use TODOs as a task management system, this extension can help keep track
of existing TODOs and ensure they are resolved.

![TODO Tree](./_images/todo-tree.png)

### ESLint

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

**Q: What does it do?**
> A: Integrates [ESLint](https://eslint.org) into VS Code and providing inline hints. It will automatically
use the ESLint configuration of the project.

**Q: Why?**
> A: Linters help maintain code quality and consistency. Integration into the editor instead of running
it explicitly on the command line helps catch mistakes as they happen.

![ESLint](./_images/eslint.png)

### EditorConfig

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)

**Q: What does it do?**
> A: Integrates the [.editorconfig](https://editorconfig.org/) format into VS Code and automatically
formats files (e.g. indent sizing and trailing newlines) on save.

**Q: Why?**
> A: Consistent coding style within a project reduces cognitive load due to stylistic differences.
`.editorconfig` helps maintain a coding style across editors and IDEs (provided they have support for it).

### Markdown All In One

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one)

**Q: What does it do?**
> A: Provides Markdown editing features such as HTML previewing, automatic table of contents generation,
list editing, and auto-completion.

**Q: Why?**
> A: It helps you create and maintain high-quality Markdown documentation.

### Markdown PDF

[Marketplace Link](https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf)

**Q: What does it do?**
> A: Converts Markdown files to PDFs.

**Q: Why?**
> A: This is useful for those who prefer Markdown over Google Docs yet need to send a professional
PDF to some business-people.