text:
package org.postgresql.test.jdbc42;

import org.postgresql.test.TestUtil;
import org.postgresql.test.jdbc2.BaseTest;
import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.TimeZone;

public class GetObject310Test extends BaseTest {

  private static final TimeZone saveTZ = TimeZone.getDefault();

  private static final ZoneOffset UTC = ZoneOffset.UTC; // +0000 always
  private static final ZoneOffset GMT03 = ZoneOffset.of("+03:00"); // +0300 always
  private static final ZoneOffset GMT05 = ZoneOffset.of("-05:00"); // -0500 always
  private static final ZoneOffset GMT13 = ZoneOffset.of("+13:00"); // +1300 always

  public GetObject310Test(String name) {
    super(name);
  }

  protected void setUp() throws Exception {
    super.setUp();
    TestUtil.createTable(con, "table1", "timestamp_without_time_zone_column timestamp without time zone,"
            + "timestamp_with_time_zone_column timestamp with time zone,"
            + "date_column date,"
            + "time_without_time_zone_column time without time zone,"
            + "time_with_time_zone_column time with time zone"
    );
  }

  protected void tearDown() throws SQLException {
    TimeZone.setDefault(saveTZ);
    TestUtil.dropTable(con, "table1");
    super.tearDown();
  }

  /**
   * Test the behavior getObject for date columns.
   */
  public void testGetLocalDate() throws SQLException {
    Statement stmt = con.createStatement();
    stmt.executeUpdate(TestUtil.insertSQL("table1","date_column","DATE '1999-01-08'"));

    ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "date_column"));
    try {
      assertTrue(rs.next());
      LocalDate localDate = LocalDate.of(1999, 1, 8);
      assertEquals(localDate, rs.getObject("date_column", LocalDate.class));
      assertEquals(localDate, rs.getObject(1, LocalDate.class));
    } finally {
      rs.close();
    }
  }

  /**
   * Test the behavior getObject for time columns.
   */
  public void testGetLocalTime() throws SQLException {
    Statement stmt = con.createStatement();
    stmt.executeUpdate(TestUtil.insertSQL("table1","time_without_time_zone_column","TIME '04:05:06.123456'"));

    ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "time_without_time_zone_column"));
    try {
      assertTrue(rs.next());
      LocalTime localTime = LocalTime.of(4, 5, 6, 123456000);
      assertEquals(localTime, rs.getObject("time_without_time_zone_column", LocalTime.class));
      assertEquals(localTime, rs.getObject(1, LocalTime.class));
    } finally {
      rs.close();
    }
  }

  /**
   * Test the behavior getObject for time columns with null.
   */
  public void testGetLocalTimeNull() throws SQLException {
    Statement stmt = con.createStatement();
    stmt.executeUpdate(TestUtil.insertSQL("table1","time_without_time_zone_column","NULL"));

    ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "time_without_time_zone_column"));
    try {
      assertTrue(rs.next());
      assertNull(rs.getObject("time_without_time_zone_column", LocalTime.class));
      assertNull(rs.getObject(1, LocalTime.class));
    } finally {
      rs.close();
    }
  }

  /**
   * Test the behavior getObject for time columns with null.
   */
  public void testGetLocalTimeInvalidType() throws SQLException {
    Statement stmt = con.createStatement();
    stmt.executeUpdate(TestUtil.insertSQL("table1","time_with_time_zone_column", "TIME '04:05:06.123456-08:00'"));

    ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "time_with_time_zone_column"));
    try {
      assertTrue(rs.next());
      try {
        assertNull(rs.getObject("time_with_time_zone_column", LocalTime.class));
      } catch (PSQLException e) {
        assertTrue(e.getSQLState().equals(PSQLState.DATA_TYPE_MISMATCH.getState())
                || e.getSQLState().equals(PSQLState.BAD_DATETIME_FORMAT.getState()));
      }
      try {
        assertNull(rs.getObject(1, LocalTime.class));
      } catch (PSQLException e) {
        assertTrue(e.getSQLState().equals(PSQLState.DATA_TYPE_MISMATCH.getState())
                || e.getSQLState().equals(PSQLState.BAD_DATETIME_FORMAT.getState()));
      }
    } finally {
      rs.close();
    }
  }

  /**
   * Test the behavior getObject for timestamp columns.
   */
  public void testGetLocalDateTime() throws SQLException {
    List<String> zoneIdsToTest = new ArrayList<String>();
    zoneIdsToTest.add("Africa/Casablanca"); // It is something like GMT+0..GMT+1
    zoneIdsToTest.add("America/Adak"); // It is something like GMT-10..GMT-9
    zoneIdsToTest.add("Atlantic/Azores"); // It is something like GMT-1..GMT+0
    zoneIdsToTest.add("Europe/Moscow"); // It is something like GMT+3..GMT+4 for 2000s
    zoneIdsToTest.add("Pacific/Apia"); // It is something like GMT+13..GMT+14
    zoneIdsToTest.add("Pacific/Niue"); // It is something like GMT-11..GMT-11
    for (int i = -12; i <= 13; i++) {
      zoneIdsToTest.add(String.format("GMT%+02d", i));
    }

    List<String> datesToTest = Arrays.asList("2015-09-03T12:00:00", "2015-06-30T23:59:58",
            "1997-06-30T23:59:59", "1997-07-01T00:00:00", "2012-06-30T23:59:59", "2012-07-01T00:00:00",
            "2015-06-30T23:59:59", "2015-07-01T00:00:00", "2005-12-31T23:59:59", "2006-01-01T00:00:00",
            "2008-12-31T23:59:59", "2009-01-01T00:00:00", /* "2015-06-30T23:59:60", */ "2015-07-31T00:00:00",
            "2015-07-31T00:00:01", "2015-07-31T00:00:00.000001",

            // On 2000-03-26 02:00:00 Moscow went to DST, thus local time became 03:00:00
            "2000-03-26T01:59:59", "2000-03-26T02:00:00", "2000-03-26T02:00:01", "2000-03-26T02:59:59",
            "2000-03-26T03:00:00", "2000-03-26T03:00:01", "2000-03-26T03:59:59", "2000-03-26T04:00:00",
            "2000-03-26T04:00:01", "2000-03-26T04:00:00.000001",

            // On 2000-10-29 03:00:00 Moscow went to regular time, thus local time became 02:00:00
            "2000-10-29T01:59:59", "2000-10-29T02:00:00", "2000-10-29T02:00:01", "2000-10-29T02:59:59",
            "2000-10-29T03:00:00", "2000-10-29T03:00:01", "2000-10-29T03:59:59", "2000-10-29T04:00:00",
            "2000-10-29T04:00:01", "2000-10-29T04:00:00.000001");

    for (String zoneId : zoneIdsToTest) {
      ZoneId zone = ZoneId.of(zoneId);
      for (String date : datesToTest) {
        localTimestamps(zone, date);
      }
    }
  }

  public void localTimestamps(ZoneId zoneId, String timestamp) throws SQLException {
    TimeZone.setDefault(TimeZone.getTimeZone(zoneId));
    Statement stmt = con.createStatement();
    try {
      stmt.executeUpdate(TestUtil.insertSQL("table1","timestamp_without_time_zone_column","TIMESTAMP '" + timestamp + "'"));

      ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "timestamp_without_time_zone_column"));
      try {
        assertTrue(rs.next());
        LocalDateTime localDateTime = LocalDateTime.parse(timestamp);
        assertEquals(localDateTime, rs.getObject("timestamp_without_time_zone_column", LocalDateTime.class));
        assertEquals(localDateTime, rs.getObject(1, LocalDateTime.class));
      } finally {
        rs.close();
      }
      stmt.executeUpdate("DELETE FROM table1");
    } finally {
      stmt.close();
    }
  }

  /**
   * Test the behavior getObject for timestamp with time zone columns.
   */
  public void testGetTimestampWithTimeZone() throws SQLException {
    runGetOffsetDateTime(UTC);
    runGetOffsetDateTime(GMT03);
    runGetOffsetDateTime(GMT05);
    runGetOffsetDateTime(GMT13);
  }

  private void runGetOffsetDateTime(ZoneOffset offset) throws SQLException {
    Statement stmt = con.createStatement();
    try {
      stmt.executeUpdate(TestUtil.insertSQL("table1","timestamp_with_time_zone_column","TIMESTAMP WITH TIME ZONE '2004-10-19 10:23:54.123456" + offset.toString() + "'"));

      ResultSet rs = stmt.executeQuery(TestUtil.selectSQL("table1", "timestamp_with_time_zone_column"));
      try {
        assertTrue(rs.next());
        LocalDateTime localDateTime = LocalDateTime.of(2004, 10, 19, 10, 23, 54, 123456000);

        OffsetDateTime offsetDateTime = localDateTime.atOffset(offset).withOffsetSameInstant(ZoneOffset.UTC);
        assertEquals(offsetDateTime, rs.getObject("timestamp_with_time_zone_column", OffsetDateTime.class));
        assertEquals(offsetDateTime, rs.getObject(1, OffsetDateTime.class));
      } finally {
        rs.close();
      }
      stmt.executeUpdate("DELETE FROM table1");
    } finally {
      stmt.close();
    }
  }

}


text:
CREATE TABLE M_DYNAMIC_MODEL_DATA(
        ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL,
        LABEL VARCHAR(200),
	NAME VARCHAR(200),
	VALUE VARCHAR(200),
	MODEL_ID BIGINT,
        CONSTRAINT PK_M_DYNAMIC_MODEL_DATA PRIMARY KEY(ID),
        CONSTRAINT FK_M_DYNAMIC_MODEL FOREIGN KEY(MODEL_ID) REFERENCES M_DYNAMIC_MODEL(ID)
);

redpajama_set_name: RedPajamaGithub


text:
package com.alibaba.rocketmq.remoting.netty;

import io.netty.channel.ChannelHandlerContext;

import com.alibaba.rocketmq.remoting.protocol.RemotingCommand;

/**
 * 接收请求处理器,服务器与客户端通用
 *
 * @author shijia.wxr<vintage.wang@gmail.com>
 * @since 2013-7-13
 */
public interface NettyRequestProcessor {
    public RemotingCommand processRequest(ChannelHandlerContext ctx, RemotingCommand request)
            throws Exception;
}


text:
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using IdentitySample.Services;
using Microsoft.AspNetCore.Identity;
using System.IO;
using Microsoft.Extensions.Options;
using System.Security.Claims;
using MongoDB.Driver;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.DataProtection;
using AspNetCore.Identity.MongoDB;
using StackExchange.Redis;
using System.Net;
using System.Linq;

