text:
package ivorius.ivtoolkit.world;

import ivorius.ivtoolkit.blocks.IvTileEntityHelper;
import ivorius.ivtoolkit.tools.IvWorldData;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.fluid.IFluidState;
import net.minecraft.init.Biomes;
import net.minecraft.init.Fluids;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Random;
import java.util.function.Predicate;
import java.util.stream.Collectors;

/**
 * Created by lukas on 14.04.17.
 */
public interface MockWorld extends IBlockReader
{
    static Real of(World world)
    {
        return new Real(world);
    }

    World asWorld();

    boolean setBlockState(@Nonnull BlockPos pos, @Nonnull IBlockState state, int flags);

    @Nonnull
    IBlockState getBlockState(@Nonnull BlockPos pos);

    @Nullable
    TileEntity getTileEntity(@Nonnull BlockPos pos);

    void setTileEntity(@Nonnull BlockPos pos, @Nullable TileEntity tileEntity);

    List<Entity> getEntities(AxisAlignedBB bounds, @Nullable Predicate<? super Entity> predicate);

    boolean addEntity(Entity entity);

    boolean removeEntity(Entity entity);

    Random rand();

    default boolean setBlockState(BlockPos coord, IBlockState block)
    {
        return setBlockState(coord, block, 3);
    }

    @OnlyIn(Dist.CLIENT)
    default int getCombinedLight(BlockPos pos, int lightValue)
    {
        return 0;
    }

    default boolean isAirBlock(BlockPos pos)
    {
        IBlockState state = getBlockState(pos);
        return state.getBlock().isAir(state, this, pos);
    }

    @OnlyIn(Dist.CLIENT)
    default Biome getBiome(BlockPos pos)
    {
        return Biomes.DEFAULT;
    }

    default int getStrongPower(BlockPos pos, EnumFacing direction)
    {
        return 0;
    }

    @OnlyIn(Dist.CLIENT)
    default WorldType getWorldType()
    {
        return WorldType.CUSTOMIZED;
    }

    class Real implements MockWorld
    {
        public World world;

        public Real(World world)
        {
            this.world = world;
        }

        @Override
        public World asWorld()
        {
            return world;
        }

        @Override
        public boolean setBlockState(@Nonnull BlockPos pos, @Nonnull IBlockState state, int flags)
        {
            return world.setBlockState(pos, state, flags);
        }

        @Nonnull
        @Override
        public IBlockState getBlockState(@Nonnull BlockPos pos)
        {
            return world.getBlockState(pos);
        }

        @Override
        public IFluidState getFluidState(BlockPos pos)
        {
            return world.getFluidState(pos);
        }

        @Override
        public int getMaxLightLevel()
        {
            return world.getMaxLightLevel();
        }

        @Override
        public TileEntity getTileEntity(@Nonnull BlockPos pos)
        {
            return world.getTileEntity(pos);
        }

        @Override
        public void setTileEntity(@Nonnull BlockPos pos, TileEntity tileEntity)
        {
            world.setTileEntity(pos, tileEntity);
        }

        @Override
        public List<Entity> getEntities(AxisAlignedBB bounds, @Nullable Predicate<? super Entity> predicate)
        {
            return world.getEntitiesInAABBexcluding(null, bounds, predicate != null ? predicate::test : null);
        }

        @Override
        public boolean addEntity(Entity entity)
        {
            return world.spawnEntity(entity);
        }

        @Override
        public boolean removeEntity(Entity entity)
        {
            world.removeEntity(entity);
            return true;
        }

        @Override
        public Random rand()
        {
            return world.rand;
        }

        @Override
        public int getCombinedLight(BlockPos pos, int lightValue)
        {
            return world.getCombinedLight(pos, lightValue);
        }

        @Override
        public Biome getBiome(BlockPos pos)
        {
            return world.getBiome(pos);
        }

        @Override
        public int getStrongPower(BlockPos pos, EnumFacing direction)
        {
            return world.getStrongPower(pos, direction);
        }

        @Override
        public WorldType getWorldType()
        {
            return world.getWorldType();
        }
    }

    class Cache extends Real
    {
        public WorldCache cache;

        public Cache(WorldCache cache)
        {
            super(cache.world);
            this.cache = cache;
        }

        @Override
        public boolean setBlockState(@Nonnull BlockPos pos, @Nonnull IBlockState state, int flags)
        {
            return cache.setBlockState(pos, state, flags);
        }

        @Nonnull
        @Override
        public IBlockState getBlockState(@Nonnull BlockPos pos)
        {
            return cache.getBlockState(pos);
        }
    }

    class WorldData implements MockWorld
    {
        public IvWorldData worldData;
        public Random random = new Random();

        public WorldData(IvWorldData worldData)
        {
            this.worldData = worldData;
        }

        public static boolean isAt(@Nonnull BlockPos pos, NBTTagCompound nbt)
        {
            return pos.getX() == nbt.getInt("x")
                    && pos.getY() == nbt.getInt("y")
                    && pos.getZ() == nbt.getInt("z");
        }

        @Override
        public World asWorld()
        {
            throw new VirtualWorldException();
        }

        @Override
        public boolean setBlockState(@Nonnull BlockPos pos, @Nonnull IBlockState state, int flags)
        {
            worldData.blockCollection.setBlockState(pos, state);

            return true;
        }

        @Nonnull
        @Override
        public IBlockState getBlockState(@Nonnull BlockPos pos)
        {
            return worldData.blockCollection.getBlockState(pos);
        }

        @Override
        public IFluidState getFluidState(BlockPos pos)
        {
            return Fluids.EMPTY.getDefaultState();
        }

        @Override
        public TileEntity getTileEntity(@Nonnull BlockPos pos)
        {
            for (NBTTagCompound nbt : worldData.tileEntities) {
                if (isAt(pos, nbt))
                    return TileEntity.create(nbt);
            }

            return null;
        }

        @Override
        public void setTileEntity(@Nonnull BlockPos pos, TileEntity tileEntity)
        {
            worldData.tileEntities.removeIf(nbt -> isAt(pos, nbt));
            worldData.tileEntities.add(tileEntity.write(new NBTTagCompound()));
        }

        @Override
        public List<Entity> getEntities(AxisAlignedBB bounds, @Nullable Predicate<? super Entity> predicate)
        {
            return worldData.entities.stream()
                    .filter(nbt ->
                    {
                        NBTTagList pos = nbt.getList("Pos", 6);
                        return bounds.contains(new Vec3d(pos.getDouble(0), pos.getDouble(1), pos.getDouble(2)));
                    })
                    .map(nbt -> EntityType.create(nbt, IvTileEntityHelper.getAnyWorld()))
                    .filter(predicate)
                    .collect(Collectors.toList());
        }

        @Override
        public boolean addEntity(Entity entity)
        {
            // To make sure we don't have doubles
            removeEntity(entity);

            NBTTagCompound compound = new NBTTagCompound();
            if (!entity.writeUnlessRemoved(compound)) {
                return false;
            }

            return worldData.entities.add(compound);

        }

        @Override
        public boolean removeEntity(Entity entity)
        {
            return worldData.entities.removeIf(nbt -> entity.getUniqueID().equals(nbt.getUniqueId("UUID")));
        }

        @Override
        public Random rand()
        {
            return random;
        }
    }

    class VirtualWorldException extends RuntimeException
    {

    }
}


text:
class <%= Paysto.payment_class_name %> < ActiveRecord::Base
  # attr_accessible :amount,
  #                 :real_amount,
  #                 :gateway_code,
  #                 :gateway_payment_method

  has_one :<%= Paysto.invoice_class_name.underscore %>, class_name: '<%= Paysto.invoice_class_name %>', dependent: :destroy

  validates :amount, presence: true
  validates :amount, exclusion: { in: [0] }, allow_nil: false
end

redpajama_set_name: RedPajamaGithub