namespace IdentitySample
{
    public class MongoDbSettings
    {
        public string ConnectionString { get; set; }
        public string DatabaseName { get; set; }
    }

    public class Startup
    {
        private readonly IHostingEnvironment _env;

        public Startup(IHostingEnvironment env)
        {
            // Set up configuration sources.
            var builder = new ConfigurationBuilder()
                .SetBasePath(Directory.GetCurrentDirectory())
                .AddJsonFile("appsettings.json")
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

            builder.AddEnvironmentVariables("WebApp_");
            Configuration = builder.Build();
            _env = env;
        }

        public IConfigurationRoot Configuration { get; set; }

        /// <summary>
        /// see: https://github.com/aspnet/Identity/blob/79dbed5a924e96a22b23ae6c84731e0ac806c2b5/src/Microsoft.AspNetCore.Identity/IdentityServiceCollectionExtensions.cs#L46-L68
        /// </summary>
        public void ConfigureServices(IServiceCollection services)
        {
            // sad but a giant hack :(
            // https://github.com/StackExchange/StackExchange.Redis/issues/410#issuecomment-220829614
            var redisHost = Configuration.GetValue<string>("Redis:Host");
            var redisPort = Configuration.GetValue<int>("Redis:Port");
            var redisIpAddress = Dns.GetHostEntryAsync(redisHost).Result.AddressList.Last();
            var redis = ConnectionMultiplexer.Connect($"{redisIpAddress}:{redisPort}");

            services.AddDataProtection().PersistKeysToRedis(redis, "DataProtection-Keys");
            services.AddOptions();

            services.Configure<MongoDbSettings>(Configuration.GetSection("MongoDb"));
            services.AddSingleton<IUserStore<MongoIdentityUser>>(provider =>
            {
                var options = provider.GetService<IOptions<MongoDbSettings>>();
                var client = new MongoClient(options.Value.ConnectionString);
                var database = client.GetDatabase(options.Value.DatabaseName);
                var loggerFactory = provider.GetService<ILoggerFactory>();

                return new MongoUserStore<MongoIdentityUser>(database, loggerFactory);
            });

            services.Configure<IdentityOptions>(options =>
            {
                options.Cookies.ApplicationCookie.AuthenticationScheme = "ApplicationCookie";
                options.Lockout.AllowedForNewUsers = true;
            });

            // Services used by identity
            services.AddAuthentication(options =>
            {
                // This is the Default value for ExternalCookieAuthenticationScheme
                options.SignInScheme = new IdentityCookieOptions().ExternalCookieAuthenticationScheme;
            });

            // Hosting doesn't add IHttpContextAccessor by default
            services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();

            services.TryAddSingleton<IdentityMarkerService>();
            services.TryAddSingleton<IUserValidator<MongoIdentityUser>, UserValidator<MongoIdentityUser>>();
            services.TryAddSingleton<IPasswordValidator<MongoIdentityUser>, PasswordValidator<MongoIdentityUser>>();
            services.TryAddSingleton<IPasswordHasher<MongoIdentityUser>, PasswordHasher<MongoIdentityUser>>();
            services.TryAddSingleton<ILookupNormalizer, UpperInvariantLookupNormalizer>();
            services.TryAddSingleton<IdentityErrorDescriber>();
            services.TryAddSingleton<ISecurityStampValidator, SecurityStampValidator<MongoIdentityUser>>();
            services.TryAddSingleton<IUserClaimsPrincipalFactory<MongoIdentityUser>, UserClaimsPrincipalFactory<MongoIdentityUser>>();
            services.TryAddScoped<UserManager<MongoIdentityUser>, UserManager<MongoIdentityUser>>();
            services.TryAddScoped<SignInManager<MongoIdentityUser>, SignInManager<MongoIdentityUser>>();

            AddDefaultTokenProviders(services);

            services.AddMvc();

            // Add application services.
            services.AddTransient<IEmailSender, AuthMessageSender>();
            services.AddTransient<ISmsSender, AuthMessageSender>();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }
            app.UseStaticFiles();

            // To configure external authentication please see http://go.microsoft.com/fwlink/?LinkID=532715

            app.UseIdentity()
               .UseFacebookAuthentication(new FacebookOptions
               {
                   AppId = "901611409868059",
                   AppSecret = "4aa3c530297b1dcebc8860334b39668b"
               })
                .UseGoogleAuthentication(new GoogleOptions
                {
                    ClientId = "514485782433-fr3ml6sq0imvhi8a7qir0nb46oumtgn9.apps.googleusercontent.com",
                    ClientSecret = "V2nDD9SkFbvLTqAUBWBBxYAL"
                })
                .UseTwitterAuthentication(new TwitterOptions
                {
                    ConsumerKey = "BSdJJ0CrDuvEhpkchnukXZBUv",
                    ConsumerSecret = "xKUNuKhsRdHD03eLn67xhPAyE1wFFEndFo1X2UJaK2m1jdAxf4"
                });

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }

        private void AddDefaultTokenProviders(IServiceCollection services)
        {
            var dataProtectionProviderType = typeof(DataProtectorTokenProvider<>).MakeGenericType(typeof(MongoIdentityUser));
            var phoneNumberProviderType = typeof(PhoneNumberTokenProvider<>).MakeGenericType(typeof(MongoIdentityUser));
            var emailTokenProviderType = typeof(EmailTokenProvider<>).MakeGenericType(typeof(MongoIdentityUser));
            AddTokenProvider(services, TokenOptions.DefaultProvider, dataProtectionProviderType);
            AddTokenProvider(services, TokenOptions.DefaultEmailProvider, emailTokenProviderType);
            AddTokenProvider(services, TokenOptions.DefaultPhoneProvider, phoneNumberProviderType);
        }

        private void AddTokenProvider(IServiceCollection services, string providerName, Type provider)
        {
            services.Configure<IdentityOptions>(options =>
            {
                options.Tokens.ProviderMap[providerName] = new TokenProviderDescriptor(provider);
            });

            services.AddSingleton(provider);
        }

        public class UserClaimsPrincipalFactory<TUser> : Microsoft.AspNetCore.Identity.IUserClaimsPrincipalFactory<TUser>
            where TUser : class
        {
            public UserClaimsPrincipalFactory(
                UserManager<TUser> userManager,
                IOptions<IdentityOptions> optionsAccessor)
            {
                if (userManager == null)
                {
                    throw new ArgumentNullException(nameof(userManager));
                }
                if (optionsAccessor == null || optionsAccessor.Value == null)
                {
                    throw new ArgumentNullException(nameof(optionsAccessor));
                }

                UserManager = userManager;
                Options = optionsAccessor.Value;
            }

            public UserManager<TUser> UserManager { get; private set; }

            public IdentityOptions Options { get; private set; }

            public virtual async Task<ClaimsPrincipal> CreateAsync(TUser user)
            {
                if (user == null)
                {
                    throw new ArgumentNullException(nameof(user));
                }

                var userId = await UserManager.GetUserIdAsync(user);
                var userName = await UserManager.GetUserNameAsync(user);
                var id = new ClaimsIdentity(Options.Cookies.ApplicationCookieAuthenticationScheme,
                    Options.ClaimsIdentity.UserNameClaimType,
                    Options.ClaimsIdentity.RoleClaimType);
                id.AddClaim(new Claim(Options.ClaimsIdentity.UserIdClaimType, userId));
                id.AddClaim(new Claim(Options.ClaimsIdentity.UserNameClaimType, userName));
                if (UserManager.SupportsUserSecurityStamp)
                {
                    id.AddClaim(new Claim(Options.ClaimsIdentity.SecurityStampClaimType,
                        await UserManager.GetSecurityStampAsync(user)));
                }
                if (UserManager.SupportsUserRole)
                {
                    var roles = await UserManager.GetRolesAsync(user);
                    foreach (var roleName in roles)
                    {
                        id.AddClaim(new Claim(Options.ClaimsIdentity.RoleClaimType, roleName));
                    }
                }
                if (UserManager.SupportsUserClaim)
                {
                    id.AddClaims(await UserManager.GetClaimsAsync(user));
                }

                return new ClaimsPrincipal(id);
            }
        }
    }
}


text:
class UserMailer < ApplicationMailer
  default from: "ryanimmesberger@gmail.com"

  def notify_email(user)
    @user = user

    @url = 'http://localhost:3000'
    mail(to: @user.email, subject: 'You created an account at Barter!')
  end

  def mail_offer(sender, reciever, timeslot)
    @sender = sender
    @reciever = reciever
    @timeslot = timeslot
    @url = 'http://localhost:3000'
    mail(to: @reciever.email, subject: 'Someone has offered you their talent!')
  end

  def accept_offer(sender, reciever, timeslot)
    @sender = sender
    @reciever = reciever
    @timeslot = timeslot
    @url = 'http://localhost:3000'
    mail(to: @reciever.email, subject: "#{@sender.username} has accepted your offer!")
  end

  def decline_offer(sender, reciever, timeslot)
    @sender = sender
    @reciever = reciever
    @timeslot = timeslot
    @url = 'http://localhost:3000'
    mail(to: @reciever.email, subject: "Sorry, #{@sender.username} has rejected your offer.")
  end

end


text:
<?php
namespace Quasar;
class Kernel
{
    public static function getQuery()
    {
        return $_SERVER['QUERY_STRING'];
    }

    public static function getRequest()
    {
        return $_SERVER['REQUEST_URI'];
    }

    public static function getServerIP()
    {
        return $_SERVER['SERVER_ADDR'];
    }

    public static function getServerName()
    {
        return $_SERVER['SERVER_NAME'];
    }

    public static function getServerSoftware()
    {
        return $_SERVER['SERVER_SOFTWARE'];
    }

    public static function getServerProtocol()
    {
        return $_SERVER['SERVER_PROTOCOL'];
    }

    public static function getMethod()
    {
        return $_SERVER['REQUEST_METHOD'];
    }

    public static function getPost()
    {
        return $_POST;
    }
}


text:
describe "Application 'SplashMotion'" do
  before do
    @app = UIApplication.sharedApplication
    @root_view = @app.windows[0].rootViewController.view
    @start_views = @root_view.subviews.size
  end

  it "has one window" do
    @app.windows.size.should == 1
  end

  it "starts with at least one subview" do
    @root_view.subviews.size.should > 0
  end

  it "should remove the splash by 5 seconds" do
    wait 5.0 do
      @root_view.subviews.size.should.not.equal @start_views
    end
  end

  it "should have theme styles" do
    Teacup::Stylesheet[:base_leather].should.not == nil
    Teacup::Stylesheet[:basic].should.not == nil
  end
end


text:
int main() {

   printf("This c file must be ignored\n");

   return 0;
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Saves the entire network to a configuration file</title>

fann_save_train

fann_scale_input_train_data

Fann Functions

PHP Manual

fann_save

(PECL fann >= 1.0.0)

fann_save — Saves the entire network to a configuration file

Description

   bool fann_save
    ( resource $ann
   , string $configuration_file
   )

   Saves the entire network to a configuration file.

   The configuration file contains all information about the neural network and enables
   fann_create_from_file() to create an exact copy of the neural network
   and all of the parameters associated with the neural network.

   These three parameters (fann_set_callback(), fann_set_error_log(),
   fann_set_user_data()) are NOT saved to the file because they cannot safely be ported
   to a different location. Also temporary parameters generated during training like fann_get_MSE()
   is not saved.

Parameters

ann

Neural network resource.

configuration_file

      The configuration file path.

Return Values

Returns TRUE on success, or FALSE otherwise.

See Also

fann_create_from_file() - Constructs a backpropagation neural network from a configuration file

fann_save_train

fann_scale_input_train_data

Fann Functions

PHP Manual


text:
package li.cryx.expcraft.dexterity;

import junit.framework.Assert;
import li.cryx.expcraft.AbstractPluginTest;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

/**
 * Test {@link DexterityEntityListener}.
 *
 * @author cryxli
 */
public class DexterityEntityListenerTest extends AbstractPluginTest<Dexterity> {

	private DexterityEntityListener listener;

	@Override
	protected Class<Dexterity> getClazz() {
		return Dexterity.class;
	}

	/**
	 * Test the normal case of the listeners granting dmg reduction.
	 *
	 * @param level
	 *            Player's level
	 * @param reduction
	 *            Expected dmg reduction.
	 */
	private void normalCase(final int level, final int reduction) {
		hasModule = true;
		PlayerInventory inv = Mockito.mock(PlayerInventory.class);
		Mockito.when(inv.getBoots()).thenReturn(
				new ItemStack(Material.LEATHER_BOOTS));
		Player player = Mockito.mock(Player.class);
		Mockito.when(player.getName()).thenReturn("Player");
		plugin.getPersistence().setLevel(plugin, player, level);
		Mockito.when(player.getInventory()).thenReturn(inv);
		EntityDamageEvent event = new EntityDamageEvent(player,
				DamageCause.FALL, 20.0);
		listener.onEntityDamage(event);
		Assert.assertEquals(20.0 - reduction, event.getDamage(), 0);
	}

	/** Test 1 */
	@Test
	public void playerDoesNotHaveModule() {
		Player player = Mockito.mock(Player.class);
		EntityDamageEvent event = new EntityDamageEvent(player,
				DamageCause.FIRE, 20.0);
		listener.onEntityDamage(event);
		Assert.assertEquals(0, plugin.getPersistence().getExp(plugin, player),
				0);
		Assert.assertEquals(20.0, event.getDamage(), 0);

		event = new EntityDamageEvent(player, DamageCause.FALL, 20.0);
		listener.onEntityDamage(event);
		Assert.assertEquals(20.0, event.getDamage(), 0);

		// if one of the cases fails, a NullPointerException is thrown
	}

	/** Test 2 */
	@Test
	public void playerHasNoBoots() {
		hasModule = true;
		PlayerInventory inv = Mockito.mock(PlayerInventory.class);
		Player player = Mockito.mock(Player.class);
		Mockito.when(player.getInventory()).thenReturn(inv);
		EntityDamageEvent event = new EntityDamageEvent(player,
				DamageCause.FALL, 20.0);
		listener.onEntityDamage(event);
		Assert.assertEquals(20.0, event.getDamage(), 0);
	}

	@Before
	public void prepareTestSpecific() {
		Mockito.when(plugin.getLevelCap()).thenReturn(100);
		listener = new DexterityEntityListener(plugin);
	}

	/** Test 3 */
	@Test
	public void testDmgReduction() {
		for (int level = 1; level <= 100; level++) {
			normalCase(level, level / 10);
		}
	}

}


text:
body{margin:0px;text-align:justify;font-family:verdana;font-size:0.8em;background-color:#222;color:white;}

h1{margin-top;0;border-bottom:2px solid white}

aside{
float:left;
display:block;
padding:5px;
width:240px;
min-height:200px;
text-align:left;
}

#profile{padding:5px;min-height:70px;}

#page{
margin-left:250px;
min-height:250px;
padding-top:5px;
}

footer{margin:5px 2px 2px 0px;padding:5px 10px;border-radius:2px;font-family:verdana;font-size:0.8em;}
footer a:link{color:orange;text-decoration:none}
footer a:hover{text-decoration:underline}
footer a:visited{color:white}

.button{
padding:5px;border-radius:2px; text-align:left; background-color:#444;
display:block;margin:2px;cursor:default;font-family:verdana;color:white;text-decoration:none;
}
.button:hover{
color:black;background: -moz-linear-gradient(top, #FF5, #FFCC33);background-color:orange
}
.ribbon{
cursor:default;text-align:center;width:100%;padding:5px 0;margin-bottom:10px
}

.card{
display:inline-block;
padding:15px 5px;
margin:5px;
min-width:110px;
max-width:150px;
min-height:20px;
border-radius:2px;
background-color:white;
color:#014;
text-align:center;
text-decoration:none !important;
vertical-align:middle;
}

.card a{text-decoration:none;}
.card a:hover{text-decoration:underline;}
.card img{padding-bottom:5px;max-width:96px}

.loader{padding:10px !important; background-color:white}

.left{text-align:left !important}
.centre{text-align:center !important}
.right{text-align:right !important}
.justify{text-align:justify !important}

.avatar{float:left;display:inline-block;margin:0px 5px 2px 0px;vertical-align:text-top;border:2px solid gray;border-radius:2px}
.name{display:block;font-weight:bold;}
.imgInv{width:96px;height:96px}

.loader{padding:10px !important; background-color:white}

.left{text-align:left !important}
.centre{text-align:center !important}
.right{text-align:right !important}
.justify{text-align:justify !important}

.avatar{float:left;display:inline-block;margin:0px 5px 2px 0px;vertical-align:text-top;border:2px solid gray;border-radius:2px}
.name{display:block;font-weight:bold;}

.emoticon{background-image:url('../img/check.gif')}
.emoticon:hover{background-image:none;background-color:#444;color:white}

/*Qualities*/

.n{background-color:#BA0;color:white}
.n:hover{background-color:#ED1;color:#A90}

.v{background-color:#569;color:white}
.v:hover{background-color:#78B}

.g {background-color:#586;color:white}
.g:hover{background-color:#7A8;color:#464}

.s {background-color:#D73;color:white}
.s:hover{background-color:#F95;color:#A05125}

.u {background-color:#95B;color:white}
.u:hover{background-color:#B7D;color:#637}

.h{background-color:#4FB;color:white}
.h:hover{background-color:#6FD;color:#1C8;}

.c{background-color:#7B5;color:white}
.c:hover{background-color:#9D7:color:#584;}

.valve{background-color:#A18;color:white}
.valve:hover{background-color:#C3A;color:#614;}

.d {background-color:silver;color:white}
.d {border:1px solid gray;background-color:silver;color:gray; }

@media screen and (max-width:450px){
aside{position:static;padding:0px;margin:0px;width:100%;}
#page{margin-left:0px}
}


text:
{% extends "blog/gitology/base.html" %}
{% load enable_comments %}
{% block title %}Gitology » {{ post.document.meta.title|safe }}{% endblock %}
{% block content %}

{{ post.posted_on|date:"l, F j, Y" }}

	 {{ post.document.meta.title }}

    {{ post.document.index|safe }}

    {% if post.labels %}

        Label{{ post.labels|length|pluralize }}:
        {% for label in post.labels %}

                {{ label.document.meta.title }}
        {% endfor %}

    {% endif %}

Posted by Amit at
      {{ post.document.meta.posted_on }}

{% show_comments post.document %}

{% endblock %}


text:
package org.fxmisc.richtext;

import javafx.beans.value.ObservableValue;
import javafx.collections.ObservableList;
import javafx.geometry.Bounds;
import javafx.scene.control.IndexRange;

import org.fxmisc.richtext.model.EditableStyledDocument;
import org.fxmisc.richtext.model.Paragraph;
import org.fxmisc.richtext.model.PlainTextChange;
import org.fxmisc.richtext.model.RichTextChange;
import org.fxmisc.richtext.model.SegmentOps;
import org.fxmisc.richtext.model.StyledDocument;
import org.reactfx.EventStream;
import org.reactfx.SuspendableNo;
import org.reactfx.value.Var;

import java.util.List;
import java.util.Locale;
import java.util.Optional;

/**
 * Interface for a text editing control.
 *
 * Defines the core methods. Other interfaces define default
 * higher-level methods implemented on top of the core methods.
 *
 * @param <S> type of style that can be applied to text.
 */
public interface TextEditingArea<PS, SEG, S> {

    /*******************
     *                 *
     *   Observables   *
     *                 *
     *******************/

    /**
     * The number of characters in this text-editing area.
     */
    default int getLength() { return lengthProperty().getValue(); }
    ObservableValue<Integer> lengthProperty();

    /**
     * This is used to determine word and sentence breaks while navigating or selecting.
     * Override this method if your paragraph or text style accommodates Locales as well.
     */
    default Locale getLocale() { return Locale.getDefault(); }

    /**
     * Text content of this text-editing area.
     */
    default String getText() { return textProperty().getValue(); }
    ObservableValue<String> textProperty();

    /**
     * Rich-text content of this text-editing area.
     * The returned document is immutable, it does not reflect
     * subsequent edits of this text-editing area.
     */
    StyledDocument<PS, SEG, S> getDocument();

    /**
     * The underlying document of this area that can be displayed by multiple {@code StyledTextArea}s.
     */
    EditableStyledDocument<PS, SEG, S> getContent();

    /**
     * Returns the object used for operating over {@link SEG segments} and their styles
     */
    SegmentOps<SEG, S> getSegOps();

    /**
     * The current position of the caret, as a character offset in the text.
     *
     * Most of the time, caret is at the boundary of the selection (if there
     * is any selection). However, there are circumstances when the caret is
     * positioned inside or outside the selected text. For example, when the
     * user is dragging the selected text, the caret moves with the cursor
     * to point at the position where the selected text moves upon release.
     */
    default int getCaretPosition() { return getCaretSelectionBind().getPosition(); }
    default ObservableValue<Integer> caretPositionProperty() { return getCaretSelectionBind().positionProperty(); }

    /**
     * Index of the current paragraph, i.e. the paragraph with the caret.
     */
    default int getCurrentParagraph() { return getCaretSelectionBind().getParagraphIndex(); }
    default ObservableValue<Integer> currentParagraphProperty() { return getCaretSelectionBind().paragraphIndexProperty(); }

    /**
     * The caret position within the current paragraph.
     */
    default int getCaretColumn() { return getCaretSelectionBind().getColumnPosition(); }
    default ObservableValue<Integer> caretColumnProperty() { return getCaretSelectionBind().columnPositionProperty(); }

    /**
     * Gets the bounds of the caret in the Screen's coordinate system or {@link Optional#empty()}
     * if caret is not visible in the viewport.
     */
    default Optional<Bounds> getCaretBounds() { return getCaretSelectionBind().getCaretBounds(); }
    default ObservableValue<Optional<Bounds>> caretBoundsProperty() { return getCaretSelectionBind().caretBoundsProperty(); }

    /**
     * Indicates when this text area should display a caret.
     */
    default Caret.CaretVisibility getShowCaret() { return getCaretSelectionBind().getShowCaret(); }
    default void setShowCaret(Caret.CaretVisibility value) { getCaretSelectionBind().setShowCaret(value); }
    default Var<Caret.CaretVisibility> showCaretProperty() { return getCaretSelectionBind().showCaretProperty(); }

    /**
     * Gets the area's main {@link CaretSelectionBind}.
     */
    CaretSelectionBind<PS, SEG, S> getCaretSelectionBind();

    /**
     * The anchor of the selection.
     * If there is no selection, this is the same as caret position.
     */
    default int getAnchor() { return getCaretSelectionBind().getAnchorPosition(); }
    default ObservableValue<Integer> anchorProperty() { return getCaretSelectionBind().anchorPositionProperty(); }

    /**
     * The selection range.
     *
     * One boundary is always equal to anchor, and the other one is most
     * of the time equal to caret position.
     */
    default IndexRange getSelection() { return getCaretSelectionBind().getRange(); }
    default ObservableValue<IndexRange> selectionProperty() { return getCaretSelectionBind().rangeProperty(); }

    /**
     * The selected text.
     */
    default String getSelectedText() { return getCaretSelectionBind().getSelectedText(); }
    default ObservableValue<String> selectedTextProperty() { return getCaretSelectionBind().selectedTextProperty(); }

    /**
     * Gets the bounds of the selection in the Screen's coordinate system if something is selected and visible in the
     * viewport or {@link Optional#empty()} if selection is not visible in the viewport.
     */
    default Optional<Bounds> getSelectionBounds() { return getCaretSelectionBind().getSelectionBounds(); }
    default ObservableValue<Optional<Bounds>> selectionBoundsProperty() { return getCaretSelectionBind().selectionBoundsProperty(); }

    /**
     * Unmodifiable observable list of paragraphs in this text area.
     */
    ObservableList<Paragraph<PS, SEG, S>> getParagraphs();
    default Paragraph<PS, SEG, S> getParagraph(int index) { return getParagraphs().get(index); }
    default int getParagraphLength(int index) { return getParagraph(index).length(); }

    /**
     * True when an update to the area's {@link #getContent() underling editable document} is still occurring
     * or the viewport is being updated.
     */
    SuspendableNo beingUpdatedProperty();
    default boolean isBeingUpdated() { return beingUpdatedProperty().get(); }

    /*********************
     *                   *
     *   Event streams   *
     *                   *
     *********************/

    /**
     * See {@link org.fxmisc.richtext.model.EditableStyledDocument#multiPlainChanges()}
     */
    EventStream<List<PlainTextChange>> multiPlainChanges();

    /**
     * See {@link org.fxmisc.richtext.model.EditableStyledDocument#plainChanges()}
     */
    EventStream<PlainTextChange> plainTextChanges();

    /**
     * See {@link org.fxmisc.richtext.model.EditableStyledDocument#multiRichChanges()}
     */
    EventStream<List<RichTextChange<PS, SEG, S>>> multiRichChanges();

    /**
     * See {@link org.fxmisc.richtext.model.EditableStyledDocument#richChanges()}
     */
    EventStream<RichTextChange<PS, SEG, S>> richChanges();

    /***************
     *             *
     *   Queries   *
     *             *
     ***************/

    /**
     * Returns text content of the given paragraph.
     */
    String getText(int paragraphIndex);

    /**
     * Returns text content of the given character range.
     */
    String getText(int start, int end);

    /**
     * Returns text content of the given character range.
     */
    String getText(IndexRange range);

    /**
     * Returns text content of the given character range.
     *
     *
Caution: see {@link #getAbsolutePosition(int, int)} to know how the column index argument
     * can affect the returned position.

     */
    default String getText(int startParagraph, int startColumn, int endParagraph, int endColumn) {
        int start = getAbsolutePosition(startParagraph, startColumn);
        int end = getAbsolutePosition(endParagraph, endColumn);
        return getText(start, end);
    }

    /**
     * Returns rich-text content of the given paragraph.
     */
    StyledDocument<PS, SEG, S> subDocument(int paragraphIndex);

    /**
     * Returns rich-text content of the given character range.
     */
    default StyledDocument<PS, SEG, S> subDocument(IndexRange range) {
        return subDocument(range.getStart(), range.getEnd());
    };

    /**
     * Returns rich-text content of the given character range.
     */
    StyledDocument<PS, SEG, S> subDocument(int start, int end);

    /**
     * Returns rich-text content of the given character range.
     *
     *
Caution: see {@link #getAbsolutePosition(int, int)} to know how the column index argument
     * can affect the returned position.

     */
    default StyledDocument<PS, SEG, S> subDocument(int startParagraph, int startColumn, int endParagraph, int endColumn) {
        int start = getAbsolutePosition(startParagraph, startColumn);
        int end = getAbsolutePosition(endParagraph, endColumn);
        return subDocument(start, end);
    }

    /**
     * Returns the selection range in the given paragraph. Note: this method will return
     * {@code IndexRange(start, paragraph.length() + 1)} when the selection includes a newline character.
     */
    default IndexRange getParagraphSelection(int paragraph) {
        return getParagraphSelection(getCaretSelectionBind(), paragraph);
    }

    public IndexRange getParagraphSelection(Selection selection, int paragraph);

    /***************
     *             *
     *   Actions   *
     *             *
     ***************/

    /**
     * Positions the anchor and caretPosition explicitly,
     * effectively creating a selection.
     */
    default void selectRange(int anchor, int caretPosition) {
        getCaretSelectionBind().selectRangeExpl(anchor, caretPosition);
    }

    /**
     * Positions the anchor and caretPosition explicitly,
     * effectively creating a selection.
     *
     *
Caution: see {@link #getAbsolutePosition(int, int)} to know how the column index argument
     * can affect the returned position.

     */
    default void selectRange(int anchorParagraph, int anchorColumn, int caretPositionParagraph, int caretPositionColumn) {
        int anchor = getAbsolutePosition(anchorParagraph, anchorColumn);
        int caretPosition = getAbsolutePosition(caretPositionParagraph, caretPositionColumn);
        selectRange(anchor, caretPosition);
    }

    /**
     * Displaces the caret from the selection by positioning only the caret to the new location without
     * also affecting the selection's {@link #getAnchor() anchor} or the {@link #getSelection() selection}.
     * Do not confuse this method with {@link NavigationActions#moveTo(int)}, which is the normal way of moving the
     * caret. This method can be used to achieve the special case of positioning the caret outside or inside the
     * selection, as opposed to always being at the boundary. Use with care.
     */
    public void displaceCaret(int pos);

    /**
     * Replaces a range of characters with the given text.
     *
     * It must hold {@code 0 <= start <= end <= getLength()}.
     *
     * @param start Start index of the range to replace, inclusive.
     * @param end End index of the range to replace, exclusive.
     * @param text The text to put in place of the deleted range.
     * It must not be null.
     */
    void replaceText(int start, int end, String text);

    /**
     * Replaces a range of characters with the given text.
     *
     * It must hold {@code 0 <= start <= end <= getLength()} where
     * {@code start = getAbsolutePosition(startParagraph, startColumn);} and is inclusive, and
     * {@code int end = getAbsolutePosition(endParagraph, endColumn);} and is exclusive.
     *
     *
Caution: see {@link #getAbsolutePosition(int, int)} to know how the column index argument
     * can affect the returned position.

     *
     * @param text The text to put in place of the deleted range.
     * It must not be null.
     */
    default void replaceText(int startParagraph, int startColumn, int endParagraph, int endColumn, String text) {
        int start = getAbsolutePosition(startParagraph, startColumn);
        int end = getAbsolutePosition(endParagraph, endColumn);
        replaceText(start, end, text);
    }

    /**
     * Replaces a range of characters with the given rich-text document.
     */
    void replace(int start, int end, StyledDocument<PS, SEG, S> replacement);

    /**
     * Starts building a list of changes to be used to update multiple portions of the underlying document
     * in one call. To execute the changes, call {@link MultiChangeBuilder#commit()}. If the number of
     * changes are known at compile time, use {@link #createMultiChange(int)} for better memory efficiency.
     */
    MultiChangeBuilder<PS, SEG, S> createMultiChange();

    /**
     * Same as {@link #createMultiChange()} but the number of changes are specified to be more memory efficient.
     */
    MultiChangeBuilder<PS, SEG, S> createMultiChange(int numOfChanges);

    /**
     * Replaces a range of characters with the given segment.
     *
     * It must hold {@code 0 <= start <= end <= getLength()}.
     *
     * @param start Start index of the range to replace, inclusive.
     * @param end End index of the range to replace, exclusive.
     * @param seg The seg to put in place of the deleted range.
     * It must not be null.
     */
    void replace(int start, int end, SEG seg, S style);

    /**
     * Replaces a range of characters with the given segment.
     *
     * It must hold {@code 0 <= start <= end <= getLength()} where
     * {@code start = getAbsolutePosition(startParagraph, startColumn);} and is inclusive, and
     * {@code int end = getAbsolutePosition(endParagraph, endColumn);} and is exclusive.
     *
     *
Caution: see {@link #getAbsolutePosition(int, int)} to know how the column index argument
     * can affect the returned position.

     *
     * @param seg The segment to put in place of the deleted range.
     * It must not be null.
     */
    default void replace(int startParagraph, int startColumn, int endParagraph, int endColumn, SEG seg, S style) {
        int start = getAbsolutePosition(startParagraph, startColumn);
        int end = getAbsolutePosition(endParagraph, endColumn);
        replace(start, end, seg, style);
    }

    /**
     * Replaces a range of characters with the given rich-text document.
     *
     *
Caution: see {@link #getAbsolutePosition(int, int)} to know how the column index argument
     * can affect the returned position.

     */
    default void replace(int startParagraph, int startColumn, int endParagraph, int endColumn, StyledDocument<PS, SEG, S> replacement) {
        int start = getAbsolutePosition(startParagraph, startColumn);
        int end = getAbsolutePosition(endParagraph, endColumn);
        replace(start, end, replacement);
    }

    /**
     * Replaces a range of characters with the given text.
     *
     * @param range The range to replace. It must not be null.
     * @param text The text to put in place of the deleted range.
     * It must not be null.
     *
     * @see #replaceText(int, int, String)
     */
    default void replaceText(IndexRange range, String text) {
        replaceText(range.getStart(), range.getEnd(), text);
    }

    /**
     * Replaces a range of characters with the given seg.
     *
     * @param range The range to replace. It must not be null.
     * @param seg The segment to put in place of the deleted range.
     * It must not be null.
     *
     * @see #replace(int, int, Object, Object)
     */
    default void replace(IndexRange range, SEG seg, S style) {
        replace(range.getStart(), range.getEnd(), seg, style);
    }

    /**
     * Equivalent to
     * {@code replace(range.getStart(), range.getEnd(), replacement)}.
     */
    default void replace(IndexRange range, StyledDocument<PS, SEG, S> replacement) {
        replace(range.getStart(), range.getEnd(), replacement);
    }

    /**
     * Returns the absolute position (i.e. the spot in-between characters) to the left of the given column in the given paragraph.
     *
     *
For example, given a text with only one line {@code "text"} and the columnIndex value of {@code 1}, "position 1" would be returned:

     *

     *  ┌ character index 0
     *  | ┌ character index 1
     *  | |   ┌ character index 3
     *  | |   |
     *  v v   v
     *
     * |t|e|x|t|
     *
     * ^ ^     ^
     * | |     |
     * | |     └ position 4
     * | └ position 1
     * └ position 0
     *

     *
     *
Warning: Off-By-One errors can easily occur

     *
If the column index spans outside of the given paragraph's length, the returned value will
     * pass on to the previous/next paragraph. In other words, given a document with two paragraphs
     * (where the first paragraph's text is "some" and the second "thing"), then the following statements are true:

     *

     *
getAbsolutePosition(0, "some".length()) == 4 == getAbsolutePosition(1, -1)

     *
getAbsolutePosition(0, "some".length() + 1) == 5 == getAbsolutePosition(1, 0)

     *

     *
     * @param paragraphIndex The index of the paragraph from which to start.
     * @param columnIndex If positive, the index going forward (the given paragraph's line or the next one(s)).
     *                    If negative, the index going backward (the previous paragraph's line(s)
     */
    int getAbsolutePosition(int paragraphIndex, int columnIndex);

    /**
     * Disposes this area, preventing memory leaks.
     */
    public void dispose();
}


text:
#include <iostream>
#include <fstream>
#include <boost/lexical_cast.hpp>
#include <stdio.h>
#include <stdexcept>
#include "xmltopologyreader.h"

namespace votca { namespace csg {

bool XMLTopologyReader::ReadTopology(string filename, Topology &top)
{
  _top = ⊤

  _parser.NextHandler(this, &XMLTopologyReader::ParseRoot);
  _parser.Open(filename);

  return true;
}

void XMLTopologyReader::ReadTopolFile(string file)
{
    TopologyReader *reader;
    reader = TopReaderFactory().Create(file);
    if(!reader)
        throw runtime_error(file + ": unknown topology format");

    reader->ReadTopology(file, *_top);

    delete reader;
}

void XMLTopologyReader::ParseRoot(const string &el, map<string, string> &attr)
{
    if(el == "topology") {
        if(attr["base"] != "")
            ReadTopolFile(attr["base"]);
        _parser.NextHandler(this, &XMLTopologyReader::ParseTopology);
    }
    else {
        throw std::runtime_error("wrong root node in xml topology file");
    }
}

void XMLTopologyReader::ParseTopology(const string &el, map<string, string> &attr)
{
    if(el == "molecules") {
         _parser.NextHandler(this, &XMLTopologyReader::ParseMolecules);
    }
    else if(el == "box") {
        matrix m;
        m.ZeroMatrix();
        string xx = attr["xx"];
        string yy = attr["yy"];
        string zz = attr["zz"];
        if (xx == "" || yy == "" || zz == "")
            throw runtime_error("invalid box tag - missing xx, yy or zz");
        try {
           m[0][0] = boost::lexical_cast<double>(xx);
        } catch(boost::bad_lexical_cast &) {
           throw std::runtime_error("Cannot convert xx='"+ xx + "' to double");
        }
        try {
           m[1][1] = boost::lexical_cast<double>(yy);
        } catch(boost::bad_lexical_cast &) {
           throw std::runtime_error("Cannot convert yy='"+ yy + "' to double");
        }
        try {
           m[2][2] = boost::lexical_cast<double>(zz);
        } catch(boost::bad_lexical_cast &) {
           throw std::runtime_error("Cannot convert zz='"+ zz + "' to double");
        }
        _top->setBox(m);
        _parser.NextHandler(this, &XMLTopologyReader::ParseTopology);
    }
    else if(el == "beadtypes") {
         _parser.NextHandler(this, &XMLTopologyReader::ParseBeadTypes);
    } else if (el == "h5md_particle_group") {
        _top->setParticleGroup(attr["name"]);
        _parser.NextHandler(this, &XMLTopologyReader::ParseTopology);
    } else {
        throw runtime_error("unknown tag: "+ el);
    }
}

void XMLTopologyReader::ParseMolecules(const string &el, map<string, string> &attr)
{
    map<string, string>::iterator iter;
    if (el == "clear") {
        _top->ClearMoleculeList();
        _parser.IgnoreChilds();
    }
    else if (el == "rename") {
        string molname = attr["name"];
        string range = attr["range"];
        if (molname == "" || range == "")
            throw runtime_error("invalid rename tag");
        _top->RenameMolecules(range, molname);
        _parser.IgnoreChilds();
    }
    if (el == "define") {
        string molname = attr["name"];
        string first = attr["first"];
        string nbeads = attr["nbeads"];
        string nmols = attr["nmols"];
        if (molname == "" || first == "" || nbeads == "" || nmols == "")
            throw runtime_error("invalid define tag - missing molname, first, nbeads or nmols");
        int first_int, nbeads_int, nmols_int;
        try {
           first_int = boost::lexical_cast<int>(first);
        } catch(boost::bad_lexical_cast &) {
           throw std::runtime_error("Cannot convert first='"+ first + "' to int");
        }
        if (first_int < 1) {
           throw std::runtime_error("Attribute first is supose to be > 0, but found " + boost::lexical_cast<string>(first_int));
        }
        try {
           nbeads_int = boost::lexical_cast<int>(nbeads);
        } catch(boost::bad_lexical_cast &) {
           throw std::runtime_error("Cannot convert nbeads='"+ nbeads + "' to int");
        }
        if (nbeads_int < 1) {
           throw std::runtime_error("Attribute nbeads is supose to be > 0, but found " + boost::lexical_cast<string>(nbeads_int));
        }
        try {
           nmols_int = boost::lexical_cast<int>(nmols);
        } catch(boost::bad_lexical_cast &) {
           throw std::runtime_error("Cannot convert nmols='"+ nmols + "' to int");
        }
        if (nmols_int < 1) {
           throw std::runtime_error("Attribute nmols is supose to be > 0, but found " + boost::lexical_cast<string>(nmols_int));
        }
        _top->CreateMoleculesByRange(molname,first_int, nbeads_int, nmols_int);
        _parser.IgnoreChilds();
    }
}

void XMLTopologyReader::ParseBeadTypes(const string &el, map<string, string> &attr)
{
    if (el == "rename") {
        string name = attr["name"];
        string newname = attr["newname"];
        if (name == "" || newname == "")
            throw runtime_error("invalid rename tag");
        _top->RenameBeadType(name, newname);
        _parser.IgnoreChilds();
    }
    if (el == "mass") {
        string name = attr["name"];
        string svalue = attr["value"];
        if (name == "" || svalue == "")
            throw runtime_error("invalid mass tag");
	double value = boost::lexical_cast<double>(svalue);
        _top->SetBeadTypeMass(name, value);
        _parser.IgnoreChilds();
    }
}
}}


text:
    <button class="butter-btn btn-light add-track" title="Add a new Layer for your events">+
    </button>


text:
package online.pizzacrust.netman;

import eu.hexagonmc.spigot.annotation.plugin.Plugin;

import org.bukkit.plugin.java.JavaPlugin;

import online.pizzacrust.netman.api.PacketSenderProvider;
import online.pizzacrust.netman.api.bukkit.BukkitPacketSender;

@Plugin(name = "NetmanBukkit", version = "1.0-SNAPSHOT", description = "Implementation of Netman for Bukkit")
public class NetmanBukkitPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        BukkitPacketSender.SOURCE = this;
        getLogger().info("Registering required Bukkit packet sender...");
        PacketSenderProvider.registerPacketSender(new BukkitPacketSender());
        getLogger().info("Registering required Bukkit packet handler...");
        getServer().getMessenger().registerIncomingPluginChannel(this, "netman", new FactoryMessageCallback());
        getServer().getMessenger().registerOutgoingPluginChannel(this, "netman");
    }
    @Override
    public void onDisable() {
        getLogger().info("Netman has been disabled!");
    }
}


text:
#region S# License

#endregion S# License
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Markup;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("S#.Xaml")]
[assembly: AssemblyDescription("Misc graphical components.")]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3B91EF1C-89BB-4BC0-8D4B-640A738253ED")]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>.  For example, if you are using US english
//in your source files, set the <UICulture> to en-US.  Then uncomment
//the NeutralResourceLanguage attribute below.  Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]

[assembly: ThemeInfo(
	ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
	//(used if a resource is not found in the page,
	// or application resource dictionaries)
	ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
	//(used if a resource is not found in the page,
	// app, or any theme specific resource dictionaries)
)]

[assembly: XmlnsDefinition("http://schemas.stocksharp.com/xaml", "StockSharp.Xaml")]
[assembly: XmlnsDefinition("http://schemas.stocksharp.com/xaml", "StockSharp.Xaml.PropertyGrid")]


text:
import unittest

from katas.kyu_8.welcome_to_the_city import say_hello

class SayHelloTestCase(unittest.TestCase):
    def test_equals(self):
        self.assertEqual(say_hello(
            ['John', 'Smith'], 'Phoenix', 'Arizona'
        ), 'Hello, John Smith! Welcome to Phoenix, Arizona!')

    def test_equals_2(self):
        self.assertEqual(say_hello(
            ['Franklin', 'Delano', 'Roosevelt'], 'Chicago', 'Illinois'
        ), 'Hello, Franklin Delano Roosevelt! Welcome to Chicago, Illinois!')

    def test_equals_3(self):
        self.assertEqual(say_hello(
            ['Wallace', 'Russel', 'Osbourne'], 'Albany', 'New York'
        ), 'Hello, Wallace Russel Osbourne! Welcome to Albany, New York!')


text:
package ru.yandexmusiccasher.presentation.utils;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static android.content.ClipDescription.MIMETYPE_TEXT_PLAIN;

/**
 * Created by grish on 04.03.2017.
 */

public class IntentUtils {

    public static void copyText(String text, Context context){
        ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        ClipData clip = ClipData.newPlainText("", text);
        clipboard.setPrimaryClip(clip);
    }

    public static String pasteText(Context context){
        ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        if(clipboard.hasPrimaryClip()&&clipboard.getPrimaryClipDescription().hasMimeType(MIMETYPE_TEXT_PLAIN))
        return clipboard.getPrimaryClip().getItemAt(0).getText().toString();
        else return "";
    }

    public static void openURL(String url, Context context){
        Intent intent= new Intent(Intent.ACTION_VIEW, Uri.parse(url));
        context.startActivity(intent);
    }

    public static boolean isStringUrl(String string){
        Pattern p = Pattern.compile("^((https?|ftp)://|(www|ftp)\\.)?[a-z0-9-]+(\\.[a-z0-9-]+)+([/?].*)?$");
        Matcher m = p.matcher(string);
        return m.find();
    }

    public static String toURL(String str){
        return str.startsWith("http") ? str : "http://"+str;
    }

}


text:
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
using Server.Network;

namespace Server.Factions
{
	public class ElectionGump : FactionGump
	{
		private PlayerMobile m_From;
		private Election m_Election;

		public override void OnResponse( NetState sender, RelayInfo info )
		{
			switch ( info.ButtonID )
			{
				case 0: // back
				{
					m_From.SendGump( new FactionStoneGump( m_From, m_Election.Faction ) );
					break;
				}
				case 1: // vote
				{
					if ( m_Election.State == ElectionState.Election )
						m_From.SendGump( new VoteGump( m_From, m_Election ) );

					break;
				}
				case 2: // campaign
				{
					if ( m_Election.CanBeCandidate( m_From ) )
						m_Election.AddCandidate( m_From );

					break;
				}
			}
		}

		public ElectionGump( PlayerMobile from, Election election ) : base( 50, 50 )
		{
			m_From = from;
			m_Election = election;

			AddPage( 0 );

			AddBackground( 0, 0, 420, 180, 5054 );
			AddBackground( 10, 10, 400, 160, 3000 );

			AddHtmlText( 20, 20, 380, 20, election.Faction.Definition.Header, false, false );

			// NOTE: Gump not entirely OSI-accurate, intentionally so

			switch ( election.State )
			{
				case ElectionState.Pending:
				{
					TimeSpan toGo = ( election.LastStateTime + Election.PendingPeriod ) - DateTime.Now;
					int days = (int) (toGo.TotalDays + 0.5);

					AddHtmlLocalized( 20, 40, 380, 20, 1038034, false, false ); // A new election campaign is pending

					if ( days > 0 )
					{
						AddHtmlLocalized( 20, 60, 280, 20, 1018062, false, false ); // Days until next election :
						AddLabel( 300, 60, 0, days.ToString() );
					}
					else
					{
						AddHtmlLocalized( 20, 60, 280, 20, 1018059, false, false ); // Election campaigning begins tonight.
					}

					break;
				}
				case ElectionState.Campaign:
				{
					TimeSpan toGo = ( election.LastStateTime + Election.CampaignPeriod ) - DateTime.Now;
					int days = (int) (toGo.TotalDays + 0.5);

					AddHtmlLocalized( 20, 40, 380, 20, 1018058, false, false ); // There is an election campaign in progress.

					if ( days > 0 )
					{
						AddHtmlLocalized( 20, 60, 280, 20, 1038033, false, false ); // Days to go:
						AddLabel( 300, 60, 0, days.ToString() );
					}
					else
					{
						AddHtmlLocalized( 20, 60, 280, 20, 1018061, false, false ); // Campaign in progress. Voting begins tonight.
					}

					if ( m_Election.CanBeCandidate( m_From ) )
					{
						AddButton( 20, 110, 4005, 4007, 2, GumpButtonType.Reply, 0 );
						AddHtmlLocalized( 55, 110, 350, 20, 1011427, false, false ); // CAMPAIGN FOR LEADERSHIP
					}
					else
					{
						PlayerState pl = PlayerState.Find( m_From );

						if ( pl == null || pl.Rank.Rank < Election.CandidateRank )
							AddHtmlLocalized( 20, 100, 380, 20, 1010118, false, false ); // You must have a higher rank to run for office
					}

					break;
				}
				case ElectionState.Election:
				{
					TimeSpan toGo = ( election.LastStateTime + Election.VotingPeriod ) - DateTime.Now;
					int days = (int) Math.Ceiling( toGo.TotalDays );

					AddHtmlLocalized( 20, 40, 380, 20, 1018060, false, false ); // There is an election vote in progress.

					AddHtmlLocalized( 20, 60, 280, 20, 1038033, false, false );
					AddLabel( 300, 60, 0, days.ToString() );

					AddHtmlLocalized( 55, 100, 380, 20, 1011428, false, false ); // VOTE FOR LEADERSHIP
					AddButton( 20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0 );

					break;
				}
			}

			AddButton( 20, 140, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 55, 140, 350, 20, 1011012, false, false ); // CANCEL
		}
	}
}


text:
from time import sleep
import RPi.GPIO as GPIO

from .MotionCaptureService import MotionCaptureService

GPIO.setmode(GPIO.BOARD)
motionCaptureService = MotionCaptureService(21)
motionCaptureService.addEvent()

# you can continue doing other stuff here
while True:
    pass


text:
namespace Ecwid.Models
{
    /// <summary>
    ///     The object returned from the Discount Coupon API when creating new Discount Coupons
    /// </summary>
    public class DiscountCouponCreateStatus
    {
        /// <summary>
        /// Internal unique coupon Id
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// Code of the created coupon
        /// </summary>
        public string Code { get; set; }
    }
}


text:
.class Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;
.super Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;
.source "LoggingManagedHttpClientConnection.java"

# instance fields
.field private final headerlog:Lorg/apache/commons/logging/Log;

.field private final log:Lorg/apache/commons/logging/Log;

.field private final wire:Lorg/apache/http/impl/conn/Wire;

# direct methods
.method public constructor <init>(Ljava/lang/String;Lorg/apache/commons/logging/Log;Lorg/apache/commons/logging/Log;Lorg/apache/commons/logging/Log;IILjava/nio/charset/CharsetDecoder;Ljava/nio/charset/CharsetEncoder;Lorg/apache/http/config/MessageConstraints;Lorg/apache/http/entity/ContentLengthStrategy;Lorg/apache/http/entity/ContentLengthStrategy;Lorg/apache/http/io/HttpMessageWriterFactory;Lorg/apache/http/io/HttpMessageParserFactory;)V
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Lorg/apache/commons/logging/Log;",
            "Lorg/apache/commons/logging/Log;",
            "Lorg/apache/commons/logging/Log;",
            "II",
            "Ljava/nio/charset/CharsetDecoder;",
            "Ljava/nio/charset/CharsetEncoder;",
            "Lorg/apache/http/config/MessageConstraints;",
            "Lorg/apache/http/entity/ContentLengthStrategy;",
            "Lorg/apache/http/entity/ContentLengthStrategy;",
            "Lorg/apache/http/io/HttpMessageWriterFactory",
            "<",
            "Lorg/apache/http/HttpRequest;",
            ">;",
            "Lorg/apache/http/io/HttpMessageParserFactory",
            "<",
            "Lorg/apache/http/HttpResponse;",
            ">;)V"
        }
    .end annotation

    move-object v0, p0

    move-object v1, p1

    move/from16 v2, p5

    move/from16 v3, p6

    move-object/from16 v4, p7

    move-object/from16 v5, p8

    move-object/from16 v6, p9

    move-object/from16 v7, p10

    move-object/from16 v8, p11

    move-object/from16 v9, p12

    move-object/from16 v10, p13

    invoke-direct/range {v0 .. v10}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;-><init>(Ljava/lang/String;IILjava/nio/charset/CharsetDecoder;Ljava/nio/charset/CharsetEncoder;Lorg/apache/http/config/MessageConstraints;Lorg/apache/http/entity/ContentLengthStrategy;Lorg/apache/http/entity/ContentLengthStrategy;Lorg/apache/http/io/HttpMessageWriterFactory;Lorg/apache/http/io/HttpMessageParserFactory;)V

    iput-object p2, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    iput-object p3, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    new-instance v0, Lorg/apache/http/impl/conn/Wire;

    invoke-direct {v0, p4, p1}, Lorg/apache/http/impl/conn/Wire;-><init>(Lorg/apache/commons/logging/Log;Ljava/lang/String;)V

    iput-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->wire:Lorg/apache/http/impl/conn/Wire;

    return-void
.end method

# virtual methods
.method public close()V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-super {p0}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;->isOpen()Z

    move-result v0

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    invoke-interface {v0}, Lorg/apache/commons/logging/Log;->isDebugEnabled()Z

    move-result v0

    if-nez v0, :cond_1

    :goto_1
    invoke-super {p0}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;->close()V

    goto :goto_0

    :cond_1
    iget-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ": Close connection"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    goto :goto_1
.end method

.method protected getSocketInputStream(Ljava/net/Socket;)Ljava/io/InputStream;
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-super {p0, p1}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;->getSocketInputStream(Ljava/net/Socket;)Ljava/io/InputStream;

    move-result-object v0

    iget-object v2, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->wire:Lorg/apache/http/impl/conn/Wire;

    invoke-virtual {v2}, Lorg/apache/http/impl/conn/Wire;->enabled()Z

    move-result v2

    if-nez v2, :cond_0

    :goto_0
    return-object v0

    :cond_0
    new-instance v1, Lorg/apache/http/impl/conn/LoggingInputStream;

    iget-object v2, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->wire:Lorg/apache/http/impl/conn/Wire;

    invoke-direct {v1, v0, v2}, Lorg/apache/http/impl/conn/LoggingInputStream;-><init>(Ljava/io/InputStream;Lorg/apache/http/impl/conn/Wire;)V

    move-object v0, v1

    goto :goto_0
.end method

.method protected getSocketOutputStream(Ljava/net/Socket;)Ljava/io/OutputStream;
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    invoke-super {p0, p1}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;->getSocketOutputStream(Ljava/net/Socket;)Ljava/io/OutputStream;

    move-result-object v0

    iget-object v2, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->wire:Lorg/apache/http/impl/conn/Wire;

    invoke-virtual {v2}, Lorg/apache/http/impl/conn/Wire;->enabled()Z

    move-result v2

    if-nez v2, :cond_0

    :goto_0
    return-object v0

    :cond_0
    new-instance v1, Lorg/apache/http/impl/conn/LoggingOutputStream;

    iget-object v2, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->wire:Lorg/apache/http/impl/conn/Wire;

    invoke-direct {v1, v0, v2}, Lorg/apache/http/impl/conn/LoggingOutputStream;-><init>(Ljava/io/OutputStream;Lorg/apache/http/impl/conn/Wire;)V

    move-object v0, v1

    goto :goto_0
.end method

.method protected onRequestSubmitted(Lorg/apache/http/HttpRequest;)V
    .locals 8

    if-nez p1, :cond_1

    :cond_0
    return-void

    :cond_1
    iget-object v5, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    invoke-interface {v5}, Lorg/apache/commons/logging/Log;->isDebugEnabled()Z

    move-result v5

    if-eqz v5, :cond_0

    iget-object v5, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string/jumbo v7, " >> "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-interface {p1}, Lorg/apache/http/HttpRequest;->getRequestLine()Lorg/apache/http/RequestLine;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-interface {v5, v6}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    invoke-interface {p1}, Lorg/apache/http/HttpRequest;->getAllHeaders()[Lorg/apache/http/Header;

    move-result-object v2

    move-object v0, v2

    array-length v4, v0

    const/4 v3, 0x0

    :goto_0
    if-ge v3, v4, :cond_0

    aget-object v1, v0, v3

    iget-object v5, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string/jumbo v7, " >> "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-interface {v5, v6}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method protected onResponseReceived(Lorg/apache/http/HttpResponse;)V
    .locals 8

    if-nez p1, :cond_1

    :cond_0
    return-void

    :cond_1
    iget-object v5, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    invoke-interface {v5}, Lorg/apache/commons/logging/Log;->isDebugEnabled()Z

    move-result v5

    if-eqz v5, :cond_0

    iget-object v5, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string/jumbo v7, " << "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getStatusLine()Lorg/apache/http/StatusLine;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-interface {v5, v6}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    invoke-interface {p1}, Lorg/apache/http/HttpResponse;->getAllHeaders()[Lorg/apache/http/Header;

    move-result-object v2

    move-object v0, v2

    array-length v4, v0

    const/4 v3, 0x0

    :goto_0
    if-ge v3, v4, :cond_0

    aget-object v1, v0, v3

    iget-object v5, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->headerlog:Lorg/apache/commons/logging/Log;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string/jumbo v7, " << "

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-interface {v5, v6}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method public setSocketTimeout(I)V
    .locals 3

    iget-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    invoke-interface {v0}, Lorg/apache/commons/logging/Log;->isDebugEnabled()Z

    move-result v0

    if-nez v0, :cond_0

    :goto_0
    invoke-super {p0, p1}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;->setSocketTimeout(I)V

    return-void

    :cond_0
    iget-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ": set socket timeout to "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    goto :goto_0
.end method

.method public shutdown()V
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    iget-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    invoke-interface {v0}, Lorg/apache/commons/logging/Log;->isDebugEnabled()Z

    move-result v0

    if-nez v0, :cond_0

    :goto_0
    invoke-super {p0}, Lorg/apache/http/impl/conn/DefaultManagedHttpClientConnection;->shutdown()V

    return-void

    :cond_0
    iget-object v0, p0, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->log:Lorg/apache/commons/logging/Log;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {p0}, Lorg/apache/http/impl/conn/LoggingManagedHttpClientConnection;->getId()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, ": Shutdown connection"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-interface {v0, v1}, Lorg/apache/commons/logging/Log;->debug(Ljava/lang/Object;)V

    goto :goto_0
.end method


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Demo : jPlayer as an audio playlist player</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

            <button class="jp-previous" role="button" tabindex="0">previous</button>
            <button class="jp-play" role="button" tabindex="0">play</button>
            <button class="jp-next" role="button" tabindex="0">next</button>
            <button class="jp-stop" role="button" tabindex="0">stop</button>

            <button class="jp-mute" role="button" tabindex="0">mute</button>
            <button class="jp-volume-max" role="button" tabindex="0">max volume</button>

          Update Required
          To play the media you will need to either update your browser to a recent version or update your Flash plugin.


text:
echo "Starting supervisor for app..."
/opt/venv/bin/supervisord -c /etc/supervisord.conf -n


text:
title: Calling APIs
description: This tutorial will show you how to use Access Tokens to make authenticated API calls.
budicon: 546
topics:
  - quickstarts
  - native
  - ios
  - swift
github:
  path: 04-Calling-APIs
contentType: tutorial
useCase: quickstart
---

Auth0 provides a set of tools for protecting your resources with end-to-end authentication in your application.

In this tutorial, you'll learn how to get a token, attach it to a request (using the authorization header), and call any API you need to authenticate with.

Before you continue with this tutorial, make sure that you have completed the previous tutorials. This tutorial assumes that:
* You have completed the [Session Handling](/quickstart/native/ios-swift/03-user-sessions) tutorial and you know how to handle the `Credentials` object.
* You have set up a backend application as API. To learn how to do it, follow one of the [backend tutorials](/quickstart/backend).

<%= include('../_includes/_calling_api_create_api') %>

<%= include('../_includes/_calling_api_create_scope') %>

## Get the User's Access Token

To retrieve an Access Token that is authorized to access your API, you need to specify the **API Identifier** value you created in the [Auth0 APIs Dashboard](https://manage.auth0.com/#/apis).

Present the Hosted Login Page:

::: note
Depending on the standards in your API, you configure the authorization header differently. The code below is just an example.
:::

```swift
// HomeViewController.swift
let APIIdentifier = "API_IDENTIFIER" // Replace with the API Identifier value you created

Auth0
    .webAuth()
    .scope("openid profile")
    .audience(APIIdentifier)
    .start {
        switch $0 {
        case .failure(let error):
            // Handle the error
            print("Error: \(error)")
        case .success(let credentials):
            // Do something with credentials e.g.: save them.
            // Auth0 will automatically dismiss the hosted login page
            print("Credentials: \(credentials)")
        }
}
```

## Attach the Access Token

To give the authenticated user access to secured resources in your API, include the user's Access Token in the requests you send to the API.

```swift
// ProfileViewController.swift

let token  = ... // The accessToken you stored after authentication
let url = URL(string: "your api url")! // Set to your Protected API URL
var request = URLRequest(url: url)

request.addValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
    // Parse the response
}
```

## Send the Request

Send the request you created:

```swift
// ProfileViewController.swift

task.resume()
```


text:
import { Observable } from 'angular2/src/facade/async';
import { Pipe, PipeFactory } from './pipe';
import { ChangeDetectorRef } from '../change_detector_ref';
/**
 * Implements async bindings to Observable.
 *
 * # Example
 *
 * In this example we bind the description observable to the DOM. The async pipe will convert an
 *observable to the
 * latest value it emitted. It will also request a change detection check when a new value is
 *emitted.
 *
 *  ```
 * @Component({
 *   selector: "task-cmp",
 *   changeDetection: ON_PUSH
 * })
 * @View({
 *   template: "Task Description {{ description | async }}"
 * })
 * class Task {
 *  description:Observable<string>;
 * }
 *
 * ```
 *
 * @exportedAs angular2/pipes
 */
export declare class ObservablePipe extends Pipe {
    _ref: ChangeDetectorRef;
    _latestValue: Object;
    _latestReturnedValue: Object;
    _subscription: Object;
    _observable: Observable;
    constructor(_ref: ChangeDetectorRef);
    supports(obs: any): boolean;
    onDestroy(): void;
    transform(obs: Observable): any;
    _subscribe(obs: Observable): void;
    _dispose(): void;
    _updateLatestValue(value: Object): void;
}
/**
 * Provides a factory for [ObervablePipe].
 *
 * @exportedAs angular2/pipes
 */
export declare class ObservablePipeFactory extends PipeFactory {
    constructor();
    supports(obs: any): boolean;
    create(cdRef: any): Pipe;
}


text:
from multiprocessing import Process, Queue
from Queue import Empty, Full
from threading import Lock
from threads import LoopingThread

class Responder(LoopingThread):
    ''' A class used by the Plugin core to process the outqueue '''
    def __init__(self, plugin):
        super(Responder,self).__init__(speed=.1)
        self.plugin = plugin

    def process(self):
        try:
            res = self.plugin.outqueue.get_nowait()
            self.plugin.popcallback(res)(res[1])
        except Empty:
            pass

class Plugin(Process):
    ''' Contains a process that handles messages and pushes some back. '''
    def __new__(cls, *args, **kwargs):
        self = super(Plugin, cls).__new__(cls)
        super(Plugin, self).__init__()
        self.daemon = True
        self.inqueue = Queue()
        self.outqueue = Queue()
        self.callbacks = {}
        self.maxcallback = 0
        self.cblock = Lock()
        self.responder = Responder(self)
        self.responder.start()
        return self
    def __init__(self, *args, **kwargs):
        """__init__ should be overridden, but to prevent misplaced super( )
        calls, a placeholder __init__ has been put in place."""
        print "Erronious super call detected! (harmless)"

    def run(self):
        ''' Repeatedly process items in queue '''
        while 1:
            try:
                self.process(self.inqueue.get(True, 0.01))
            except Empty:
                pass

    def process(self, data):
        ''' Process a piece of data. All data is in dict form.

        "contacts" is a request for the full list of the user's contacts.

        "me" is a request for the users own information.
        The callback takes a models.user.User
        '''
        if type(data).__name__ != 'dict':
            return False
        t = data['type']
        try:
            if t == 'query':
                self.output(data, self._query(data['query'],data['page']))
            elif t == 'contacts':
                self.output(data, self._contacts())
            elif t == 'me':
                self.output(data, self._me())
            elif t == 'submit':
                self.output(data, self._submit_wavelet(data['wavelet']))
        except Exception as e:
            self.error(data, e)

    def output(self, data, result):
        self.outqueue.put((data['callback'], result))

    def pushcallback(self, c):
        self.cblock.acquire()
        self.callbacks[self.maxcallback]=c
        self.maxcallback += 1
        self.cblock.release()
        return self.maxcallback-1

    def popcallback(self, data):
        self.cblock.acquire()
        c = self.callbacks[data[0]]
        del self.callbacks[data[0]]
        self.cblock.release()
        return c

    def query(self, query, startpage, callback, errorcallback):
        ''' Callback function takes a models.digest.SearchResults '''
        self.inqueue.put({'type':'query',
                'query':query,
                'page':startpage,
                'callback':self.pushcallback(callback),
                'ecallback':self.pushcallback(errorcallback),
                })

    def get_contacts(self, callback, errorcallback):
        ''' Callback function takes a list of models.user.User '''
        self.inqueue.put({'type':'contacts',
                'ecallback':self.pushcallback(errorcallback),
                'callback':self.pushcallback(callback)})

    def get_me(self, callback, errorcallback):
        ''' Callback function takes a models.user.User '''
        self.inqueue.put({'type':'me',
                'ecallback':self.pushcallback(errorcallback),
                'callback':self.pushcallback(callback)})

    def submit_wavelet(self, wavelet, callback, errorcallback):
	''' Callback function takes a (wave_id, wavelet_id) tuple '''
	self.inqueue.put({'type':'submit',
		'wavelet':wavelet,
                'ecallback':self.pushcallback(errorcallback),
                'callback':self.pushcallback(callback)})

    def _query(self, query, startpage):
        ''' Override me! Return a models.digest.SearchResults '''
        pass

    def _contacts(self):
        ''' Override me! Return a list of models.user.User '''
        pass

    def _me(self):
        ''' Override me! Return a models.user.User '''
        pass

    def _submit_wavelet(self, wavelet):
	''' Override me! Return a (wave_id, wavelet_id) tuple '''
	pass

    def error(self, data, e):
        self.outqueue.put((data['ecallback'], e))


text:
<resources>
    <string name="app_name">SportsClub</string>
    <string name="back_quit">\'뒤로\' 버튼을 한번 더 누르시면 종료됩니다.</string>
    <string name="contest_info">대회 정보</string>
    <string name="group">클럽</string>
    <string name="rank">랭킹</string>
    <string name="my_info">내 정보</string>
    <string name="club_list">클럽 리스트</string>
    <string name="club_register">클럽 등록</string>
    <string name="club_management">클럽 관리</string>
    <string name="contest_total">전체대회</string>
    <string name="contest_public">정식대회</string>
    <string name="contest_friendship">친선대회</string>
    <string name="contest_management">대회운영</string>
    <string name="home">홈</string>
    <string name="total_rank">전체 랭킹</string>
    <string name="my_rank">내 랭킹</string>
    <string name="total_rank_name">TotalRank</string>
    <string name="my_rank_name">MyRank</string>
    <string name="home_name">Home</string>
    <string name="contest_name">Contest</string>
    <string name="group_name">Group</string>
    <string name="rank_name">Rank</string>
    <string name="my_info_name">MyInfo</string>
    <string name="club_list_name">ClubList</string>
    <string name="club_register_name">ClubRegister</string>
    <string name="club_management_name">ClubManagement</string>
    <string name="contest_total_name">ContestTotal</string>
    <string name="contest_public_name">ContestPublic</string>
    <string name="contest_friendship_name">ContestFriendship</string>
    <string name="contest_management_name">ContestManagement</string>

</resources>


text:
using LD39.Managers;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LD39.GameStates
{
    class EndState : GameState
    {
        private SpriteFont fnt;
        private SpriteFont bigFnt;

        private string header = "You Win!";
        private string madeByStr = "Congratulation you successfully shut down whole Duck Island";
        private int headerLength;
        private int enterToStartLength;
        private int madeByLength;

        public override void Init()
        {
            fnt = game.Content.Load<SpriteFont>("Fonts/fnt");
            bigFnt = game.Content.Load<SpriteFont>("Fonts/bigFnt");

            headerLength = (int)bigFnt.MeasureString(header).X;
            enterToStartLength = (int)fnt.MeasureString("Press 'enter' to go back to main menu...").X;
            madeByLength = (int)fnt.MeasureString(madeByStr).X;
        }

        public override void Update(GameTime gameTime)
        {

        }

        public override void Draw(SpriteBatch batch)
        {
            batch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);
            batch.DrawString(bigFnt, header, new Vector2(1280 / 2 - headerLength / 2, 200), Color.White);
            batch.DrawString(fnt, "Press 'enter' to go back to main menu...", new Vector2(1280 / 2 - enterToStartLength / 2, 200 + 120), Color.White);
            batch.DrawString(fnt, madeByStr, new Vector2(1280 / 2 - madeByLength / 2, 200 + 70), Color.White);

            if (InputManager.Instance.isPressed(Keys.Enter))
            {
                game.PopState();
            }

            batch.End();
        }
    }
}


text:
module medium {
	export class MediumAuthController {
		static $inject = ['$state', 'MediumService', 'UrlService'];

		constructor(private $state: ng.ui.IStateService, private MediumService: MediumService, private UrlService: common.services.UrlService) {
			var qs = UrlService.getQueryString();
			MediumService.login(qs.state, qs.code).then((response) => {
				MediumService.getCurrentUser().then((response) => {
					console.log(response);
					$state.go('medium');
				}).catch((error) => {
					console.error(error);
				})
			}).catch((error) => {
				console.error(error);
			});
		}
	}
}

(() => {
	angular.module('medium').controller('MediumAuthController', medium.MediumAuthController);
})();


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>The Kitchen Table – the Bruise</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="A short story about coming home to dinner.">
    <meta name="author" content="Jonathan Souder">
    <meta name="keywords" content="short-story, theelectricpark">
    <link rel="canonical" href="http://thebruise.net/short-story/theelectricpark/2015/09/30/the-kitchen-table/">
    <link rel="alternate" type="application/rss+xml" title="RSS Feed for the Bruise" href="/feed.xml" />

    <link rel="stylesheet" href="/css/pixyll.css?201510211628" type="text/css">

    <link href='//fonts.googleapis.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'>

      <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">

    <meta property="og:locale" content="en_US">
    <meta property="og:type" content="article">
    <meta property="og:title" content="The Kitchen Table">
    <meta property="og:description" content="When we fall, we get back up. We fall often.">
    <meta property="og:url" content="http://thebruise.net/short-story/theelectricpark/2015/09/30/the-kitchen-table/">
    <meta property="og:site_name" content="the Bruise">

    <meta name="twitter:card" content="summary" />

        <meta name="twitter:site" content="@thebruisedotnet" />

    <meta name="twitter:title" content="The Kitchen Table" />
    <meta name="twitter:description" content="A short story about coming home to dinner." />
    <meta name="twitter:url" content="http://thebruise.net/short-story/theelectricpark/2015/09/30/the-kitchen-table/" />

    <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
    <link rel="icon" type="image/png" href="/favicon-192x192.png" sizes="192x192">
    <link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">
    <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
    <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
    <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">

      the Bruise

        About
Contact

The Kitchen Table

  Sep 30, 2015

    3 minute read

Work was draining, as always. The commute home, doubly so. As I walked up the front steps, the only thing I could think about was finishing this day as quickly as possible and going to bed. Fumbling to find the keyhole, I dropped my keys and let out deep, defeated sigh. Then I made a rude gesture at them as they lay on the doorstep.

Finally inside, I set my things down and made my way to the kitchen. I'd left the light on again, which prompted more swearing. I can't afford to waste electricity like that. With one hand on the door, I surveyed the contents of the refrigerator. It reminded me of  the wastes of Siberia, a lot of cold, not a lot of food.

"Hello, Dean."

I started so hard I nearly fell over. "Jesus! Karen? What… what are you doing here?"

My eyes couldn't believe what they were seeing. And yet, there she was. Sitting at my dinner table. What used to be our dinner table. It must have been made in the 60's. We inherited it when her grandmother died. Ugly, outdated, and shabby, I would have gotten rid of it in a heartbeat, but she loved it. She used to play under it as a child. Now, she was sitting in her seat, the same place she always sat. Just like the last time I saw her.

Her stare was flat. Not cold, or angry, just flat. Some might have called it calculating, but I'm not sure that's a word I would ever use to describe Karen. Her flat, unbroken gaze followed me as I slowly crossed the room and lowered myself into the chair opposite her.

"It's good to see you."

"Yeah." Normally a single syllable word, I managed to make it at least three. "What…" Words were having trouble leaving my mouth, like they had to escape slowly through a wall of molasses. "I didn't expect to ever see you again."

"You don't seem particularly happy to see me."

"No, I…" What could I even say, after what had happened?

"Don't worry, I understand. I won't stay long. I just came by to tell you to get rid of this table. I know you've always hated it, and I think it's time you're finally done with it. It's time to move on."

"Move on…from the table?"

"Look, I know it has been a rough year for you." Her deep red lips turned ever so slightly down, betraying the flatness of her gaze.

She was still as beautiful as day we met. Time hadn't changed that an iota. I found myself getting lost in her deep green eyes. Two emerald pools glistening wetly, now staring intently at me again.

"I'm serious," she said as she began to stand. "It's time. This old thing isn't doing you any favors. It's time for it to go." As she glided by me towards the door, she lightly touched my shoulder. A cold chill washed over my body.

"Goodbye, Dean. Get some rest. You look terrible."

I didn't turn my head, but I heard the door latch behind me. I gripped the edge of the table hard. Even though I was seated, I felt like I was going to lose my balance. A single tear crept its way down my cheek.

I meant what I had said to her. I never expected to see her again.

Especially since she died over a year ago.

This story was originally posted to theelectricpark.com on 09/06/2013.

      Theme by John Otander (@4lpine).
      Available on Github.