text:
typedef unsigned int SkColor;

namespace gfx {
class ImageSkia;
}

namespace views {
class View;
class Widget;
}

namespace athena {

// The view model for the representation of the activity.
class ATHENA_EXPORT ActivityViewModel {
 public:
  virtual ~ActivityViewModel() {}

  // Called after the view model is attached to the widget/window tree and
  // before it gets registered to the ActivityManager and the ResourceManager.
  // At this time the Activity can also be moved to a different place in the
  // Activity history.
  virtual void Init() = 0;

  // Returns a color most representative of this activity.
  virtual SkColor GetRepresentativeColor() const = 0;

  // Returns a title for the activity.
  virtual base::string16 GetTitle() const = 0;

  // Returns an icon for the activity.
  virtual gfx::ImageSkia GetIcon() const = 0;

  // True if the activity wants to use Widget's frame, or false if the activity
  // draws its own frame.
  virtual bool UsesFrame() const = 0;

  // Returns the contents view which might be NULL if the activity is not
  // loaded. Note that the caller should not hold on to the view since it can
  // be deleted by the resource manager.
  virtual views::View* GetContentsView() = 0;

  // Creates a custom widget for the activity. Returns NULL to use default
  // implementation.
  virtual views::Widget* CreateWidget() = 0;

  // Returns an image which can be used to represent the activity in e.g. the
  // overview mode. The returned image can have no size if either a view exists
  // or the activity has not yet been loaded or ever been presented. In that
  // case GetRepresentativeColor() should be used to clear the preview area.
  // Note that since the image gets created upon request, and the
  // ActivityViewModel will hold no reference to the returned image data. As
  // such it is advisable to hold on to the image as long as needed instead of
  // calling this function frequently since it will cause time to generate.
  virtual gfx::ImageSkia GetOverviewModeImage() = 0;

  // Prepares the contents view for overview.
  virtual void PrepareContentsForOverview() = 0;

  // Undoes any changes done by PrepareContentsForOverview().
  virtual void ResetContentsView() = 0;
};

}  // namespace athena

#endif  // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_VIEW_MODEL_H_


text:
@implementation HBAstValue

- (id) accept:(HBAstVisitor*)visitor
{
    return [visitor visitValue:self];
}

@end


text:
package org.apache.calcite.linq4j.tree;

/**
 * Represents a {@code throw} statement.
 */
public class ThrowStatement extends Statement {
  public final Expression expression;

  public ThrowStatement(Expression expression) {
    super(ExpressionType.Throw, Void.TYPE);
    this.expression = expression;
  }

  @Override public Statement accept(Visitor visitor) {
    visitor = visitor.preVisit(this);
    Expression expression = this.expression.accept(visitor);
    return visitor.visit(this, expression);
  }

  @Override void accept0(ExpressionWriter writer) {
    writer.append("throw ").append(expression).append(';').newlineAndIndent();
  }

  @Override public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }

    ThrowStatement that = (ThrowStatement) o;

    if (expression != null ? !expression.equals(that.expression) : that
        .expression != null) {
      return false;
    }

    return true;
  }

  @Override public int hashCode() {
    int result = super.hashCode();
    result = 31 * result + (expression != null ? expression.hashCode() : 0);
    return result;
  }
}

// End ThrowStatement.java


text:
package org.springframework.cloud.dataflow.server.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import org.springframework.cloud.dataflow.core.StreamDefinition;
import org.springframework.cloud.dataflow.core.StreamDeployment;
import org.springframework.cloud.dataflow.rest.resource.StreamDeploymentResource;
import org.springframework.cloud.dataflow.server.repository.StreamDefinitionRepository;
import org.springframework.cloud.dataflow.server.service.SkipperStreamService;
import org.springframework.cloud.deployer.spi.app.DeploymentState;
import org.springframework.cloud.skipper.domain.Deployer;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import static org.mockito.Matchers.anyListOf;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
 * Unit tests for StreamDeploymentController.
 *
 * @author Eric Bottard
 * @author Ilayaperumal Gopinathan
 */
@RunWith(MockitoJUnitRunner.class)
public class StreamDeploymentControllerTests {

	@Rule
	public ExpectedException thrown = ExpectedException.none();

	private SkipperStreamDeploymentController controller;

	@Mock
	private StreamDefinitionRepository streamDefinitionRepository;

	@Mock
	private SkipperStreamService skipperStreamService;

	@Mock
	private Deployer deployer;

	@Before
	public void setup() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
		this.controller = new SkipperStreamDeploymentController(streamDefinitionRepository, skipperStreamService);
	}

	@Test
	@SuppressWarnings("unchecked")
	public void testDeployViaStreamService() {
		this.controller.deploy("test", new HashMap<>());
		ArgumentCaptor<String> argumentCaptor1 = ArgumentCaptor.forClass(String.class);
		ArgumentCaptor<Map> argumentCaptor2 = ArgumentCaptor.forClass(Map.class);
		verify(skipperStreamService).deployStream(argumentCaptor1.capture(), argumentCaptor2.capture());
		Assert.assertEquals(argumentCaptor1.getValue(), "test");
	}

	@Test
	public void testRollbackViaStreamService() {
		this.controller.rollback("test1", 2);
		ArgumentCaptor<String> argumentCaptor1 = ArgumentCaptor.forClass(String.class);
		ArgumentCaptor<Integer> argumentCaptor2 = ArgumentCaptor.forClass(Integer.class);
		verify(skipperStreamService).rollbackStream(argumentCaptor1.capture(), argumentCaptor2.capture());
		Assert.assertEquals(argumentCaptor1.getValue(), "test1");
		Assert.assertTrue("Rollback version is incorrect", argumentCaptor2.getValue() == 2);
	}

	@Test
	public void testPlatformsListViaSkipperClient() {
		when(skipperStreamService.platformList()).thenReturn(Arrays.asList(deployer));
		this.controller.platformList();
		verify(skipperStreamService, times(1)).platformList();
	}

	@Test
	public void testShowStreamInfo() {
		Map<String, String> deploymentProperties1 = new HashMap<>();
		deploymentProperties1.put("test1", "value1");
		Map<String, String> deploymentProperties2 = new HashMap<>();
		deploymentProperties2.put("test2", "value2");
		Map<String, Map<String, String>> streamDeploymentProperties = new HashMap<>();
		streamDeploymentProperties.put("time", deploymentProperties1);
		streamDeploymentProperties.put("log", deploymentProperties2);
		Map<String, String> appVersions = new HashMap<>();
		appVersions.put("time", "1.0.0.BUILD-SNAPSHOT");
		appVersions.put("log", "1.0.0.BUILD-SNAPSHOT");
		StreamDefinition streamDefinition = new StreamDefinition("testStream1", "time | log");
		StreamDeployment streamDeployment = new StreamDeployment(streamDefinition.getName(),
				new JSONObject(streamDeploymentProperties).toString());
		Map<StreamDefinition, DeploymentState> streamDeploymentStates = new HashMap<>();
		streamDeploymentStates.put(streamDefinition, DeploymentState.deployed);
		when(this.streamDefinitionRepository.findOne(streamDefinition.getName())).thenReturn(streamDefinition);
		when(this.skipperStreamService.info(streamDefinition.getName())).thenReturn(streamDeployment);
		when(this.skipperStreamService.state(anyListOf(StreamDefinition.class))).thenReturn(streamDeploymentStates);
		StreamDeploymentResource streamDeploymentResource = this.controller.info(streamDefinition.getName());
		Assert.assertTrue(streamDeploymentResource.getStreamName().equals(streamDefinition.getName()));
		Assert.assertTrue(streamDeploymentResource.getDslText().equals(streamDefinition.getDslText()));
		Assert.assertTrue(streamDeploymentResource.getStreamName().equals(streamDefinition.getName()));
		Assert.assertTrue(streamDeploymentResource.getDeploymentProperties().equals("{\"log\":{\"test2\":\"value2\"},\"time\":{\"test1\":\"value1\"}}"));
		Assert.assertTrue(streamDeploymentResource.getStatus().equals(DeploymentState.deployed.name()));
	}

}


text:
date: 2015-07-31
title: Galaxy dress!
thumbnail: /images/galaxy-dress/thumbnail.jpg
tags: [sewing, by-hand-london]
---

A few months ago, Valentino put out a space-inspired Pre-Fall 2015 collection that made my jaw drop and my envy rise. (Startorialist [blogged about it here](http://www.startorialist.com/post/127788737980/zandperl-xangeoudemonx-space-inspired).) While I don't normally follow fashion trends closely, galaxy print coming back into style was too good of an opportunity to pass up. I bought this fabric in January, way before the Valentino show, but I can pretend to be fancy.

Around the same time as I saw this, I finally caved and bought the gorgeous By Hand London [Kim dress pattern](http://byhandlondon.com/products/kim-dress), which I'd been eyeing since it first came out. I'm a sucker for a good sweetheart neckline, as the 3 (as-yet unblogged) Cambie dresses I've made show.

I think this pattern and this print are a match made in heaven (space?)

{{<figure class="left" src="/images/galaxy-dress/standing.jpg" >}}

This dress was a total labor of love, though.

I did a 2" FBA on the princess seams, remembering the pain that the [Elisalex dress](/elisa-done-bella-lex/) caused me, using [Mary at Idle Fancy's tutorial](http://www.idlefancy.com/2014/01/sewing-curve-fba-for-princess-seams.html). The drastic FBA led to some really weird pattern pieces, which I'm still not sure I've smoothed out neatly yet.

I then pinched out about an inch out of the back neckline, using [BHL's tutorial](http://byhandlondon.com/blogs/sew-alongs/16990588-kim-dress-sewalong-alterations-fixing-a-tight-or-gapey-back-neckline), and took out about 1/2" of the back bodice to account for my sway back.

These 3 alterations are pretty standard, and I generally make all 3 before muslining a bodice at this point.

{{<figure class="left" src="/images/galaxy-dress/front.jpg" >}}

**Fabric** //

- 2.5 yards of [Timeless Treasures Space Galaxy](https://www.fabric.com/buy/0289692/timeless-treasures-space-galaxy)
- 0.5 yards of white cotton lawn for lining.

**Pattern** // [By Hand London's Kim dress](http://byhandlondon.com/products/kim-dress)

**Sizing** //
I cut a size 10, then did my usual adjustments (FBA, sway back, taking in the back for Reasons)


text:
var SLIDE_CONFIG = {
  // Slide settings
  settings: {
    title: 'JS.Next: ES6',
    subtitle: 'The New JavaScript API',
    //eventTitle: 'Google I/O 2013',
    useBuilds: true, // Default: true. False will turn off slide animation builds.
    usePrettify: true, // Default: true
    enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides.
    enableTouch: true, // Default: true. If touch support should enabled. Note: the device must support touch.
    //analytics: 'UA-XXXXXXXX-1', // TODO: Using this breaks GA for some reason (probably requirejs). Update your tracking code in template.html instead.
    favIcon: 'images/es6.png',
    fonts: [
      'Open Sans:regular,semibold,italic,italicsemibold',
      'Source Code Pro'
    ],
    theme: ['fe'], // Add your own custom themes or styles in /theme/css. Leave off the .css extension.
  },

  // Author information
  presenters: [{
    name: 'Aaron Frost',
    company: 'Sr. Frontend Dev, Domo',
    gplus: 'http://google.com/+AaronFrost',
    twitter: '@js_dev',
    www: 'http://www.40win.com',
    github: 'http://github.com/aaronfrost'
  }/*, {
    name: 'Second Name',
    company: 'Job Title, Google',
    gplus: 'http://plus.google.com/1234567890',
    twitter: '@yourhandle',
    www: 'http://www.you.com',
    github: 'http://github.com/you'
  }*/]
};


text:
using Library.Resources.Objects;

namespace Library.Resources
{
    public static class AtRuntime
    {
        #region Fields + Properties

        public static Settings Settings { get; set; }

        #endregion Fields + Properties
    }
}


text:
// vim:ts=8:expandtab
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <ifaddrs.h>
#include <net/if.h>

#include "i3status.h"

/*
 * Return the IP address for the given interface or "no IP" if the
 * interface is up and running but hasn't got an IP address yet
 *
 */
const char *get_ip_addr(const char *interface) {
        static char part[512];
        socklen_t len = sizeof(struct sockaddr_in);
        memset(part, 0, sizeof(part));

        struct ifaddrs *ifaddr, *addrp;

        getifaddrs(&ifaddr);

        if (ifaddr == NULL)
                return NULL;

        addrp = ifaddr;

        /* Skip until we are at the AF_INET address of interface */
        for (addrp = ifaddr;

             (addrp != NULL &&
              (strcmp(addrp->ifa_name, interface) != 0 ||
               addrp->ifa_addr == NULL ||
               addrp->ifa_addr->sa_family != AF_INET));

             addrp = addrp->ifa_next) {
                /* Check if the interface is down */
                if (strcmp(addrp->ifa_name, interface) == 0 &&
                    (addrp->ifa_flags & IFF_RUNNING) == 0) {
                        freeifaddrs(ifaddr);
                        return NULL;
                }
        }

        if (addrp == NULL) {
                freeifaddrs(ifaddr);
                return "no IP";
        }

        int ret;
        if ((ret = getnameinfo(addrp->ifa_addr, len, part, sizeof(part), NULL, 0, NI_NUMERICHOST)) != 0) {
                fprintf(stderr, "getnameinfo(): %s\n", gai_strerror(ret));
                freeifaddrs(ifaddr);
                return "no IP";
        }

        freeifaddrs(ifaddr);
        return part;
}


text:
<!-- TITLE/ -->

# NavLinks Plugin for DocPad

<!-- /TITLE -->

<!-- BADGES/ -->

[![Build Status](http://img.shields.io/travis-ci/lucor/docpad-plugin-navlinks.png?branch=master)](http://travis-ci.org/lucor/docpad-plugin-navlinks "Check this project's build status on TravisCI")
[![NPM version](http://badge.fury.io/js/docpad-plugin-navlinks.png)](https://npmjs.org/package/docpad-plugin-navlinks "View this project on NPM")
[![Dependency Status](https://david-dm.org/lucor/docpad-plugin-navlinks.png?theme=shields.io)](https://david-dm.org/lucor/docpad-plugin-navlinks)
[![Development Dependency Status](https://david-dm.org/lucor/docpad-plugin-navlinks/dev-status.png?theme=shields.io)](https://david-dm.org/lucor/docpad-plugin-navlinks#info=devDependencies)<br/>

<!-- /BADGES -->

Adds the ability to generate a navigation bar for documents with links to the next and previous document of a specified collection for [DocPad](https://docpad.org).

<!-- INSTALL/ -->

## Install

### [Node](http://nodejs.org/)
- Use: `require('docpad-plugin-navlinks')`
- Install: `npm install --save docpad-plugin-navlinks`

<!-- /INSTALL -->

## Usage
The purpose of this plugin is to generate a navigation bar for documents with links to the next and previous document of a specified collection. Useful especially for posts.

### Setup
Edit the docpad.coffee configuration file.

Identify one o more collections you want add navbar links in the

``` coffee
  collections:
    pages: (database) ->
      database.findAllLive({pageOrder: $exists: true}, [pageOrder:1,title:1])
    posts: (database) ->
      database.findAllLive({layout:$has:'post'}, [date:-1])
```

Define collections you want to enable navbar links. You may also specifies collection sorting (-1 for reverse order).

``` coffee
  # Plugins configurations
  plugins:
    navlinks:
      collections:
        posts: -1
        pages: 1
```

In the eco template (i.e. post.html.eco) add:
``` coffee
    <%- @getNavLinks() %>
```

You may style the navlinks usign the following css classes:

```
.navlinks {}

.navlinks-prev {
    float: left;
}

.navlinks-next {
    float: right;
}
```

<!-- HISTORY/ -->

## History
[Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/lucor/docpad-plugin-navlinks/blob/master/HISTORY.md#files)

<!-- /HISTORY -->

<!-- CONTRIBUTE/ -->

## Contribute

[Discover how you can contribute by heading on over to the `CONTRIBUTING.md` file.](https://github.com/lucor/docpad-plugin-navlinks/blob/master/CONTRIBUTING.md#files)

<!-- /CONTRIBUTE -->

<!-- BACKERS/ -->

## Backers

### Maintainers

These amazing people are maintaining this project:

- Luca Corbo <lu.corbo@gmail.com> (http://lucor.github.io)

### Sponsors

No sponsors yet! Will you be the first?

### Contributors

These amazing people have contributed code to this project:

- [lucor](https://github.com/lucor) — [view contributions](https://github.com/lucor/docpad-plugin-navlinks/commits?author=lucor)

[Become a contributor!](https://github.com/lucor/docpad-plugin-navlinks/blob/master/CONTRIBUTING.md#files)

<!-- /BACKERS -->

<!-- LICENSE/ -->

## License

Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)

Copyright © Luca Corbo <lu.corbo@gmail.com> (http://lucor.github.io)

<!-- /LICENSE -->


text:
package e2e

import (
	"fmt"

	"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

// Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.
// Eventual goal is to merge this with integration test framework.
type Framework struct {
	BaseName string

	Namespace *api.Namespace
	Client    *client.Client
}

// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
// you (you can write additional before/after each functions).
func NewFramework(baseName string) *Framework {
	f := &Framework{
		BaseName: baseName,
	}

	BeforeEach(f.beforeEach)
	AfterEach(f.afterEach)

	return f
}

// beforeEach gets a client and makes a namespace.
func (f *Framework) beforeEach() {
	By("Creating a kubernetes client")
	c, err := loadClient()
	Expect(err).NotTo(HaveOccurred())

	f.Client = c

	By("Building a namespace api object")
	namespace, err := createTestingNS(f.BaseName, f.Client)
	Expect(err).NotTo(HaveOccurred())

	f.Namespace = namespace

	By("Waiting for a default service account to be provisioned in namespace")
	err = waitForDefaultServiceAccountInNamespace(c, namespace.Name)
	Expect(err).NotTo(HaveOccurred())
}

// afterEach deletes the namespace, after reading its events.
func (f *Framework) afterEach() {
	// Print events if the test failed.
	if CurrentGinkgoTestDescription().Failed {
		By(fmt.Sprintf("Collecting events from namespace %q.", f.Namespace.Name))
		events, err := f.Client.Events(f.Namespace.Name).List(labels.Everything(), fields.Everything())
		Expect(err).NotTo(HaveOccurred())

		for _, e := range events.Items {
			Logf("event for %v: %v %v: %v", e.InvolvedObject.Name, e.Source, e.Reason, e.Message)
		}
		// Note that we don't wait for any cleanup to propagate, which means
		// that if you delete a bunch of pods right before ending your test,
		// you may or may not see the killing/deletion/cleanup events.
	}

	By(fmt.Sprintf("Destroying namespace %q for this suite.", f.Namespace.Name))
	if err := f.Client.Namespaces().Delete(f.Namespace.Name); err != nil {
		Failf("Couldn't delete ns %q: %s", f.Namespace.Name, err)
	}
	// Paranoia-- prevent reuse!
	f.Namespace = nil
	f.Client = nil
}

// WaitForPodRunning waits for the pod to run in the namespace.
func (f *Framework) WaitForPodRunning(podName string) error {
	return waitForPodRunningInNamespace(f.Client, podName, f.Namespace.Name)
}

// Runs the given pod and verifies that its output matches the desired output.
func (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, expectedOutput []string) {
	testContainerOutputInNamespace(scenarioName, f.Client, pod, expectedOutput, f.Namespace.Name)
}


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

namespace MLiB
{
    public class MLBLinescore
    {
    }
}


text:
;(function (libs,$) {
	var Flow = libs.Flow;
	var Record = libs.ActionRecord;
	var MenuItemView = libs.Class.extend(libs.DataViewer.DefaultView,{
		__constructor:function(options){
			this.id = libs.Utils.unique();
			this.options = options;
			this.events = this.options.events || {};
			this.container = $(this.options.container);
		},
		dom:function () {
			return this.container;
		},
		getMenuItem:function(key){
			return $('.myui-menu-item[data-modelKey='+key + ']',this.dom());
		},
		getMenu:function(key){
			return $('.myui-menucombo[data-modelKey='+key + ']',this.dom());
		},
		getSubMenu:function(key){
			return $('.myui-menucombo[data-parentKey='+key + ']',this.dom());
		},
		getSubMenus:function(level){
			return $('.myui-menucombo[data-level]',this.dom()).not(function(){
				return ~~($(this).attr('data-level')) < level;
			});
		},
		getSubMenuOffset:function(key){
			var $container = this.dom();
			var $obj = $('.myui-menu-item[data-modelKey='+key + ']',$container);
			var offset =  libs.Measurement.getOffset($obj.get(0));
			console.log(offset);
			offset.left += $obj.outerWidth() + 3;
			return offset;
		},
	    //渲染头部
        renderHead: function(left,top,key,parentKey,level) {
            return libs.Utils.strFormat('
',this.options.comboCss || '',left,top,key,parentKey,level);
        },
        //渲染主题部分
        renderBody: function(menuitem,viewIndex) {
        	var output = '';
        	if(this.options.format){
        		output = this.options.format.apply(this,[menuitem,menuitem.data]) || '';
        	}
        	else if(this.options.modelText)
        	{
        		output = menuitem.text;
        	}
        	else
        	{
        		output = menuitem.value;
        	}
        	var modelKey = menuitem.key;
            return ['
', output, '
'].join('')
        },
        //渲染尾部
        renderFoot: function() {
            return '
';
        },
        //渲染空
        renderEmpty:function(){
            return this.options.emptyText || '
无菜单项
';
        },
        bindEvents:function () {
        	var that = this;
        	var $dom = this.dom();
        	$('.myui-menu-item',$dom).off('mouseover').on('mouseover',function(){
				var $this = $(this);
				var modelKey = $this.attr('data-modelKey');
				that.events.onpopsubmenu && that.events.onpopsubmenu.apply(that,[modelKey,$this,event]);
				return true;
			});
			$('.myui-menu-item',$dom).off('mousedown').on('mousedown',function(event){
				event.stopPropagation();
				var $this = $(this);
				var act = $this.attr('data-action');
				if(!act){ return true; }
				var data_actions = libs.Utils.strTrim($this.attr('data-action'));
				var actions = data_actions.split(';');
				var async = $this.attr('data-async') === "true" ? true : false;
				that.events.onaction && that.events.onaction.apply(that,[actions,async]);
				return true;
			});
			this.events.onbindevents && this.events.onbindevents.apply(this);
        },
        unBindEvents:function () {
        	var that = this;
        	var $dom = this.dom();
        	$('.myui-menu-item',$dom).off('mouseover');
        	$('.myui-menu-item',$dom).off('mousedown');
        	this.events.onunbindevents && this.events.onunbindevents.apply(this);
        }
	});

	var MenuItem = libs.Class.define({
		__constructor:function(){
			this.key = null;
			this.text = null;
			this.value = null;
			this.parent = null;
			this.level = 0;
			this.action = '';
			this.async = false;
			this.data = null;
		}
	});

	var MenuCombo = libs.Class.define({
		__constructor:function(options){
			var that = this;
			this.menuitems = options.menuitems || [];
			this.view = new MenuItemView(options);
			this.popups = [];
			this.options = options;
			this.flows = new Record();
			this.container = $(options.container);
			if(options.datas.length)
			{
				this.load(options.datas);
			}
			this.flows.set('close',function(callback){ that.close(); callback && callback(); });
			if(!options.actions){return;}
			var count = options.actions.length;
			for (var i = 0; i < count; i++) {
				var act = options.actions[i];
				this.flows.set(act.name,act.action);
			};
			this.bindEvents();
		},
		load:function(datas){
			var options = this.options;
			var rootmenu = new MenuItem();
			this.menuitems.push(rootmenu);
			for (var i = 0; i < datas.length; i++) {
				var data = datas[i];
				var menuitem = new MenuItem();
				menuitem.data = data;
				menuitem.action = data.action || 'close';
				menuitem.async = data.async || false;
				menuitem.text = data[this.options.modelText];
				menuitem.value = data[this.options.modelValue];
				menuitem.key = data[this.options.modelKey];
				menuitem.parent = data.parent;
				this.menuitems.push(menuitem);
				var parentmenu = libs.Utils.arrayFind(this.menuitems,function(left){ return left.key == data.parent; })
				parentmenu.children = parentmenu.children || [];
				menuitem.level = parentmenu.level + 1;
				parentmenu.action = '';
				parentmenu.children.push(menuitem);
			};
		},
		bindEvents:function(){
			var that = this;
			var popsubmenu = this.view.events.onpopsubmenu;
			this.view.events.onpopsubmenu = function(key){
				that.closesub && that.closesub(key);
				that.popsub && that.popsub(key);
				popsubmenu && popsubmenu(key);
			}
			this.view.events.onaction = function(actions,async){
				var flows = [];
				for (var i = 0; i < actions.length; i++) {
					flows.push(that.flows.get(actions[i]));
				};
				async ? new Flow(flows).async():new Flow(flows).sync();
			}
			this.container.on('mousedown',function(event){
				if(event.which == 3)
				{
					that.close();
					that.popup(libs.Measurement.scrollLeft() + event.clientX,libs.Measurement.scrollTop() + event.clientY);
				}
				else
				{
					that.close();
				}
				return true;
			});
		},
		render:function(menu,left,top){
			if(!menu){ return''; }
			if(!this.view){ return ''; }
			var contents = [];
			contents.push(this.view.renderHead(left,top,menu.key,menu.parent,menu.level));
			if(!menu.children || menu.children.length == 0){
				return;
			}
			else
			{
				for (var i = 0; i < menu.children.length; i++) {
					contents.push(this.view.renderBody(menu.children[i],i));
				};
			}
			contents.push(this.view.renderFoot());
			this.view.unBindEvents && this.view.unBindEvents();
			this.container && this.container.append(contents.join(''));
			this.view.bindEvents && this.view.bindEvents();
		},
		findRootMenu:function(){
			var options = this.options;
			return libs.Utils.arrayFind(this.menuitems,function(left){
				return left.key == null;
			});
		},
		findMenu:function(key){
			var options = this.options;
			return libs.Utils.arrayFind(this.menuitems,function(left){
				return left.key == key;
			});
		},
		findSubMenu:function(key){
			var options = this.options;
			return libs.Utils.arrayFind(this.menuitems,function(left){
				return left.parent == key;
			});
		},
		close:function(){
			this.view && this.view.unBindEvents();
			$('.myui-menucombo').remove();
		},
		closesub:function(key){
			var menu = this.findMenu(key);
			var menuitem = this.view.getSubMenus(menu.level);
			menuitem.remove();
		},
		popup:function(left,top){
			var that = this;
			var menu = that.findRootMenu();
			that.render(menu,left,top);
		},
		popsub:function(key){
			var that = this;
			var offset = that.view.getSubMenuOffset(key);
			var menu = that.findMenu(key);
			that.render(menu,offset.left,offset.top);
		}
	});

	libs.Widgets = libs.Widgets || {};
	libs.Widgets.MenuCombo = MenuCombo;
})(myui,jQuery);


text:
package net.kuujo.vertigo.cluster.data;

import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.Handler;

/**
 * Asynchronous list.

 *
 * If the current Vert.x instance is a Hazelcast clustered instance,
 * the list will be backed by a Hazelcast list. Otherwise, the list
 * will be backed by a Vert.x shared data map.
 *
 * @author Jordan Halterman
 *
 * @param <T> The list data type.
 */
public interface AsyncList<T> extends AsyncCollection<T> {

  /**
   * Gets a value at a specific index in the list.
   *
   * @param index The index of the value to get.
   * @param resultHandler An asynchronous handler to be called with the value result.
   */
  void get(int index, Handler<AsyncResult<T>> resultHandler);

  /**
   * Sets an index in the list.
   *
   * @param index The index to set.
   * @param value The value to set.
   */
  void set(int index, T value);

  /**
   * Sets an index in the list.
   *
   * @param index The index to set.
   * @param value The value to set.
   * @param doneHandler An asynchronous handler to be called once complete.
   */
  void set(int index, T value, Handler<AsyncResult<Void>> doneHandler);

  /**
   * Removes an index in the list.
   *
   * @param index The index to remove.
   */
  void remove(int index);

  /**
   * Removes an index in the list.
   *
   * @param index The index to remove.
   * @param doneHandler An asynchronous handler to be called once complete. The handler
   *                    result will be the value that was removed from the list.
   */
  void remove(int index, Handler<AsyncResult<T>> doneHandler);

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annls mycol. 17(1): 37 (1919)

#### Original name
Rosellinia mangiferae Syd.

### Remarks
null


text:
(function (factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as anonymous module.
        define(['jquery'], factory);
    } else {
        // Browser globals.
        factory(jQuery);
    }
}(function ($) {

    var pluses = /\+/g;

    function decode(s) {
        if (config.raw) {
            return s;
        }
        return decodeURIComponent(s.replace(pluses, ' '));
    }

    function decodeAndParse(s) {
        if (s.indexOf('"') === 0) {
            // This is a quoted cookie as according to RFC2068, unescape...
            s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
        }

        s = decode(s);

        try {
            return config.json ? JSON.parse(s) : s;
        } catch(e) {}
    }

    var config = $.cookie = function (key, value, options) {

        // Write
        if (value !== undefined) {
            options = $.extend({}, config.defaults, options);

            if (typeof options.expires === 'number') {
                var days = options.expires, t = options.expires = new Date();
                t.setDate(t.getDate() + days);
            }

            value = config.json ? JSON.stringify(value) : String(value);

            document.cookie = [
                config.raw ? key : encodeURIComponent(key),
                '=',
                config.raw ? value : encodeURIComponent(value),
                options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
                options.path    ? '; path=' + options.path : '',
                options.domain  ? '; domain=' + options.domain : '',
                options.secure  ? '; secure' : ''
            ].join('');
            return document.cookie;
        }

        // Read
        var cookies = document.cookie.split('; ');
        var result = key ? undefined : {};
        for (var i = 0, l = cookies.length; i < l; i++) {
            var parts = cookies[i].split('=');
            var name = decode(parts.shift());
            var cookie = parts.join('=');

            if (key && key === name) {
                result = decodeAndParse(cookie);
                break;
            }

            if (!key) {
                result[name] = decodeAndParse(cookie);
            }
        }

        return result;
    };

    config.defaults = {};

    $.removeCookie = function (key, options) {
        if ($.cookie(key) !== undefined) {
            // Must not alter options, thus extending a fresh object...
            $.cookie(key, '', $.extend({}, options, { expires: -1 }));
            return true;
        }
        return false;
    };

}));


text:
enum GFHOGType{
	Image,
	Sketch
};

class GFHOG : public std::vector<std::vector<double> >
{
public:
	GFHOG(void);
	~GFHOG(void);
	void Compute(IplImage* src,GFHOGType t, IplImage* mask = NULL);
	void ComputeImage(IplImage* src,IplImage* mask = NULL);
	void ComputeSketch(IplImage* src,IplImage* mask = NULL);
	void ComputeEdge(IplImage* edge,IplImage* mask = NULL);
	void ComputeGradient(IplImage* Edge8bit,IplImage* mask);

	IplImage* Gradient() { return _gradient; };
	static IplImage* ResizeToFaster(IplImage* image,int maxdim);
private:
	IplImage* _gradient;
	void gradientField(IplImage* inpmask32,IplImage* filtermask32);
	void histogramOfGradients(IplImage* edge,IplImage* gradient);
	IplImage* poissoncompute(IplImage* src, IplImage* mask);
	CvScalar sub(CvScalar a, CvScalar b);
};


text:
class T_CONTROLLER_EXPORT RetagController : public ApplicationController
{
    Q_OBJECT
public:
    Q_INVOKABLE
    RetagController() : ApplicationController() { }

public slots:
    void search();
    void search(const QString &tag0);
    void search(const QString &tag0, const QString &tag1);
    void search(const QString &tag0, const QString &tag1, const QString &tag2);
    void sequential(const QString &index);
    void show(const QString &image);
    void save(const QString &image, int nextStep);

private:
    RetagService service;
};

#endif // RETAGCONTROLLER_H


text:
using System;
using System.Text;
using System.Xml;
using System.Configuration;
using System.Web;
using System.IO;
using System.Net;
using System.Net.Mail;

namespace DotNet.Utilities
{
    public class MailSender
    {
        public static void Send(string server, string sender, string recipient, string subject,
    string body, bool isBodyHtml, Encoding encoding, bool isAuthentication, params string[] files)
        {
            SmtpClient smtpClient = new SmtpClient(server);
            MailMessage message = new MailMessage(sender, recipient);
            message.IsBodyHtml = isBodyHtml;

            message.SubjectEncoding = encoding;
            message.BodyEncoding = encoding;

            message.Subject = subject;
            message.Body = body;

            message.Attachments.Clear();
            if (files != null && files.Length != 0)
            {
                for (int i = 0; i < files.Length; ++i)
                {
                    Attachment attach = new Attachment(files[i]);
                    message.Attachments.Add(attach);
                }
            }

            if (isAuthentication == true)
            {
                smtpClient.Credentials = new NetworkCredential(SmtpConfig.Create().SmtpSetting.User,
                    SmtpConfig.Create().SmtpSetting.Password);
            }
            smtpClient.Send(message);

        }

        public static void Send(string recipient, string subject, string body)
        {
            Send(SmtpConfig.Create().SmtpSetting.Server, SmtpConfig.Create().SmtpSetting.Sender, recipient, subject, body, true, Encoding.Default, true, null);
        }

        public static void Send(string Recipient, string Sender, string Subject, string Body)
        {
            Send(SmtpConfig.Create().SmtpSetting.Server, Sender, Recipient, Subject, Body, true, Encoding.UTF8, true, null);
        }

        static readonly string smtpServer = System.Configuration.ConfigurationManager.AppSettings["SmtpServer"];
        static readonly string userName = System.Configuration.ConfigurationManager.AppSettings["UserName"];
        static readonly string pwd = System.Configuration.ConfigurationManager.AppSettings["Pwd"];
        static readonly int smtpPort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["SmtpPort"]);
        static readonly string authorName = System.Configuration.ConfigurationManager.AppSettings["AuthorName"];
        static readonly string to = System.Configuration.ConfigurationManager.AppSettings["To"];

        public void Send(string subject, string body)
        {

            //List<string> toList = StringPlus.GetSubStringList(StringPlus.ToDBC(to), ',');
            //OpenSmtp.Mail.Smtp smtp = new OpenSmtp.Mail.Smtp(smtpServer, userName, pwd, smtpPort);
            //foreach (string s in toList)
            //{
            //    OpenSmtp.Mail.MailMessage msg = new OpenSmtp.Mail.MailMessage();
            //    msg.From = new OpenSmtp.Mail.EmailAddress(userName, authorName);

            //    msg.AddRecipient(s, OpenSmtp.Mail.AddressType.To);

            //    //㝸m欥㥿䥬脛쩷ᬰ html ፊ            //    msg.HtmlBody = body;
            //    //㝸m欥㼐A
            //    msg.Subject = subject;
            //    //뼩w欥㥿䥪꽳혍
            //    msg.Charset = "gb2312";
            //    //寰e欥㍊            //    smtp.SendMail(msg);
            //}
        }
    }

    public class SmtpSetting
    {
        private string _server;

        public string Server
        {
            get { return _server; }
            set { _server = value; }
        }
        private bool _authentication;

        public bool Authentication
        {
            get { return _authentication; }
            set { _authentication = value; }
        }
        private string _user;

        public string User
        {
            get { return _user; }
            set { _user = value; }
        }
        private string _sender;

        public string Sender
        {
            get { return _sender; }
            set { _sender = value; }
        }
        private string _password;

        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }
    }

    public class SmtpConfig
    {
        private static SmtpConfig _smtpConfig;
        private string ConfigFile
        {
            get
            {
                string configPath = ConfigurationManager.AppSettings["SmtpConfigPath"];
                if (string.IsNullOrEmpty(configPath) || configPath.Trim().Length == 0)
                {
                    configPath = HttpContext.Current.Request.MapPath("/Config/SmtpSetting.config");
                }
                else
                {
                    if (!Path.IsPathRooted(configPath))
                        configPath = HttpContext.Current.Request.MapPath(Path.Combine(configPath, "SmtpSetting.config"));
                    else
                        configPath = Path.Combine(configPath, "SmtpSetting.config");
                }
                return configPath;
            }
        }
        public SmtpSetting SmtpSetting
        {
            get
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(this.ConfigFile);
                SmtpSetting smtpSetting = new SmtpSetting();
                smtpSetting.Server = doc.DocumentElement.SelectSingleNode("Server").InnerText;
                smtpSetting.Authentication = Convert.ToBoolean(doc.DocumentElement.SelectSingleNode("Authentication").InnerText);
                smtpSetting.User = doc.DocumentElement.SelectSingleNode("User").InnerText;
                smtpSetting.Password = doc.DocumentElement.SelectSingleNode("Password").InnerText;
                smtpSetting.Sender = doc.DocumentElement.SelectSingleNode("Sender").InnerText;

                return smtpSetting;
            }
        }
        private SmtpConfig()
        {

        }
        public static SmtpConfig Create()
        {
            if (_smtpConfig == null)
            {
                _smtpConfig = new SmtpConfig();
            }
            return _smtpConfig;
        }
    }
}


text:
Off-line visualization with POV-Ray {#povray_visualization}
==================================


text:
(function() {
  {{ js_ua_override|safe }}
  var jsUa = uap.getJsUaOverrides();
  var reconciledUa = '{{ current_ua.pretty }}';
  if (jsUa) {
    reconciledUa = jsUa['js_user_agent_family'] + ' ' +
        jsUa['js_user_agent_v1'] + '.' +
        jsUa['js_user_agent_v2'] + '.' + jsUa['js_user_agent_v3'];
    reconciledUa = reconciledUa.replace('0.0', '0');
  }
  var el = document.createElement('div');
  el.id = 'bs-ua';
  el.innerHTML = 'Browserscope thinks you are using ' +
     '<strong>' + reconciledUa + '</strong>';
  var script = document.getElementById('bs-ua-script');
  if (!script) {
    var scripts = document.getElementsByTagName('script');
    script = scripts[scripts.length - 1];
  }
  script.parentNode.insertBefore(el, script);
})();


text:
package com.palantir.util;

public class Mutables {
    /**
     * Type-inferred factory method for {@link Mutable}
     */
    public static <T> Mutable<T> newMutable(T val) {
        return new Mutable<T>(val);
    }

    /**
     * Creates a new Mutable with a null value to start with.
     */
    public static <T> Mutable<T> newMutable() {
        return newMutable(null);
    }
}


text:
package io.cdap.plugin.sendgrid.common.objects.stats;

import com.google.common.collect.ImmutableMap;
import com.google.gson.annotations.SerializedName;
import io.cdap.cdap.api.data.schema.Schema;
import io.cdap.plugin.sendgrid.common.helpers.BaseObject;
import io.cdap.plugin.sendgrid.common.helpers.IBaseObject;
import io.cdap.plugin.sendgrid.common.helpers.ObjectDefinition;
import io.cdap.plugin.sendgrid.common.helpers.ObjectFieldDefinition;

import java.util.Map;
import javax.annotation.Nullable;

/**
 * MetricStats entity.
 */
@ObjectDefinition(
  Name = "MetricStats",
  ObjectType = ObjectDefinition.ObjectDefinitionType.NESTED
)
public class MetricStats extends BaseObject implements IBaseObject {

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("blocks")
  private Integer blocks;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("bounce_drops")
  private Integer bounceDrops;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("bounces")
  private Integer bounces;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("clicks")
  private Integer clicks;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("deferred")
  private Integer deferred;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("invalid_emails")
  private Integer invalidEmails;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("opens")
  private Integer opens;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("processed")
  private Integer processed;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("requests")
  private Integer requests;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("spam_report_drops")
  private Integer spamReportDrops;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("spam_reports")
  private Integer spamReports;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("unique_clicks")
  private Integer uniqueClicks;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("unique_opens")
  private Integer uniqueOpens;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("unsubscribe_drops")
  private Integer unsubscribeDrops;

  @ObjectFieldDefinition(FieldType = Schema.Type.INT)
  @Nullable
  @SerializedName("unsubscribes")
  private Integer unsubscribes;

  @Override
  public Map<String, Object> asMap() {
    return new ImmutableMap.Builder<String, Object>()
      .put("blocks", (blocks == null) ? 0 : blocks)
      .put("bounce_drops", (bounceDrops == null) ? 0 : bounceDrops)
      .put("bounces", (bounces == null) ? 0 : bounces)
      .put("clicks", (clicks == null) ? 0 : clicks)
      .put("deferred", (deferred == null) ? 0 : deferred)
      .put("invalid_emails", (invalidEmails == null) ? 0 : invalidEmails)
      .put("opens", (opens == null) ? 0 : opens)
      .put("processed", (processed == null) ? 0 : processed)
      .put("requests", (requests == null) ? 0 : requests)
      .put("spam_report_drops", (spamReportDrops == null) ? 0 : spamReportDrops)
      .put("spam_reports", (spamReports == null) ? 0 : spamReports)
      .put("unique_clicks", (uniqueClicks == null) ? 0 : uniqueClicks)
      .put("unique_opens", (uniqueOpens == null) ? 0 : uniqueOpens)
      .put("unsubscribe_drops", (unsubscribeDrops == null) ? 0 : unsubscribeDrops)
      .put("unsubscribes", (unsubscribes == null) ? 0 : unsubscribes)
      .build();
  }
}


text: Rails.application.config.session_store :cookie_store, key: '_rails-5-base-app_session'


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
    <file url="file://$PROJECT_DIR$/apps" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/images" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/js/html5shiv.min.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/js/plugins/jquery.draggable.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/js/plugins/jquery.hammer.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/js/plugins/jquery.validate.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/js/respond.min.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/js/vendor/jquery-2.1.3.min.js" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/modal-box.php" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/password" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/scripts" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/views/_foot.htm" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/views/_head.php" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/views/apps.php" charset="UTF-8" />
    <file url="file://$PROJECT_DIR$/views/connexion.inc.php" charset="UTF-8" />
  </component>
</project>


text:
module Motion
  module Dryclean
    VERSION = "0.0.2"
  end
end


text:
<?php

namespace NetSuite\Classes;

class FileEncoding {
    static $paramtypesmap = array(
    );
    const _autoDetect = "_autoDetect";
    const _shiftJis = "_shiftJis";
    const _utf8 = "_utf8";
    const _windows1252 = "_windows1252";
}


text:
package java_problems.introduction;

/*
 * Take exactly 3 lines of input. Each line consists of a string and an
 * integer.  The strings will have at most 10 alphabetic characters and the
 * integers will range between 0 to 999.
 *
 * In each line of output there should be two columns. The string should be in
 * the first column and the integer in the second column.
 *
 * The first column should be left justified using exactly 15 characters. The
 * integer of the second column should have exactly 3 digits. If the original
 * input has less than 3 digits, you should pad with zeros to the left.
 *
 * Sample input:
 *
 * java 100
 * cpp 65
 * python 50
 */
import java.util.*;

public class JavaOutputFormatting {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("================================");
        for(int i = 0; i < 3; i++) {
        	String s1 = sc.next();
            int x = sc.nextInt();
            System.out.printf("%-15s%03d %n", s1, x);
        }
        System.out.println("================================");
        sc.close();
    }
}


text:
layout: page
title: Swift Music Award Ceremony
date: 2016-05-24
author: Ruth Gilmore
tags: weekly links, java
status: published
summary: Duis ac ornare mi. Aliquam porta tempor purus. Maecenas.
banner: images/banner/people.jpg
booking:
  startDate: 03/30/2016
  endDate: 04/02/2016
  ctyhocn: MKEDWHX
  groupCode: SMAC
published: true
---
Phasellus congue nisl felis, eu luctus erat eleifend vel. Maecenas quis bibendum enim. Mauris tincidunt justo vel lacus congue, vel dapibus dui pellentesque. Pellentesque quis ex vel massa rutrum iaculis. Fusce pretium neque ut tellus bibendum ultrices. Donec ligula ex, rutrum at neque sed, sagittis rhoncus nunc. Quisque lacinia sem turpis, quis venenatis nisl imperdiet rutrum. Mauris sed consequat leo. Nulla lacinia vel magna pellentesque iaculis. Fusce vestibulum consequat turpis, quis interdum velit egestas bibendum. Curabitur scelerisque dolor quam, commodo tincidunt arcu ultricies at.
Vivamus mollis dignissim mauris eu condimentum. Integer gravida ipsum eget turpis porta porta. Praesent rhoncus finibus lectus et luctus. Curabitur bibendum metus quis nulla auctor varius. Aliquam sagittis dignissim aliquam. Ut lectus orci, commodo eu nisl quis, ullamcorper dignissim libero. Integer at vestibulum urna, in tempus felis. In cursus, magna sed rhoncus pellentesque, lorem felis iaculis sapien, quis lacinia tellus est quis magna. Proin sit amet feugiat est, vitae laoreet dui. Suspendisse augue quam, dictum quis risus ac, pellentesque rhoncus lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis nec purus vel diam porta efficitur nec vel felis. Suspendisse et tempor eros. Praesent iaculis convallis faucibus.

* Sed luctus nisi egestas, porta nisi sit amet, pretium nibh
* Vestibulum nec nisl rhoncus, malesuada sem a, dapibus lacus
* Donec vel libero id ligula rhoncus varius ultricies sed mi
* Integer finibus felis non justo congue ullamcorper
* Suspendisse quis libero bibendum, porta libero vel, accumsan odio
* Pellentesque et metus nec lorem ullamcorper bibendum.

Cras ut scelerisque purus. Maecenas eget sapien nec lectus tincidunt volutpat eu nec neque. Maecenas vel mi aliquam, pharetra ligula quis, consectetur urna. Interdum et malesuada fames ac ante ipsum primis in faucibus. In dolor orci, pellentesque vitae nisi nec, tristique lobortis purus. Fusce volutpat nulla mattis mi semper, vitae condimentum lectus convallis. Aenean sed bibendum ipsum. Aliquam mattis, est at bibendum gravida, leo ex placerat lectus, a interdum augue lorem ac ante.


text:
package java_cup;

/** This class represents a shift/reduce nonassociative error within the
 *  parse table.  If action_table element is assign to type
 *  nonassoc_action, it cannot be changed, and signifies that there
 *  is a conflict between shifting and reducing a production and a
 *  terminal that shouldn't be next to each other.
 *
 * @version last updated: 7/2/96
 * @author  Frank Flannery
 */
public class nonassoc_action extends parse_action {

  /*-----------------------------------------------------------*/
  /*--- Constructor(s) ----------------------------------------*/
  /*-----------------------------------------------------------*/

  /** Simple constructor.
   */
  public nonassoc_action() throws internal_error
    {
	/* don't need to set anything, since it signifies error */
    }

    /*-----------------------------------------------------------*/
  /*--- General Methods ---------------------------------------*/
  /*-----------------------------------------------------------*/

  /** Quick access to type of action. */
  public int kind() {return NONASSOC;}

  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

  /** Equality test. */
  public boolean equals(parse_action other)
    {
      return other != null && other.kind() == NONASSOC;
    }

  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

  /** Generic equality test. */
  public boolean equals(Object other)
    {
      if (other instanceof parse_action)
	return equals((parse_action)other);
      else
       return false;
    }

  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/

  /** Compute a hash code. */
  public int hashCode()
    {
      /* all objects of this class hash together */
      return 0xCafe321;
    }

  /** Convert to string. */
  public String toString()
    {
      return "NONASSOC";
    }

  /*-----------------------------------------------------------*/

}


text:
var co = require('co');
var expect = require('expect.js');
var fs = require('fs');
var Storage = require('../');

describe('storage', function () {
  var filepath = __dirname + '/figures/eventproxy-0.3.1.tgz';
  var client = Storage.create({
    oprator: 'test',
    password: 'test1234',
    bucket: 'jackson-test-space'
  });
  var download = __dirname + '/figures/download.tgz';

  var buff;
  var size;
  before(function (done) {
    fs.readFile(filepath, function(err, data) {
      expect(err).to.not.be.ok();
      size = data.length;
      buff = data;
      expect(size).to.be.above(0);
      fs.unlink(download, function (err) {
        if (err) {
          expect(err.code).to.be('ENOENT');
        }
        done();
      });
    });
  });

  it('upload should work', function (done) {
    co(function *() {
      var result = yield client.upload(filepath, {key: '/eventproxy/-/eventproxy-0.3.1.tgz'});
      expect(result.url).to.be('http://jackson-test-space.b0.upaiyun.com/eventproxy/-/eventproxy-0.3.1.tgz');
    })(done);
  });

  it('putBuffer should work', function (done) {
    co(function *() {
      var result = yield client.uploadBuffer(buff, {key: '/eventproxy/-/eventproxy-0.3.1.tgz'});
      expect(result.url).to.be('http://jackson-test-space.b0.upaiyun.com/eventproxy/-/eventproxy-0.3.1.tgz');
    })(done);
  });

  it('download', function (done) {
    co(function *() {
      yield client.download('/eventproxy/-/eventproxy-0.3.1.tgz', download, {});
    })(function (err) {
      expect(err).to.not.be.ok();
      fs.readFile(download, function (err, file) {
        expect(err).to.not.be.ok();
        expect(file.length).to.be(size);
        done();
      });
    });
  });

  it('remove', function (done) {
    co(function *() {
      yield client.remove('/eventproxy/-/eventproxy-0.3.1.tgz');
      try {
        yield client.download('/eventproxy/-/eventproxy-0.3.1.tgz', download, {});
      } catch (err) {
        expect(err).to.be.ok();
        expect(err.code).to.be(404);
      }
    })(done);
  });
});


text:
girderTest.startApp();

describe('Test setApiRoot() function', function () {
    it('Check for default values and mutation', function () {
        waitsFor(function () {
            return $('.g-frontpage-body').length > 0;
        });

        runs(function () {
            // Test the default values.
            expect(girder.rest.getApiRoot().slice(
                girder.rest.getApiRoot().indexOf('/', 7))).toBe('/api/v1');

            var apiRootVal = '/foo/bar/v2';
            girder.rest.setApiRoot(apiRootVal);
            expect(girder.rest.getApiRoot()).toBe(apiRootVal);
        });
    });
});


text:
package sun.jvm.hotspot.asm.sparc;

import sun.jvm.hotspot.asm.*;

public class SPARCJmplInstruction extends SPARCInstruction
    implements BranchInstruction {
    final protected SPARCRegisterIndirectAddress addr;
    final protected SPARCRegister rd;

    protected SPARCJmplInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
        super(name);
        this.addr = addr;
        this.rd = rd;
    }

    public SPARCJmplInstruction(SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
        this("jmpl", addr, rd);
    }

    protected String getDescription() {
        StringBuffer buf = new StringBuffer();
        String addrStr = addr.toString();
        // remove '[' & ']' from address
        addrStr = addrStr.substring(1, addrStr.length() - 1);
        if (rd == SPARCRegisters.G0) {
            buf.append("jmp");
            buf.append(spaces);
            buf.append(addrStr);
        } else {
            buf.append(getName());
            buf.append(spaces);
            buf.append(addrStr);
            buf.append(comma);
            buf.append(rd.toString());
        }

        return buf.toString();
    }

    public String asString(long currentPc, SymbolFinder symFinder) {
        return getDescription();
    }

    public Address getBranchDestination() {
        return addr;
    }

    public SPARCRegister getReturnAddressRegister() {
        return rd;
    }

    public boolean isAnnuledBranch() {
        return false;
    }

    public boolean isBranch() {
        return true;
    }

    public boolean isConditional() {
        return false;
    }
}


text:
namespace aperture {
namespace cloudfiles {

CloudFilesAsset::CloudFilesAsset(const std::string& assetId, boost::shared_ptr<InWorldz::Data::Assets::Stratus::StratusAsset> assetBase)
	: _assetId(assetId), _assetBase(assetBase)
{

}

CloudFilesAsset::~CloudFilesAsset()
{
}

std::string CloudFilesAsset::getUUID() const
{
	return _assetId;
}

unsigned int CloudFilesAsset::getBinaryDataSize() const
{
	return _assetBase->data().length();
}

aperture::byte CloudFilesAsset::getType() const
{
	return (aperture::byte)_assetBase->type();
}

int CloudFilesAsset::getFullType() const
{
	return _assetBase->type();
}

unsigned int CloudFilesAsset::copyAssetData(std::string& storage) const
{
	storage = _assetBase->data();
	return _assetBase->data().length();
}

unsigned int CloudFilesAsset::copyAssetData(std::string& storage, unsigned int rngStart, unsigned int rngEnd) const
{
	auto dataSz = _assetBase->data().length();

	if (dataSz == 0) return 0;

	if (rngEnd > (dataSz - 1)) {
		//http spec says clamp it
		rngEnd = dataSz - 1;
	}

	if (rngStart > (dataSz - 1)) {
		//entirely reset the range and just return the whole object
		rngStart = 0;
		rngEnd = dataSz - 1;
	}

	if (rngEnd < rngStart) {
		//entirely reset the range. this seems to be a bug in the viewer,
		//but for flipped ranges apache just returns the entire object
		rngStart = 0;
		rngEnd = dataSz - 1;
	}

	storage.append(&_assetBase->data()[rngStart], (rngEnd - rngStart) + 1);

	return dataSz;
}

}}


text:
package com.awesome.pro.utilities.network;

/**
 * References related to networking.
 * @author siddharth.s
 */
public class NetworkReferences {

	public final static String HTTP_POST_METHOD = "POST";
	public final static String COOKIE_SEPARATOR = "&";
	public final static int HTTP_200_OK = 200;

}