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

namespace ZocMonLib
{
    public class DefaultReduceLevelProvider : IDefaultReduceLevelProvider
    {
        private readonly DefaultReduceLevel[] _levelsConfig;

        public DefaultReduceLevelProvider()
            : this(Defaults())
        {
        }

        public DefaultReduceLevelProvider(IEnumerable<DefaultReduceLevel> levels)
        {
            _levelsConfig = levels.OrderBy(x => x.Resolution).ToArray();
        }

        public IList<ReduceLevel> CreateReduceLevels()
        {
            return _levelsConfig.Select(x => new ReduceLevel()
                {
                    Resolution = x.Resolution,
                    HistoryLength = x.HistoryLength
                }).ToList();
        }

        public class DefaultReduceLevel
        {
            public DefaultReduceLevel(long resolution, long historyLength)
            {
                Resolution = resolution;
                HistoryLength = historyLength;
            }
            public long Resolution { get; private set; }
            public long HistoryLength { get; private set; }
        }

        private static IEnumerable<DefaultReduceLevel> Defaults()
        {
            yield return new DefaultReduceLevel(resolution: 60 * 1000, historyLength: 7 * 24 * 60 * 60 * 1000);
            yield return new DefaultReduceLevel(resolution: 5 * 60 * 1000, historyLength: 7 * 24 * 60 * 60 * 1000);
            yield return new DefaultReduceLevel(resolution: 60 * 60 * 1000, historyLength: 7 * 24 * 60 * 60 * 1000);
            yield return new DefaultReduceLevel(resolution: 24 * 60 * 60 * 1000, historyLength: 7 * 24 * 60 * 60 * 1000);
        }
    }
}


text:
package fr.adrienbrault.idea.symfony2plugin.dic;

import com.intellij.codeInsight.daemon.GutterIconNavigationHandler;
import com.intellij.codeInsight.navigation.NavigationUtil;
import com.intellij.navigation.GotoRelatedItem;
import com.intellij.psi.PsiElement;
import com.intellij.ui.awt.RelativePoint;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.event.MouseEvent;
import java.util.List;

/**
 * @author Daniel Espendiller <daniel@espendiller.net>
 */
public class RelatedPopupGotoLineMarker {

    public static class NavigationHandler implements GutterIconNavigationHandler<PsiElement> {

        private List<GotoRelatedItem> items;

        public NavigationHandler(List<GotoRelatedItem> items){
            this.items = items;
        }

        public void navigate(MouseEvent e, PsiElement elt) {
            List<GotoRelatedItem>  items = this.items;
            if (items.size() == 1) {
                items.get(0).navigate();
            } else {
                NavigationUtil.getRelatedItemsPopup(items, "Go to Related Files").show(new RelativePoint(e));
            }

        }

    }

    public static class PopupGotoRelatedItem extends GotoRelatedItem {

        private String customName;
        private Icon icon;
        private Icon smallIcon;

        public PopupGotoRelatedItem(@NotNull PsiElement element) {
            super(element);
        }

        public PopupGotoRelatedItem(@NotNull PsiElement element, String customName) {
            super(element);
            this.customName = customName;
        }

        @Nullable
        @Override
        public String getCustomName() {
            return customName;
        }

        @Nullable
        @Override
        public Icon getCustomIcon() {
            if(this.icon != null) {
                return this.icon;
            }

            return super.getCustomIcon();
        }

        public PopupGotoRelatedItem withIcon(Icon icon, Icon smallIcon) {
            this.icon = icon;
            this.smallIcon = smallIcon;
            return this;
        }

        public Icon getSmallIcon() {
            return smallIcon;
        }

    }

}

redpajama_set_name: RedPajamaGithub


text:
public class J1_staticmethoddeclaration {

  public J1_staticmethoddeclaration() {}

  public static int test() {
    return 123;
  }

}


text:
package org.springframework.ldap.pool2.factory;

import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.junit.Test;
import org.springframework.ldap.core.ContextSource;
import org.springframework.ldap.pool2.DirContextType;
import org.springframework.ldap.pool2.validation.DirContextValidator;
import org.springframework.ldap.pool2.AbstractPoolTestCase;
import org.springframework.util.ReflectionUtils;

import javax.naming.directory.DirContext;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
 * @author Eric Dalquist
 * @author Anindya Chatterjee
 */
public class DirContextPooledObjectFactoryTest extends AbstractPoolTestCase {

	@Test
	public void testProperties() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		try {
			objectFactory.setContextSource(null);
			fail("DirContextPooledObjectFactory.setContextSource should have thrown an IllegalArgumentException");
		}
		catch (IllegalArgumentException iae) {
			// Expected
		}

		objectFactory.setContextSource(contextSourceMock);
		final ContextSource contextSource2 = objectFactory.getContextSource();
		assertThat(contextSource2).isEqualTo(contextSourceMock);

		try {
			objectFactory.setDirContextValidator(null);
			fail("DirContextPooledObjectFactory.setDirContextValidator should have thrown an IllegalArgumentException");
		}
		catch (IllegalArgumentException iae) {
			// Expected
		}

		objectFactory.setDirContextValidator(dirContextValidatorMock);
		final DirContextValidator dirContextValidator2 = objectFactory.getDirContextValidator();
		assertThat(dirContextValidator2).isEqualTo(dirContextValidatorMock);
	}

	@Test
	public void testMakeObjectAssertions() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		try {
			objectFactory.makeObject(DirContextType.READ_ONLY);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}

		objectFactory.setContextSource(contextSourceMock);

		try {
			objectFactory.makeObject(null);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}
	}

	@Test
	public void testMakeObjectReadOnly() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		DirContext readOnlyContextMock = mock(DirContext.class);

		when(contextSourceMock.getReadOnlyContext()).thenReturn(readOnlyContextMock);
		objectFactory.setContextSource(contextSourceMock);

		final PooledObject createdDirContext = objectFactory.makeObject(DirContextType.READ_ONLY);
		InvocationHandler invocationHandler = Proxy.getInvocationHandler(createdDirContext.getObject());
		assertThat(readOnlyContextMock).isEqualTo(getInternalState(invocationHandler, "target"));
	}

	@Test
	public void testMakeObjectReadWrite() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		DirContext readWriteContextMock = mock(DirContext.class);

		when(contextSourceMock.getReadWriteContext()).thenReturn(readWriteContextMock);
		objectFactory.setContextSource(contextSourceMock);

		final PooledObject createdDirContext = objectFactory.makeObject(DirContextType.READ_WRITE);

		InvocationHandler invocationHandler = Proxy.getInvocationHandler(createdDirContext.getObject());
		assertThat(readWriteContextMock).isEqualTo(getInternalState(invocationHandler, "target"));
	}

	@Test
	public void testValidateObjectAssertions() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		try {
			PooledObject pooledObject = new DefaultPooledObject(dirContextMock);
			objectFactory.validateObject(DirContextType.READ_ONLY, pooledObject);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}

		objectFactory.setDirContextValidator(dirContextValidatorMock);

		try {
			PooledObject pooledObject = new DefaultPooledObject(dirContextMock);
			objectFactory.validateObject(null, pooledObject);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}

		try {
			PooledObject pooledObject = new DefaultPooledObject(dirContextMock);
			objectFactory.validateObject(new Object(), pooledObject);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}

		try {
			objectFactory.validateObject(DirContextType.READ_ONLY, null);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}

		try {
			PooledObject pooledObject = new DefaultPooledObject(new Object());
			objectFactory.validateObject(DirContextType.READ_ONLY, pooledObject);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}
	}

	@Test
	public void testValidateObject() throws Exception {
		when(dirContextValidatorMock
				.validateDirContext(DirContextType.READ_ONLY, dirContextMock))
				.thenReturn(true);

		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();
		objectFactory.setDirContextValidator(dirContextValidatorMock);

		PooledObject pooledObject = new DefaultPooledObject(dirContextMock);
		final boolean valid = objectFactory.validateObject(DirContextType.READ_ONLY, pooledObject);
		assertThat(valid).isTrue();

		//Check exception in validator
		DirContextValidator secondDirContextValidatorMock = mock(DirContextValidator.class);

		when(secondDirContextValidatorMock.validateDirContext(DirContextType.READ_ONLY, dirContextMock))
				.thenThrow(new RuntimeException("Failed to validate"));
		objectFactory.setDirContextValidator(secondDirContextValidatorMock);

		final boolean valid2 = objectFactory.validateObject(DirContextType.READ_ONLY, pooledObject);
		assertThat(valid2).isFalse();
	}

	@Test
	public void testDestroyObjectAssertions() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		try {
			objectFactory.destroyObject(DirContextType.READ_ONLY, null);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}

		try {
			PooledObject pooledObject = new DefaultPooledObject(new Object());
			objectFactory.validateObject(DirContextType.READ_ONLY, pooledObject);
			fail("IllegalArgumentException expected");
		} catch (IllegalArgumentException expected) {
			assertThat(true).isTrue();
		}
	}

	@Test
	public void testDestroyObject() throws Exception {
		final DirContextPooledObjectFactory objectFactory = new DirContextPooledObjectFactory();

		PooledObject pooledObject = new DefaultPooledObject(dirContextMock);
		objectFactory.destroyObject(DirContextType.READ_ONLY, pooledObject);

		DirContext throwingDirContextMock = mock(DirContext.class);

		doThrow(new RuntimeException("Failed to close"))
				.when(throwingDirContextMock).close();

		pooledObject = new DefaultPooledObject(throwingDirContextMock);
		objectFactory.destroyObject(DirContextType.READ_ONLY, pooledObject);
		verify(dirContextMock).close();
	}

	private <T> T getInternalState(Object target, String fieldName) {
		Field field = ReflectionUtils.findField(target.getClass(), fieldName);
		field.setAccessible(true);
		return (T) ReflectionUtils.getField(field, target);
	}
}


text:
#ifndef GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_H
#define GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_H

#include "src/core/channel/channel_stack.h"
#include "src/core/client_config/connector.h"

/** A (sub-)channel that knows how to connect to exactly one target
    address. Provides a target for load balancing. */
typedef struct grpc_subchannel grpc_subchannel;
typedef struct grpc_subchannel_call grpc_subchannel_call;
typedef struct grpc_subchannel_args grpc_subchannel_args;

#ifdef GRPC_SUBCHANNEL_REFCOUNT_DEBUG
#define GRPC_SUBCHANNEL_REF(p, r) \
  grpc_subchannel_ref((p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_UNREF(p, r) \
  grpc_subchannel_unref((p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_CALL_REF(p, r) \
  grpc_subchannel_call_ref((p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_CALL_UNREF(p, r) \
  grpc_subchannel_call_unref((p), __FILE__, __LINE__, (r))
#define GRPC_SUBCHANNEL_REF_EXTRA_ARGS \
  , const char *file, int line, const char *reason
#else
#define GRPC_SUBCHANNEL_REF(p, r) grpc_subchannel_ref((p))
#define GRPC_SUBCHANNEL_UNREF(p, r) grpc_subchannel_unref((p))
#define GRPC_SUBCHANNEL_CALL_REF(p, r) grpc_subchannel_call_ref((p))
#define GRPC_SUBCHANNEL_CALL_UNREF(p, r) grpc_subchannel_call_unref((p))
#define GRPC_SUBCHANNEL_REF_EXTRA_ARGS
#endif

void grpc_subchannel_ref(
    grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_unref(
    grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_ref(
    grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);
void grpc_subchannel_call_unref(
    grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS);

/** construct a call (possibly asynchronously) */
void grpc_subchannel_create_call(grpc_subchannel *subchannel,
                                 grpc_pollset *pollset,
                                 grpc_subchannel_call **target,
                                 grpc_iomgr_closure *notify);

/** process a transport level op */
void grpc_subchannel_process_transport_op(grpc_subchannel *subchannel,
                                          grpc_transport_op *op);

/** poll the current connectivity state of a channel */
grpc_connectivity_state grpc_subchannel_check_connectivity(
    grpc_subchannel *channel);

/** call notify when the connectivity state of a channel changes from *state.
    Updates *state with the new state of the channel */
void grpc_subchannel_notify_on_state_change(grpc_subchannel *channel,
                                            grpc_connectivity_state *state,
                                            grpc_iomgr_closure *notify);

void grpc_subchannel_add_interested_party(grpc_subchannel *channel,
                                          grpc_pollset *pollset);
void grpc_subchannel_del_interested_party(grpc_subchannel *channel,
                                          grpc_pollset *pollset);

/** continue processing a transport op */
void grpc_subchannel_call_process_op(grpc_subchannel_call *subchannel_call,
                                     grpc_transport_stream_op *op);

struct grpc_subchannel_args {
  /** Channel filters for this channel - wrapped factories will likely
      want to mutate this */
  const grpc_channel_filter **filters;
  /** The number of filters in the above array */
  size_t filter_count;
  /** Channel arguments to be supplied to the newly created channel */
  const grpc_channel_args *args;
  /** Address to connect to */
  struct sockaddr *addr;
  size_t addr_len;
  /** metadata context to use */
  grpc_mdctx *mdctx;
  /** master channel */
  grpc_channel *master;
};

/** create a subchannel given a connector */
grpc_subchannel *grpc_subchannel_create(grpc_connector *connector,
                                        grpc_subchannel_args *args);

#endif /* GRPC_INTERNAL_CORE_CLIENT_CONFIG_SUBCHANNEL_H */


text:
namespace ChessOk.ModelFramework
{
    /// <summary>
    /// Экземпляр класса, реализующего данный интерфейс, получает
    /// ссылку на экземпляр <see cref="IModelContext"/> во время собственного
    /// резолвинга.
    /// </summary>
    public interface IHaveModelContext
    {
        /// <summary>
        /// Получает экземпляр <see cref="IModelContext"/>, с помощью
        /// которого был получен экземпляр класса, реализующего данный интерфейс.
        /// </summary>
        IModelContext Context { get; set; }
    }
}


text:
package edu.wustl.cab2b.common.util;

import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * This class handles fetching properties from cab2b.properties file
 *
 * @author Chandrakant_Talele
 * @author lalit_chand
 */
public class CommonPropertyLoader {
    private static final Logger logger = edu.wustl.common.util.logger.Logger.getLogger(CommonPropertyLoader.class);

    private static Properties properties = Utility.getPropertiesFromFile("cab2b.properties");

    /**
     * @return The URL of JNDI service running on caB2B server
     */
    public static String getJndiUrl() {
        String serverIP = properties.getProperty("caB2B.server.ip");
        String jndiPort = properties.getProperty("caB2B.server.port");
        String jndiProtocol = properties.getProperty("caB2B.server.jndi.protocol");
        String invokerURLSuffix = properties.getProperty("caB2B.server.jndi.invoker.url.suffix");
        return jndiProtocol+"://" + serverIP + ":" + jndiPort+invokerURLSuffix;
    }

    //https://localhost:8443/invoker/JNDIFactorySSL
    //"jnp://" + serverIP + ":" + jndiPort;
}


text:
@implementation NewsScrollViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.urlArr = [[NSMutableArray alloc]init];
        self.titleArr = [[NSMutableArray alloc]init];
    }
    return  self;
}
- (void)setAdsModel:(NSArray *)modelArr {
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    if (_urlArr.count == 0) {
        for (newsAdModel *model in modelArr) {
            [self.urlArr addObject:model.imgsrc];
            [self.titleArr addObject:model.title];
        }
    }
    SDCycleScrollView *scrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width , 220) imageURLStringsGroup:_urlArr];
    scrollView.delegate = self;
    scrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight;
    scrollView.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated;
    scrollView.dotColor = [UIColor lightGrayColor];
    scrollView.placeholderImage = [UIImage imageNamed:@"contentview_image_default"];

    scrollView.titlesGroup = _titleArr;
    scrollView.titleLabelTextFont = [UIFont systemFontOfSize:13];
    scrollView.autoScrollTimeInterval = 4;
    [self.contentView addSubview:scrollView];
}

//点击头部的图片代理事件
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
    NSLog(@"点击了top第%ld张图片",(long)index);
}

@end


text:
{{ playerBar.songPlayer.currentSong.title }}

{{ currentSong.name }}

{{ playerBar.albumData.artist }}

                 <seek-bar value="{{ playerBar.songPlayer.currentTime }}" max="{{ playerBar.songPlayer.currentSong.duration }}"on-change="playerBar.songPlayer.setCurrentTime(value)"></seek-bar>

{{ playerBar.songPlayer.currentTime }}

{{ playerBar.songPlayer.currentSong.duration | timecode }}

             <seek-bar value="{{ playerBar.songPlayer.volume }}" max= 100 on-change="playerBar.songPlayer.setVolume(value)"></seek-bar>


text:
external help file: Microsoft.Azure.Commands.Network.dll-Help.xml
Module Name: AzureRM.Network
ms.assetid: 289B761C-1A1D-46D2-8755-B6B6A4758EFC
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.network/remove-azurermapplicationgatewayfrontendipconfig
schema: 2.0.0
---

# Remove-AzureRmApplicationGatewayFrontendIPConfig

## SYNOPSIS
Removes a front-end IP configuration from an application gateway.

## SYNTAX

```
Remove-AzureRmApplicationGatewayFrontendIPConfig -Name <String> -ApplicationGateway <PSApplicationGateway>
 [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
```

## DESCRIPTION
The **Remove-AzureRmApplicationGatewayFrontendIPConfig** cmdlet removes frontend IP from an Azure application gateway.

## EXAMPLES

### Example 1: Remove a front-end IP configuration
```
PS C:\>$AppGw = Get-AzureRmApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
PS C:\> Remove-AzureRmApplicationGatewayFrontendIPConfig -ApplicationGateway $AppGw -Name "FrontEndIP02"
```

The first command gets an application gateway named ApplicationGateway01 and stores it in the $AppGw variable.

The second command removes the front-end IP configuration named FrontEndIP02 from the application gateway stored in $AppGw.

## PARAMETERS

### -ApplicationGateway
Specifies an application gateway from which to remove a front-end IP configuration.

```yaml
Type: PSApplicationGateway
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.

```yaml
Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzureRmContext, AzureCredential

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name
Specifies the name of a front-end IP configuration to remove.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.String

## OUTPUTS

### Microsoft.Azure.Commands.Network.Models.PSApplicationGateway

## NOTES

## RELATED LINKS

[Add-AzureRmApplicationGatewayFrontendIPConfig](./Add-AzureRmApplicationGatewayFrontendIPConfig.md)

[Get-AzureRmApplicationGatewayFrontendIPConfig](./Get-AzureRmApplicationGatewayFrontendIPConfig.md)

[New-AzureRmApplicationGatewayFrontendIPConfig](./New-AzureRmApplicationGatewayFrontendIPConfig.md)

[Set-AzureRmApplicationGatewayFrontendIPConfig](./Set-AzureRmApplicationGatewayFrontendIPConfig.md)


text:
<?php

namespace PhilMareu\Laramanager\Form;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\File\UploadedFile;

class Uploader {

    /**
     * @param UploadedFile $file
     * @param string $path
     * @return string
     */
    public function upload(UploadedFile $file, $folder, $existing = null)
    {
        if($existing) $this->destroyFile($folder . '/' . $existing);

        return Upload::make($file, $folder)->generateNewFilename()->move();
    }

    protected function destroyFile($filenamePath)
    {
        if(Storage::has($filenamePath)) Storage::delete($filenamePath);
    }
}


text:
#ifndef SVGHKernElement_h
#define SVGHKernElement_h

#if ENABLE(SVG_FONTS)
#include "SVGFontElement.h"

namespace WebCore {

class SVGHKernElement final : public SVGElement {
public:
    static PassRefPtr<SVGHKernElement> create(const QualifiedName&, Document&);

    void buildHorizontalKerningPair(SVGKerningMap&);

private:
    SVGHKernElement(const QualifiedName&, Document&);

    virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
    virtual void removedFrom(ContainerNode&) override;

    virtual bool rendererIsNeeded(const RenderStyle&) override { return false; }
};

NODE_TYPE_CASTS(SVGHKernElement)

} // namespace WebCore

#endif // ENABLE(SVG_FONTS)
#endif


text:
===
Tag
===

.. toctree::
   :maxdepth: 1

   overview.md
   adding-tags.md
   searching-for-resources-by-tag.md
   deleting-tags.md


text:
<?php
	require_once('connect.inc');

	function get_connection() {
		global $host, $user, $passwd, $db, $port, $socket;

		if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
			printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
		return $link;
	}

	// Killing connection - 1

	$link = get_connection();
	if (true !== ($tmp = mysqli_query($link, "SELECT 1 AS 'processed before killed'", MYSQLI_ASYNC |  MYSQLI_USE_RESULT)))
		printf("[002] Expecting boolean/true got %s/%s\n", gettype($tmp), var_export($tmp, true));

	// Sleep 0.1s - the asynchronous query should have been processed after the wait period
	usleep(100000);
	$thread_id = mysqli_thread_id($link);
	mysqli_kill(get_connection(), $thread_id);

	$links = array($link);
	$errors = array($link);
	$reject = array($link);

	// Yes, 1 - the asynchronous query should have been processed
	if (1 !== ($tmp = (mysqli_poll($links, $errors, $reject, 0, 10000))))
		printf("[003] Expecting int/1 got %s/%s\n", gettype($tmp), var_export($tmp, true));

	if (!is_array($links) || empty($links))
		printf("[004] Expecting non-empty array got %s/%s\n", gettype($links), var_export($links, true));
	else
		foreach ($links as $link) {
			if (is_object($res = mysqli_reap_async_query($link))) {
				// Yes, you can fetch a result - the query has been processed
				var_dump(mysqli_fetch_assoc($res));
				mysqli_free_result($res);
			} else if ($link->errno > 0) {
				printf("[005] Error: %d\n", $link->errno);
			}
		}

	// No error!
	if (!is_array($errors) || !empty($errors))
		printf("[006] Expecting non-empty array got %s/%s\n", gettype($errors), var_export($errors, true));

	if (!is_array($reject) || !empty($reject))
		printf("[007] Expecting empty array got %s/%s\n", gettype($reject), var_export($reject, true));

	// Lets pass a dead connection
	$links = array($link);
	$errors = array($link);
	$reject = array($link);
	if (0 !== ($tmp = mysqli_poll($links, $errors, $reject, 1)))
		printf("[008] There should be no connection ready! Returned %s/%s, expecting int/0.\n",
			gettype($tmp), var_export($tmp, true));

	if (!empty($errors))
		printf("[009] There should be no errors but one rejected connection\n");

	foreach ($reject as $mysqli)
		if (mysqli_thread_id($mysqli) != $thread_id) {
			printf("[010] Rejected thread %d should have rejected thread %d\n",
				mysqli_thread_id($mysqli), $thread_id);
		}

	// Killing connection - 2

	$link = get_connection();
	if (true !== ($tmp = mysqli_query($link, "SELECT 1", MYSQLI_ASYNC |  MYSQLI_USE_RESULT)))
		printf("[011] Expecting boolean/true got %s/%s\n", gettype($tmp), var_export($tmp, true));

	usleep(100000);
	$thread_id = mysqli_thread_id($link);
	mysqli_kill(get_connection(), $thread_id);

	// Yes, 1 - fetch OK packet of kill!
	$processed = 0;
	$begin = microtime(true);
	do {
		$links = array($link, $link);
		$errors = array($link, $link);
		$reject = array($link, $link);
		$ready = mysqli_poll($links, $errors, $reject, 1);

		if (!empty($errors)) {
			foreach ($errors as $mysqli) {
				printf("[012] Error on thread %d: %s/%s\n",
					mysqli_thread_id($mysqli),
					mysqli_errno($mysqli),
					mysqli_error($mysqli));
			}
			break;
		}

		if (FALSE === $ready) {
			printf("[013] MySQLi indicates some error\n");
			break;
		}

		if (!empty($reject)) {
			foreach ($reject as $mysqli) {
				printf("[014] Rejecting thread %d: %s/%s\n",
					mysqli_thread_id($mysqli),
					mysqli_errno($mysqli),
					mysqli_error($mysqli));
			}
			$processed += count($reject);
		}

		foreach ($links as $mysqli) {
			if (is_object($res = mysqli_reap_async_query($mysqli))) {
				printf("Fetching from thread %d...\n", mysqli_thread_id($mysqli));
				var_dump(mysqli_fetch_assoc($res));
			} else if (mysqli_errno($mysqli) > 0) {
				printf("[015] %d/%s\n", mysqli_errno($mysqli), mysqli_error($mysqli));
			}
			$processed++;
		}

		if ((microtime(true) - $begin) > 5) {
			printf("[016] Pulling the emergency break after 5s, something is wrong...\n");
			break;
		}

	} while ($processed < 2);

	// Killing connection - 3

	$link = get_connection();
	$thread_id = mysqli_thread_id($link);
	mysqli_kill(get_connection(), $thread_id);
	// Sleep 0.1s  to ensure the KILL gets recognized
	usleep(100000);
	if (false !== ($tmp = mysqli_query($link, "SELECT 1 AS 'processed before killed'", MYSQLI_ASYNC |  MYSQLI_USE_RESULT)))
		printf("[017] Expecting boolean/false got %s/%s\n", gettype($tmp), var_export($tmp, true));

	$links = array($link);
	$errors = array($link);
	$reject = array($link);

	if (0 !== ($tmp = (mysqli_poll($links, $errors, $reject, 0, 10000))))
		printf("[018] Expecting int/0 got %s/%s\n", gettype($tmp), var_export($tmp, true));

	if (!is_array($links) || empty($links))
		printf("[019] Expecting non-empty array got %s/%s\n", gettype($links), var_export($links, true));
	else
		foreach ($links as $link) {
			if (is_object($res = mysqli_reap_async_query($link))) {
				// No, you cannot fetch the result
				var_dump(mysqli_fetch_assoc($res));
				mysqli_free_result($res);
			} else if ($link->errno > 0) {
				// But you are supposed to handle the error the way its shown here!
				printf("[020] Error: %d/%s\n", $link->errno, $link->error);
			}
		}

	// None of these will indicate an error, check errno on the list of returned connections!
	if (!is_array($errors) || !empty($errors))
		printf("[021] Expecting non-empty array got %s/%s\n", gettype($errors), var_export($errors, true));

	if (!is_array($reject) || !empty($reject))
		printf("[021] Expecting empty array got %s/%s\n", gettype($reject), var_export($reject, true));

	mysqli_close($link);
	print "done!";
?>


text:
Enter your new password

<form name="resetPasswordForm" novalidate>

        Your new password

        <input type="password" class="form-control" id="newPassword" name="newPassword" ng-model="newPassword"
               placeholder="Enter your new password..." maxlength="100"/>

Password is
          required

        Confirm your password

        <input type="password" class="form-control" id="confirmNewPassword" name="confirmNewPassword"
               ng-model="confirmNewPassword"
               placeholder="Confirm your password..." maxlength="100" required/>

          Passwords don't match.

Password is
          required

    <button class="btn btn-primary" ng-disabled="resetPasswordForm.$invalid" ng-click="submitForm()">Confirm</button>
    <button class="btn btn-primary" ng-click="cancelForm()">Cancel</button>

</form>


text:
namespace PokerTell.LiveTracker.Tests
{
    using System.Collections.Generic;
    using System.Linq;

    using Infrastructure.Interfaces.LiveTracker;

    using Machine.Specifications;

    using Moq;

    using PokerTell.Infrastructure.Interfaces;
    using PokerTell.Infrastructure.Interfaces.PokerHand;
    using PokerTell.Infrastructure.Interfaces.Statistics;
    using PokerTell.Infrastructure.Services;
    using PokerTell.LiveTracker.Interfaces;

    using Tools.FunctionalCSharp;

    using It = Machine.Specifications.It;

    // Resharper disable InconsistentNaming
    public abstract class GameControllerSpecs
    {
        protected static Mock<IPlayerStatistics> _playerStatistics_Mock;

        protected static Mock<IPlayerStatisticsUpdater> _playerStatisticsUpdater_Mock;

        protected static IConstructor<IPlayerStatistics> _playerStatisticsMake;

        protected static Mock<IPokerTableStatisticsViewModel> _overlayPokerTableStatistics_Mock;

        protected static Mock<IPokerTableStatisticsViewModel> _liveStatsPokerTableStatistics_Mock;

        protected static Mock<IGameHistoryViewModel> _gameHistory_Mock;

        protected static Mock<IConvertedPokerHand> _newHand_Stub;

        protected static Mock<ILiveTrackerSettingsViewModel> _liveTrackerSettings_Stub;

        protected static Mock<IPokerTableStatisticsWindowManager> _liveStatsWindow_Mock;

        protected static Mock<IGameHistoryWindowManager> _gameHistoryWindow_Mock;

        protected static Mock<ITableOverlayManager> _tableOverlayManager_Mock;

        protected static GameControllerSut _sut;

        Establish specContext = () => {
            _playerStatistics_Mock = new Mock<IPlayerStatistics>();
            _playerStatisticsUpdater_Mock = new Mock<IPlayerStatisticsUpdater>();
            _playerStatisticsMake = new Constructor<IPlayerStatistics>(() => _playerStatistics_Mock.Object);
            _overlayPokerTableStatistics_Mock = new Mock<IPokerTableStatisticsViewModel>();
            _liveStatsPokerTableStatistics_Mock = new Mock<IPokerTableStatisticsViewModel>();
            _gameHistory_Mock = new Mock<IGameHistoryViewModel>();

            _newHand_Stub = new Mock<IConvertedPokerHand>();
            _liveTrackerSettings_Stub = new Mock<ILiveTrackerSettingsViewModel>();

            _gameHistory_Mock = new Mock<IGameHistoryViewModel>();
            _liveStatsWindow_Mock = new Mock<IPokerTableStatisticsWindowManager>();
            _gameHistoryWindow_Mock = new Mock<IGameHistoryWindowManager>();

            _tableOverlayManager_Mock = new Mock<ITableOverlayManager>();

            _sut = new GameControllerSut(
                _gameHistory_Mock.Object,
                _overlayPokerTableStatistics_Mock.Object,
                _liveStatsPokerTableStatistics_Mock.Object,
                _playerStatisticsMake,
                _playerStatisticsUpdater_Mock.Object,
                _tableOverlayManager_Mock.Object,
                _liveStatsWindow_Mock.Object,
                _gameHistoryWindow_Mock.Object) { LiveTrackerSettings = _liveTrackerSettings_Stub.Object };
        };

        public abstract class Ctx_NewHand : GameControllerSpecs
        {
            protected const string heroName = "hero";

            protected const int totalSeats = 2;

            protected const string pokerSite = "PokerStars";

            protected const int showHoleCardsDuration = 1;

            protected const string tableName = "some table";

            Establish context = () => {
                _newHand_Stub.SetupGet(h => h.HeroName).Returns(heroName);
                _newHand_Stub.SetupGet(h => h.TotalSeats).Returns(totalSeats);
                _newHand_Stub.SetupGet(h => h.Site).Returns(pokerSite);
                _newHand_Stub.SetupGet(h => h.TableName).Returns(tableName);

                var hero_Stub = new Mock<IConvertedPokerPlayer>();
                hero_Stub.SetupGet(p => p.Name).Returns(heroName);
                _newHand_Stub.SetupGet(h => h.Players).Returns(new[] { hero_Stub.Object });

                _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowHoleCardsDuration).Returns(showHoleCardsDuration);
            };
        }

        public abstract class Ctx_NewHandWith_Bob_Ted_and_Jim_Sut_IsLaunched : Ctx_NewHand
        {
            protected const string bob = "bob";

            protected const string ted = "ted";

            protected const string jim = "jim";

            protected static Mock<IPlayerStatistics> bobsStats_Mock;

            protected static Mock<IPlayerStatistics> tedsStats_Mock;

            protected static Mock<IPlayerStatistics> jimsStats_Mock;

            protected static Mock<IConvertedPokerPlayer> bob_Stub;

            protected static Mock<IConvertedPokerPlayer> ted_Stub;

            protected static Mock<IConvertedPokerPlayer> jim_Stub;

            protected static int statsMade;

            Establish newHandWithBobTedAndJim_Context = () => {
                bob_Stub = new Mock<IConvertedPokerPlayer>();
                ted_Stub = new Mock<IConvertedPokerPlayer>();
                jim_Stub = new Mock<IConvertedPokerPlayer>();

                bob_Stub.SetupGet(p => p.Name).Returns(bob);
                ted_Stub.SetupGet(p => p.Name).Returns(ted);
                jim_Stub.SetupGet(p => p.Name).Returns(jim);

                bobsStats_Mock = new Mock<IPlayerStatistics>();
                tedsStats_Mock = new Mock<IPlayerStatistics>();
                jimsStats_Mock = new Mock<IPlayerStatistics>();

                var bobsPlayerIdentity_Stub = new Mock<IPlayerIdentity>();
                var tedsPlayerIdentity_Stub = new Mock<IPlayerIdentity>();
                var jimsPlayerIdentity_Stub = new Mock<IPlayerIdentity>();

                bobsStats_Mock.Setup(s => s.InitializePlayer(Moq.It.IsAny<string>(), Moq.It.IsAny<string>())).Returns(bobsStats_Mock.Object);
                tedsStats_Mock.Setup(s => s.InitializePlayer(Moq.It.IsAny<string>(), Moq.It.IsAny<string>())).Returns(tedsStats_Mock.Object);
                jimsStats_Mock.Setup(s => s.InitializePlayer(Moq.It.IsAny<string>(), Moq.It.IsAny<string>())).Returns(jimsStats_Mock.Object);

                bobsPlayerIdentity_Stub.SetupGet(pi => pi.Name).Returns(bob);
                tedsPlayerIdentity_Stub.SetupGet(pi => pi.Name).Returns(ted);
                jimsPlayerIdentity_Stub.SetupGet(pi => pi.Name).Returns(jim);
                bobsStats_Mock.SetupGet(s => s.PlayerIdentity).Returns(bobsPlayerIdentity_Stub.Object);
                tedsStats_Mock.SetupGet(s => s.PlayerIdentity).Returns(tedsPlayerIdentity_Stub.Object);
                jimsStats_Mock.SetupGet(s => s.PlayerIdentity).Returns(jimsPlayerIdentity_Stub.Object);

                statsMade = 0;
                _playerStatisticsMake = new Constructor<IPlayerStatistics>(
                    () => statsMade.Match()
                              .With(s => s == 0,
                                    s => {
                                        statsMade++;
                                        return bobsStats_Mock.Object;
                                    })
                              .With(s => s == 1,
                                    s => {
                                        statsMade++;
                                        return tedsStats_Mock.Object;
                                    })
                              .With(s => s == 2,
                                    s => {
                                        statsMade++;
                                        return jimsStats_Mock.Object;
                                    })
                              .Do());

                _newHand_Stub.SetupGet(h => h.Players).Returns(new[] { bob_Stub.Object, ted_Stub.Object, jim_Stub.Object });

                _sut = new GameControllerSut(
                    _gameHistory_Mock.Object,
                    _overlayPokerTableStatistics_Mock.Object,
                    _liveStatsPokerTableStatistics_Mock.Object,
                    _playerStatisticsMake,
                    _playerStatisticsUpdater_Mock.Object,
                    _tableOverlayManager_Mock.Object,
                _liveStatsWindow_Mock.Object,
                _gameHistoryWindow_Mock.Object) { LiveTrackerSettings = _liveTrackerSettings_Stub.Object };
                _sut.SetIsLaunched(true);
            };
        }

        [Subject(typeof(GameController), "New Hand, first time")]
        public class when_told_for_the_first_time_that_a_new_hand_was_found_and_the_user_does_not_want_to_see_the_overlay : Ctx_NewHand
        {
            const bool showTableOverlay = false;

            Establish context = () => _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowTableOverlay).Returns(showTableOverlay);

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_not_initialize_the_TableOverlayManager
                = () => _tableOverlayManager_Mock.Verify(tom => tom.InitializeWith(Moq.It.IsAny<IGameHistoryViewModel>(),
                                                                                Moq.It.IsAny<IPokerTableStatisticsViewModel>(),
                                                                                Moq.It.IsAny<int>(),
                                                                                Moq.It.IsAny<IConvertedPokerHand>()),
                                                         Times.Never());

            It should_set_IsLaunched_to_true = () => _sut.IsLaunched.ShouldBeTrue();

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "New Hand, first time")]
        public class when_told_for_the_first_time_that_a_new_hand_was_found_and_user_wants_to_see_the_overlay : Ctx_NewHand
        {
            const bool showTableOverlay = true;

            Establish context = () => _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowTableOverlay).Returns(showTableOverlay);

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_initialize_the_TableOverlayManager
                = () => _tableOverlayManager_Mock.Verify(tom => tom.InitializeWith(_gameHistory_Mock.Object,
                                                                                _overlayPokerTableStatistics_Mock.Object,
                                                                                showHoleCardsDuration,
                                                                                _newHand_Stub.Object));

            It should_set_IsLaunched_to_true = () => _sut.IsLaunched.ShouldBeTrue();

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "New Hand, first time")]
        public class when_told_for_the_first_time_that_a_new_hand_was_found_and_user_wants_to_see_the_livestats_window_on_startup : Ctx_NewHand
        {
            const bool showLiveStatsWindowOnStartup = true;

            Establish context =
                () => _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowLiveStatsWindowOnStartup).Returns(showLiveStatsWindowOnStartup);

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_set_the_DataContext_of_the_LiveStats_window_to_the_livestats_pokertable_viewmodel
                = () => _liveStatsWindow_Mock.VerifySet(lsw => lsw.DataContext = _liveStatsPokerTableStatistics_Mock.Object);

            It should_show_the_LiveStats_window = () => _liveStatsWindow_Mock.Verify(lsw => lsw.Show());

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "New Hand, first time")]
        public class when_told_for_the_first_time_that_a_new_hand_was_found_and_user_does_not_want_to_see_the_livestats_window_on_startup :
            Ctx_NewHand
        {
            const bool showLiveStatsWindowOnStartup = false;

            Establish context =
                () => _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowLiveStatsWindowOnStartup).Returns(showLiveStatsWindowOnStartup);

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_set_the_DataContext_of_the_LiveStats_window_to_the_livestats_pokertable_viewmodel
                = () => _liveStatsWindow_Mock.VerifySet(lsw => lsw.DataContext = _liveStatsPokerTableStatistics_Mock.Object);

            It should_not_show_the_LiveStats_window = () => _liveStatsWindow_Mock.Verify(lsw => lsw.Show(), Times.Never());

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "New Hand, not first time")]
        public class when_told_that_a_new_hand_was_found_but_not_the_first_time_and_the_user_wants_to_see_LiveStats_and_Overlay_windows : Ctx_NewHand
        {
            const bool showLiveStatsWindowOnStartup = true;

            const bool showTableOverlay = true;

            Establish context = () => {
                _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowTableOverlay).Returns(showTableOverlay);
                _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowLiveStatsWindowOnStartup).Returns(showLiveStatsWindowOnStartup);
                _sut.SetIsLaunched(true);
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_not_initialize_the_TableOverlayManager_again
                = () => _tableOverlayManager_Mock.Verify(tom => tom.InitializeWith(Moq.It.IsAny<IGameHistoryViewModel>(),
                                                                                Moq.It.IsAny<IPokerTableStatisticsViewModel>(),
                                                                                Moq.It.IsAny<int>(),
                                                                                Moq.It.IsAny<IConvertedPokerHand>()),
                                                         Times.Never());

            It should_not_set_the_DataContext_of_the_LiveStats_window_to_the_livestats_pokertable_viewmodel_again
                = () => _liveStatsWindow_Mock.VerifySet(lsw => lsw.DataContext = _liveStatsPokerTableStatistics_Mock.Object, Times.Never());

            It should_not_show_the_LiveStats_window_again = () => _liveStatsWindow_Mock.Verify(lsw => lsw.Show(), Times.Never());

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "New Hand")]
        public class when_told_that_a_new_hand_was_found_and_the_user_does_not_want_to_see_the_overlay : Ctx_NewHand
        {
            const bool showTableOverlay = false;

            Establish context = () => {
                _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowTableOverlay).Returns(showTableOverlay);
                _sut.SetIsLaunched(true);
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_add_the_new_hand_to_the_GameHistory_viewmodel = () => _gameHistory_Mock.Verify(gh => gh.AddNewHand(_newHand_Stub.Object));

            It should_not_update_the_table_overlay_manager_with_the_players_and_the_board_contained_in_the_hand
                = () => _tableOverlayManager_Mock.Verify(tom => tom.UpdateWith(_newHand_Stub.Object), Times.Never());

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "New Hand")]
        public class when_told_about_a_new_hand_and_the_user_wants_to_see_the_table_overlay : Ctx_NewHand
        {
            const string board = "As Kh Qs";

            const bool showTableOverlay = true;

            Establish context = () => {
                _newHand_Stub.SetupGet(h => h.Board).Returns(board);
                _liveTrackerSettings_Stub.SetupGet(lts => lts.ShowTableOverlay).Returns(showTableOverlay);
                _sut.SetIsLaunched(true);
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_add_the_new_hand_to_the_GameHistory_viewmodel = () => _gameHistory_Mock.Verify(gh => gh.AddNewHand(_newHand_Stub.Object));

            It should_update_the_table_overlay_manager_with_the_players_and_the_board_contained_in_the_hand
                = () => _tableOverlayManager_Mock.Verify(tom => tom.UpdateWith(_newHand_Stub.Object));

            It should_set_the_LiveStats_PokerTableStatistics_table_name_to_the_one_returned_by_the_hand
                = () => _liveStatsPokerTableStatistics_Mock.VerifySet(lsvm => lsvm.TableName = tableName);
        }

        [Subject(typeof(GameController), "NewHand")]
        public class when_told_about_new_hand_with_bob_ted_and_jim_and_PlayerStatistics_are_empty_and_jim_the_hero_wants_to_see_his_statistics
            : Ctx_NewHandWith_Bob_Ted_and_Jim_Sut_IsLaunched
        {
            Establish context = () => {
                _newHand_Stub
                    .SetupGet(h => h.HeroName)
                    .Returns(jim);
                _liveTrackerSettings_Stub
                    .SetupGet(ls => ls.ShowMyStatistics)
                    .Returns(true);
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_add_bob_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(bob);

            It should_add_ted_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(ted);

            It should_add_jim_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(jim);

            It should_initialize_bobs_statistics_with_the_site_and_his_name = () => bobsStats_Mock.Verify(s => s.InitializePlayer(bob, pokerSite));

            It should_initialize_teds_statistics_with_the_site_and_his_name = () => tedsStats_Mock.Verify(s => s.InitializePlayer(ted, pokerSite));

            It should_initialize_jims_statistics_with_the_site_and_his_name = () => jimsStats_Mock.Verify(s => s.InitializePlayer(jim, pokerSite));

            It should_update_bobs_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == bob))));

            It should_update_teds_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == ted))));

            It should_update_jims_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == jim))));
        }

        [Subject(typeof(GameController), "NewHand")]
        public class when_told_about_new_hand_with_bob_ted_and_jim_and_PlayerStatistics_are_empty_and_jim_the_hero_does_not_want_to_see_his_statistics
            : Ctx_NewHandWith_Bob_Ted_and_Jim_Sut_IsLaunched
        {
            Establish context = () => {
                _newHand_Stub
                    .SetupGet(h => h.HeroName)
                    .Returns(jim);
                _liveTrackerSettings_Stub
                    .SetupGet(ls => ls.ShowMyStatistics)
                    .Returns(false);
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_add_bob_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(bob);

            It should_add_ted_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(ted);

            It should_not_add_jim_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldNotContain(jim);

            It should_initialize_bobs_statistics_with_the_site_and_his_name = () => bobsStats_Mock.Verify(s => s.InitializePlayer(bob, pokerSite));

            It should_initialize_teds_statistics_with_the_site_and_his_name = () => tedsStats_Mock.Verify(s => s.InitializePlayer(ted, pokerSite));

            It should_not_initialize_jims_statistics_with_the_site_and_his_name = () => jimsStats_Mock.Verify(s => s.InitializePlayer(jim, pokerSite), Times.Never());

            It should_update_bobs_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == bob))));

            It should_update_teds_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == ted))));

            It should_not_update_jims_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == jim))), Times.Never());
        }

        [Subject(typeof(GameController), "NewHand")]
        public class when_told_about_new_hand_with_bob_ted_and_jim_and_PlayerStatistics_contain_bob_and_ted
            : Ctx_NewHandWith_Bob_Ted_and_Jim_Sut_IsLaunched
        {
            Establish context = () => {
                _sut.PlayerStatistics.Add(bob, bobsStats_Mock.Object);
                _sut.PlayerStatistics.Add(ted, tedsStats_Mock.Object);
                statsMade = 2;
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_add_jim_to_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(jim);

            It should_not_initialize_bobs_statistics_with_the_site_and_his_name_again =
                () => bobsStats_Mock.Verify(s => s.InitializePlayer(bob, pokerSite), Times.Never());

            It should_not_initialize_teds_statistics_with_the_site_and_his_name_again =
                () => tedsStats_Mock.Verify(s => s.InitializePlayer(ted, pokerSite), Times.Never());

            It should_initialize_jims_statistics_with_the_site_and_his_name = () => jimsStats_Mock.Verify(s => s.InitializePlayer(jim, pokerSite));

            It should_update_bobs_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == bob))));

            It should_update_teds_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == ted))));

            It should_update_jims_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == jim))));
        }

        [Subject(typeof(GameController), "NewHand")]
        public class when_told_about_new_hand_with_only_bob_and_ted_and_PlayerStatistics_contain_bob_ted_and_jim
            : Ctx_NewHandWith_Bob_Ted_and_Jim_Sut_IsLaunched
        {
            Establish context = () => {
                _sut.PlayerStatistics.Add(bob, bobsStats_Mock.Object);
                _sut.PlayerStatistics.Add(ted, tedsStats_Mock.Object);
                _sut.PlayerStatistics.Add(jim, jimsStats_Mock.Object);

                // jim left the table
                _newHand_Stub.SetupGet(h => h.Players).Returns(new[] { bob_Stub.Object, ted_Stub.Object });
            };

            Because of = () => _sut.NewHand(_newHand_Stub.Object);

            It should_not_remove_jim_from_the_PlayerStatistics = () => _sut.PlayerStatistics.Keys.ShouldContain(jim);

            It should_update_bobs_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == bob))));

            It should_update_teds_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == ted))));

            It should_not_update_jims_statistics
                = () => _playerStatisticsUpdater_Mock
                            .Verify(su => su.Update(Moq.It.Is<IEnumerable<IPlayerStatistics>>(ps => ps.Any(s => s.PlayerIdentity.Name == jim))),
                                    Times.Never());
        }

        [Subject(typeof(GameController), "PlayerStatisticsUpdater finished")]
        public class when_the_player_statistics_updater_says_that_he_finished_updating_the_statistics : GameControllerSpecs
        {
            static IEnumerable<IPlayerStatistics> playerStatistics_Stub;

            Establish context = () => playerStatistics_Stub = new[] { new Mock<IPlayerStatistics>().Object };

            Because of = () => _playerStatisticsUpdater_Mock.Raise(u => u.FinishedUpdatingMultiplePlayerStatistics += null, playerStatistics_Stub);

            It should_update_the_overlay_pokertable_statistics_with_the_passed_player_statistics
                = () => _overlayPokerTableStatistics_Mock.Verify(ts => ts.UpdateWith(playerStatistics_Stub));

            It should_update_the_liveStats_pokertable_statistics_with_the_passed_player_statistics
                = () => _liveStatsPokerTableStatistics_Mock.Verify(ts => ts.UpdateWith(playerStatistics_Stub));
        }

        [Subject(typeof(GameController), "Table closed")]
        public class when_the_overlay_table_manager_says_that_the_table_is_closed : GameControllerSpecs
        {
            static bool shuttingDownRaised;

            Establish context = () => _sut.ShuttingDown += () => shuttingDownRaised = true;

            Because of = () => _tableOverlayManager_Mock.Raise(tom => tom.TableClosed += null);

            It should_dispose_the_table_overlay_manager = () => _tableOverlayManager_Mock.Verify(tom => tom.Dispose());

            It should_dispose_the_live_stats_window_manager = () => _liveStatsWindow_Mock.Verify(ls => ls.Dispose());

            It should_dispose_the_game_history_window_manager = () => _gameHistoryWindow_Mock.Verify(gh => gh.Dispose());

            It should_raise_ShuttingDown = () => shuttingDownRaised.ShouldBeTrue();
        }

        [Subject(typeof(GameController), "Show LiveStatsWindow requested")]
        public class when_the_user_requests_to_see_the_live_stats_window : GameControllerSpecs
        {
            Because of = () => _tableOverlayManager_Mock.Raise(tom => tom.ShowLiveStatsWindowRequested += null);

            It should_show_it = () => _liveStatsWindow_Mock.Verify(lsw => lsw.Show());

            It should_activate_it = () => _liveStatsWindow_Mock.Verify(lsw => lsw.Activate());
        }

        [Subject(typeof(GameController), "Show GameHistoryWindow requested")]
        public class when_the_user_requests_to_see_the_game_history_window : GameControllerSpecs
        {
            Because of = () => _tableOverlayManager_Mock.Raise(tom => tom.ShowGameHistoryWindowRequested += null);

            It should_set_its_DataContext_to_the_GameHistory_ViewModel = () => _gameHistoryWindow_Mock.VerifySet(ghw => ghw.DataContext = _gameHistory_Mock.Object);

            It should_show_it = () => _gameHistoryWindow_Mock.Verify(ghw => ghw.Show());

            It should_activate_it = () => _gameHistoryWindow_Mock.Verify(ghw => ghw.Activate());
        }

        protected class GameControllerSut : GameController
        {
            public GameControllerSut(
                IGameHistoryViewModel gameHistory,
                IPokerTableStatisticsViewModel overlayPokerTableStatistics,
                IPokerTableStatisticsViewModel liveStatsPokerTableStatistics,
                IConstructor<IPlayerStatistics> playerStatisticsMake,
                IPlayerStatisticsUpdater playerStatisticsUpdater,
                ITableOverlayManager tableOverlayManager,
                IPokerTableStatisticsWindowManager pokerTableStatisticsWindowManager,
                IGameHistoryWindowManager gameHistoryWindowManager)
                : base(
                    gameHistory,
                    overlayPokerTableStatistics,
                    liveStatsPokerTableStatistics,
                    playerStatisticsMake,
                    playerStatisticsUpdater,
                    tableOverlayManager,
                    pokerTableStatisticsWindowManager,
                    gameHistoryWindowManager)
            {
            }

            public GameControllerSut SetIsLaunched(bool isLaunched)
            {
                IsLaunched = isLaunched;
                return this;
            }
        }
    }
}


text:
package tarefa8;

public class Cachorro extends Animal {

	public Cachorro(String f,String x,String y, int z) {
		super(f,x,y,z);
		System.out.println("Cachorro ADD");
// TODO Auto-generated constructor stub
	}

	@Override
	public String fazerBarulho() {
		// TODO Auto-generated method stub
		return "auau";
	}

}


text:
<?php
namespace Vfs;

use Mockery;
use Vfs\Test\UnitTestCase;

class FileSystemTest extends UnitTestCase
{
    public function setUp()
    {
        $this->scheme = 'foo';
        $this->wrapperClass = 'Vfs\Stream\StreamWrapper';
        $this->logger = Mockery::mock('Psr\Log\LoggerInterface');
        $this->walker = Mockery::mock('Vfs\Node\Walker\NodeWalkerInterface');
        $this->factory = Mockery::mock('Vfs\Node\Factory\NodeFactoryInterface');
        $this->registry = Mockery::mock('Vfs\RegistryInterface');
        $this->root = Mockery::mock('Vfs\Node\NodeContainerInterface');

        $this->factory->shouldReceive('buildDirectory')->once()->withNoArgs()->andReturn($this->root);

        $this->fs = new FileSystem($this->scheme, $this->wrapperClass, $this->factory, $this->walker, $this->registry, $this->logger);
    }

    public function testInterface()
    {
        $this->assertInstanceOf('Vfs\FileSystemInterface', $this->fs);
    }

    public function testGet()
    {
        $path = '/foo/bar/baz.txt';
        $node = Mockery::mock('Vfs\Node\NodeInterface');

        $this->walker->shouldReceive('findNode')->once()->with($this->root, $path)->andReturn($node);

        $this->assertSame($node, $this->fs->get($path));
    }

    public function testGetLogger()
    {
        $this->assertSame($this->logger, $this->fs->getLogger());
    }

    public function testGetNodeFactory()
    {
        $this->assertSame($this->factory, $this->fs->getNodeFactory());
    }

    public function testGetNodeWalker()
    {
        $this->assertSame($this->walker, $this->fs->getNodeWalker());
    }

    public function testMountThrowsRegisteredException()
    {
        $this->registry->shouldReceive('has')->once()->with($this->scheme)->andReturn(true);

        $this->setExpectedException('Vfs\Exception\RegisteredSchemeException');

        $this->fs->mount();
    }

    public function testUnmountThrowsUnregisteredException()
    {
        $this->registry->shouldReceive('has')->once()->with($this->scheme)->andReturn(false);

        $this->setExpectedException('Vfs\Exception\UnregisteredSchemeException');

        $this->fs->unmount();
    }

    public function testGetScheme()
    {
        $this->assertSame($this->scheme, $this->fs->getScheme());
    }

    public function testGetSchemeWithoutColonSlashSlash()
    {
        $factory = Mockery::mock('Vfs\Node\Factory\NodeFactoryInterface');
        $factory->shouldReceive('buildDirectory')->once()->withNoArgs()->andReturn($this->root);

        $fs = new FileSystem("foo://", $this->wrapperClass, $factory, $this->walker, $this->registry, $this->logger);

        $this->assertSame($this->scheme, $fs->getScheme());
    }
}


text:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once APPPATH."third_party/Requests/Requests.php";

class PHPRequests
{
    public function __construct()
    {
       Requests::register_autoloader();
    }
}

/* End of file PHPRequests.php */
/* Location: private/apps/libraries/PHPRequests.php */


text:
namespace boost { namespace gil {

namespace detail {

template< int J, int A, int B>
struct scaling_factors
{
    static_assert(mpl::equal_to< mpl::int_< J >, mpl::int_< 4 > >::value, "");

    static_assert(mpl::or_<mpl::equal_to< mpl::int_<A>, mpl::int_< 4 > >
                                  , mpl::or_< mpl::equal_to< mpl::int_<A>, mpl::int_< 2 > >
                                            , mpl::equal_to< mpl::int_<A>, mpl::int_< 1 > >
                                            >
                                  >::value, "");

    static_assert(mpl::or_< mpl::equal_to< mpl::int_<B>, mpl::int_< 4 > >
                                  , mpl::or_< mpl::equal_to< mpl::int_<B>, mpl::int_< 2 > >
                                            , mpl::or_< mpl::equal_to< mpl::int_<B>, mpl::int_< 1 > >
                                                      , mpl::equal_to< mpl::int_<B>, mpl::int_< 0 > >
                                                      >
                                            >
                                  >::value, "");

    static constexpr int ss_X =
        mpl::divides
        <
            mpl::int_<J>,
            mpl::int_<A>
        >::value;

    static constexpr int ss_Y =
        mpl::if_
        <
            mpl::equal_to<mpl::int_<B>, mpl::int_<0>>,
            mpl::int_<2>,
            typename mpl::if_
            <
                mpl::equal_to<mpl::int_<A>, mpl::int_<B>>,
                mpl::int_<1>,
                mpl::int_<4>
            >::type
        >::type::value;
};

} // namespace detail

////////////////////////////////////////////////////////////////////////////////////////
/// \class subchroma_image_deref_fn
/// \ingroup PixelLocatorModel PixelBasedModel
/// \brief Used for virtual_2D_locator
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Locator
        , typename Factors
        >
struct subchroma_image_deref_fn
{
    using plane_locator_t = gray8_view_t::locator;

    using const_t = subchroma_image_deref_fn<Locator, Factors>;
    using value_type = typename Locator::value_type;
    using reference = value_type;
    using const_reference = value_type;
    using argument_type = point_t;
    using result_type = reference;

    static const bool is_mutable = false;

    /// default constructor
    subchroma_image_deref_fn() {}

    /// constructor
    subchroma_image_deref_fn( const plane_locator_t& y_locator
                            , const plane_locator_t& v_locator
                            , const plane_locator_t& u_locator
                             )
    : _y_locator( y_locator )
    , _v_locator( v_locator )
    , _u_locator( u_locator )
    {}

    /// operator()
    result_type operator()( const point_t& p ) const
    {
        using scaling_factors_t = detail::scaling_factors
            <
                mpl::at_c<Factors, 0>::type::value,
                mpl::at_c<Factors, 1>::type::value,
                mpl::at_c<Factors, 2>::type::value
            >;

        plane_locator_t y = _y_locator.xy_at( p );
        plane_locator_t v = _v_locator.xy_at( p.x / scaling_factors_t::ss_X, p.y / scaling_factors_t::ss_X );
        plane_locator_t u = _u_locator.xy_at( p.x / scaling_factors_t::ss_X, p.y / scaling_factors_t::ss_X );

        return value_type( at_c< 0 >( *y )
                         , at_c< 0 >( *v )
                         , at_c< 0 >( *u )
                         );
    }

    ///
    const plane_locator_t& y_locator() const { return _y_locator; }
    const plane_locator_t& v_locator() const { return _v_locator; }
    const plane_locator_t& u_locator() const { return _u_locator; }

private:

    plane_locator_t _y_locator;
    plane_locator_t _v_locator;
    plane_locator_t _u_locator;
};

////////////////////////////////////////////////////////////////////////////////////////
/// \class subchroma_image_locator_type
/// \ingroup PixelLocatorModel PixelBasedModel
/// \brief
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Locator
        , typename Factors
        >
struct subchroma_image_locator
{
    using type = virtual_2d_locator
        <
            subchroma_image_deref_fn<Locator, Factors>, // Deref
            false // IsTransposed
        >;
};

/////////////////////////////
//  PixelBasedConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct channel_type< subchroma_image_locator< Locator, Factors > >
    : public channel_type< typename subchroma_image_locator< Locator, Factors >::type > {};

template < typename Locator, typename Factors >
struct color_space_type< subchroma_image_locator< Locator, Factors > >
    : public color_space_type< typename subchroma_image_locator< Locator, Factors >::type > {};

template < typename Locator, typename Factors >
struct channel_mapping_type< subchroma_image_locator< Locator, Factors > >
    : public channel_mapping_type< typename subchroma_image_locator< Locator, Factors >::type > {};

template < typename Locator, typename Factors >
struct is_planar< subchroma_image_locator< Locator, Factors > >
    : public is_planar< typename subchroma_image_locator< Locator, Factors >::type > {};

/////////////////////////////
//  HasDynamicXStepTypeConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct dynamic_x_step_type< subchroma_image_locator< Locator, Factors > >
{
    using type = typename subchroma_image_locator<Locator, Factors>::type;
};

/////////////////////////////
//  HasDynamicYStepTypeConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct dynamic_y_step_type< subchroma_image_locator< Locator, Factors > >
{
    using type = typename subchroma_image_locator<Locator, Factors>::type;
};

/////////////////////////////
//  HasTransposedTypeConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct transposed_type< subchroma_image_locator< Locator, Factors > >
{
    using type = typename subchroma_image_locator<Locator, Factors>::type;
};

//////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////
/// \class subchroma_image_view
/// \ingroup ImageViewModel PixelBasedModel
/// \brief A lightweight object that interprets a subchroma image.
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Locator
        , typename Factors = mpl::vector_c< int, 4, 4, 4 >
        >
class subchroma_image_view : public image_view< Locator >
{
public:

    using locator = Locator;
    using deref_fn_t = typename locator::deref_fn_t;
    using plane_locator_t = typename deref_fn_t::plane_locator_t;

    using const_t = subchroma_image_view<Locator, Factors>;

    using plane_view_t = image_view<plane_locator_t>;

    /// default constructor
    subchroma_image_view()
    : image_view< Locator >()
    {}

    /// constructor
    subchroma_image_view( const point_t& y_dimensions
                        , const point_t& v_dimensions
                        , const point_t& u_dimensions
                        , const Locator& locator
                        )
    : image_view< Locator >( y_dimensions, locator )
    , _y_dimensions( y_dimensions )
    , _v_dimensions( v_dimensions )
    , _u_dimensions( u_dimensions )
    {}

    /// copy constructor
    template< typename Subchroma_View >
    subchroma_image_view( const Subchroma_View& v )
    : image_view< locator >( v )
    {}

    const point_t& v_ssfactors() const { return point_t( get_deref_fn().vx_ssfactor(), get_deref_fn().vx_ssfactor() ); }
    const point_t& u_ssfactors() const { return point_t( get_deref_fn().ux_ssfactor(), get_deref_fn().ux_ssfactor() ); }

    const point_t& y_dimension() const { return _y_dimensions; }
    const point_t& v_dimension() const { return _v_dimensions; }
    const point_t& u_dimension() const { return _u_dimensions; }

    const plane_locator_t& y_plane() const { return get_deref_fn().y_locator(); }
    const plane_locator_t& v_plane() const { return get_deref_fn().v_locator(); }
    const plane_locator_t& u_plane() const { return get_deref_fn().u_locator(); }

    const plane_view_t y_plane_view() const { return plane_view_t( _y_dimensions, y_plane() ); }
    const plane_view_t v_plane_view() const { return plane_view_t( _v_dimensions, v_plane() ); }
    const plane_view_t u_plane_view() const { return plane_view_t( _u_dimensions, u_plane() ); }

private:

    const deref_fn_t& get_deref_fn() const { return this->pixels().deref_fn(); }

private:

    point_t _y_dimensions;
    point_t _v_dimensions;
    point_t _u_dimensions;
};

/////////////////////////////
//  PixelBasedConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct channel_type< subchroma_image_view< Locator, Factors > >
    : public channel_type< Locator > {};

template < typename Locator, typename Factors >
struct color_space_type< subchroma_image_view< Locator, Factors > >
    : public color_space_type< Locator > {};

template < typename Locator, typename Factors >
struct channel_mapping_type< subchroma_image_view< Locator, Factors > >
     : public channel_mapping_type< Locator > {};

template < typename Locator, typename Factors >
struct is_planar< subchroma_image_view< Locator, Factors > >
    : public is_planar< Locator > {};

/////////////////////////////
//  HasDynamicXStepTypeConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct dynamic_x_step_type< subchroma_image_view< Locator, Factors > >
{
    using type = image_view<typename dynamic_x_step_type<Locator>::type>;
};

/////////////////////////////
//  HasDynamicYStepTypeConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct dynamic_y_step_type< subchroma_image_view< Locator, Factors > >
{
    using type = image_view<typename dynamic_y_step_type<Locator>::type>;
};

/////////////////////////////
//  HasTransposedTypeConcept
/////////////////////////////

template < typename Locator, typename Factors >
struct transposed_type< subchroma_image_view< Locator, Factors > >
{
    using type = image_view<typename transposed_type<Locator>::type>;
};

////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ImageModel PixelBasedModel
/// \brief container interface over image view. Models ImageConcept, PixelBasedConcept
///
/// A subchroma image holds a bunch of planes which don't need to have the same resolution.
///
////////////////////////////////////////////////////////////////////////////////////////
template< typename Pixel
        , typename Factors   = mpl::vector_c< int, 4, 4, 4 >
        , typename Allocator = std::allocator< unsigned char >
        >
class subchroma_image : public detail::scaling_factors< mpl::at_c< Factors, 0 >::type::value
                                              , mpl::at_c< Factors, 1 >::type::value
                                              , mpl::at_c< Factors, 2 >::type::value
                                              >
{

private:
    using parent_t = detail::scaling_factors< mpl::at_c< Factors, 0 >::type::value
                                              , mpl::at_c< Factors, 1 >::type::value
                                              , mpl::at_c< Factors, 2 >::type::value
                                              >;

public:

    using channel_t = typename channel_type<Pixel>::type;
    using pixel_t = pixel<channel_t, gray_layout_t>;

    using plane_image_t = image<pixel_t, false, Allocator>;

    using plane_view_t = typename plane_image_t::view_t;
    using plane_const_view_t = typename plane_image_t::const_view_t;
    using plane_locator_t = typename plane_view_t::locator;

    using pixel_view_t = typename view_type_from_pixel<Pixel>::type;
    using pixel_locator_t = typename pixel_view_t::locator;

    using locator_t = typename subchroma_image_locator
        <
            pixel_locator_t,
            Factors
        >::type;

    using x_coord_t = typename plane_image_t::coord_t;
    using y_coord_t = typename plane_image_t::coord_t;

    using view_t = subchroma_image_view<locator_t, Factors>;
    using const_view_t = typename view_t::const_t;

    /// constructor
    subchroma_image( const x_coord_t y_width
                   , const y_coord_t y_height
                   )
    : _y_plane(        y_width,        y_height, 0, Allocator() )
    , _v_plane( y_width / parent_t::ss_X, y_height / parent_t::ss_Y, 0, Allocator() )
    , _u_plane( y_width / parent_t::ss_X, y_height / parent_t::ss_Y, 0, Allocator() )
    {
        init();
    }

public:

    view_t _view;

private:

    void init()
    {
        using defer_fn_t = subchroma_image_deref_fn<pixel_locator_t, Factors>;

        defer_fn_t deref_fn( view( _y_plane ).xy_at( 0, 0 )
                           , view( _v_plane ).xy_at( 0, 0 )
                           , view( _u_plane ).xy_at( 0, 0 )
                           );

        // init a virtual_2d_locator
        locator_t locator( point_t( 0, 0 ) // p
                         , point_t( 1, 1 ) // step
                         , deref_fn
                         );

        _view = view_t( _y_plane.dimensions()
                      , _v_plane.dimensions()
                      , _u_plane.dimensions()
                      , locator
                      );
    }

private:

    plane_image_t _y_plane;
    plane_image_t _v_plane;
    plane_image_t _u_plane;
};

/////////////////////////////
//  PixelBasedConcept
/////////////////////////////

template < typename Pixel, typename Factors, typename Alloc >
struct channel_type< subchroma_image< Pixel, Factors, Alloc > >
    : public channel_type< Pixel > {};

template < typename Pixel, typename Factors, typename Alloc >
struct color_space_type< subchroma_image< Pixel, Factors, Alloc > >
    : public color_space_type< Pixel > {};

template < typename Pixel, typename Factors, typename Alloc >
struct channel_mapping_type<  subchroma_image< Pixel, Factors, Alloc > >
    : public channel_mapping_type< Pixel > {};

template < typename Pixel, typename Factors, typename Alloc >
struct is_planar< subchroma_image< Pixel, Factors, Alloc > >
    : public mpl::bool_< false > {};

/////////////////////////////////////////////////////////////////////////////////////////
/// \name view, const_view
/// \brief Get an image view from an subchroma_image
/// \ingroup ImageModel
/// \brief Returns the non-constant-pixel view of an image
/////////////////////////////////////////////////////////////////////////////////////////
template< typename Pixel
        , typename Factors
        >
inline
const typename subchroma_image< Pixel, Factors >::view_t& view( subchroma_image< Pixel, Factors >& img )
{
    return img._view;
}

template< typename Pixel
        , typename Factors
        >
inline
const typename subchroma_image< Pixel, Factors >::const_view_t const_view( subchroma_image< Pixel, Factors >& img )
{
    return static_cast< const typename subchroma_image< Pixel, Factors >::const_view_t>( img._view );
}

/////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ImageViewSTLAlgorithmsFillPixels
/// \brief std::fill for subchroma_image views
/////////////////////////////////////////////////////////////////////////////////////////
template< typename Locator
        , typename Factors
        , typename Pixel
        >
void fill_pixels( const subchroma_image_view< Locator, Factors >& view
                , const Pixel&                                    value
                )
{
    using channel_t = typename subchroma_image
        <
            Pixel,
            Factors
        >::plane_view_t::value_type;

    fill_pixels( view.y_plane_view(), channel_t( at_c< 0 >( value )));
    fill_pixels( view.v_plane_view(), channel_t( at_c< 1 >( value )));
    fill_pixels( view.u_plane_view(), channel_t( at_c< 2 >( value )));
}

/////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ImageViewConstructors
/// \brief Creates a subchroma view from a raw memory
/////////////////////////////////////////////////////////////////////////////////////////
template< typename Pixel
        , typename Factors
        >
typename subchroma_image< Pixel
                        , Factors
                        >::view_t subchroma_view( std::size_t    y_width
                                                , std::size_t    y_height
                                                , unsigned char* y_base
                                                )
{
    using scaling_factors_t = detail::scaling_factors
        <
            mpl::at_c<Factors, 0>::type::value,
            mpl::at_c<Factors, 1>::type::value,
            mpl::at_c<Factors, 2>::type::value
        >;

    std::size_t y_channel_size = 1;
    std::size_t u_channel_size = 1;

    unsigned char* u_base = y_base + ( y_width  * y_height * y_channel_size );
    unsigned char* v_base = u_base + ( y_width  / scaling_factors_t::ss_X )
                                   * u_channel_size;

    using plane_view_t = typename subchroma_image<Pixel, Factors>::plane_view_t;

    plane_view_t y_plane = interleaved_view( y_width
                                           , y_height
                                           , (typename plane_view_t::value_type*) y_base // pixels
                                           , y_width                            // rowsize_in_bytes
                                           );

    plane_view_t v_plane = interleaved_view( y_width  / scaling_factors_t::ss_X
                                           , y_height / scaling_factors_t::ss_Y
                                           , (typename plane_view_t::value_type*) v_base // pixels
                                           , y_width                            // rowsize_in_bytes
                                           );

    plane_view_t u_plane = interleaved_view( y_width  / scaling_factors_t::ss_X
                                           , y_height / scaling_factors_t::ss_Y
                                           , (typename plane_view_t::value_type*) u_base // pixels
                                           , y_width                            // rowsize_in_bytes
                                           );

    using defer_fn_t = subchroma_image_deref_fn
        <
            typename subchroma_image<Pixel, Factors>::pixel_locator_t,
            Factors
        >;

    defer_fn_t deref_fn( y_plane.xy_at( 0, 0 )
                       , v_plane.xy_at( 0, 0 )
                       , u_plane.xy_at( 0, 0 )
                       );

    using locator_t = typename subchroma_image<Pixel, Factors>::locator_t;

    locator_t locator( point_t( 0, 0 ) // p
                     , point_t( 1, 1 ) // step
                     , deref_fn
                     );

    using view_t = typename subchroma_image<Pixel, Factors>::view_t;

    return view_t( point_t(                           y_width,                           y_height )
                 , point_t( y_width / scaling_factors_t::ss_X, y_height / scaling_factors_t::ss_Y )
                 , point_t( y_width / scaling_factors_t::ss_X, y_height / scaling_factors_t::ss_Y )
                 , locator
                 );
}

} // namespace gil
} // namespace boost

#endif


text:
package org.apache.storm.kafka.bolt;

import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseRichBolt;
import org.apache.storm.tuple.Tuple;
import org.apache.storm.utils.TupleUtils;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.apache.kafka.clients.producer.Callback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.storm.kafka.bolt.mapper.FieldNameBasedTupleToKafkaMapper;
import org.apache.storm.kafka.bolt.mapper.TupleToKafkaMapper;
import org.apache.storm.kafka.bolt.selector.DefaultTopicSelector;
import org.apache.storm.kafka.bolt.selector.KafkaTopicSelector;
import java.util.concurrent.Future;
import java.util.concurrent.ExecutionException;
import java.util.Map;
import java.util.Properties;

/**
 * Bolt implementation that can send Tuple data to Kafka
 *

 * It expects the producer configuration and topic in storm config under
 *

 * 'kafka.broker.properties' and 'topic'
 *

 * respectively.
 *

 * This bolt uses 0.8.2 Kafka Producer API.
 *

 * It works for sending tuples to older Kafka version (0.8.1).
 */
public class KafkaBolt<K, V> extends BaseRichBolt {

    private static final Logger LOG = LoggerFactory.getLogger(KafkaBolt.class);

    public static final String TOPIC = "topic";

    private KafkaProducer<K, V> producer;
    private OutputCollector collector;
    private TupleToKafkaMapper<K,V> mapper;
    private KafkaTopicSelector topicSelector;
    private Properties boltSpecfiedProperties = new Properties();
    /**
     * With default setting for fireAndForget and async, the callback is called when the sending succeeds.
     * By setting fireAndForget true, the send will not wait at all for kafka to ack.
     * "acks" setting in 0.8.2 Producer API config doesn't matter if fireAndForget is set.
     * By setting async false, synchronous sending is used.
     */
    private boolean fireAndForget = false;
    private boolean async = true;

    public KafkaBolt() {}

    public KafkaBolt<K,V> withTupleToKafkaMapper(TupleToKafkaMapper<K,V> mapper) {
        this.mapper = mapper;
        return this;
    }

    public KafkaBolt<K,V> withTopicSelector(KafkaTopicSelector selector) {
        this.topicSelector = selector;
        return this;
    }

    public KafkaBolt<K,V> withProducerProperties(Properties producerProperties) {
        this.boltSpecfiedProperties = producerProperties;
        return this;
    }

    @Override
    public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
        //for backward compatibility.
        if(mapper == null) {
            this.mapper = new FieldNameBasedTupleToKafkaMapper<K,V>();
        }

        //for backward compatibility.
        if(topicSelector == null) {
            this.topicSelector = new DefaultTopicSelector((String) stormConf.get(TOPIC));
        }

        producer = new KafkaProducer<>(boltSpecfiedProperties);
        this.collector = collector;
    }

    @Override
    public void execute(final Tuple input) {
        if (TupleUtils.isTick(input)) {
          collector.ack(input);
          return; // Do not try to send ticks to Kafka
        }
        K key = null;
        V message = null;
        String topic = null;
        try {
            key = mapper.getKeyFromTuple(input);
            message = mapper.getMessageFromTuple(input);
            topic = topicSelector.getTopic(input);
            if (topic != null ) {
                Callback callback = null;

                if (!fireAndForget && async) {
                    callback = new Callback() {
                        @Override
                        public void onCompletion(RecordMetadata ignored, Exception e) {
                            synchronized (collector) {
                                if (e != null) {
                                    collector.reportError(e);
                                    collector.fail(input);
                                } else {
                                    collector.ack(input);
                                }
                            }
                        }
                    };
                }
                Future<RecordMetadata> result = producer.send(new ProducerRecord<K, V>(topic, key, message), callback);
                if (!async) {
                    try {
                        result.get();
                        collector.ack(input);
                    } catch (ExecutionException err) {
                        collector.reportError(err);
                        collector.fail(input);
                    }
                } else if (fireAndForget) {
                    collector.ack(input);
                }
            } else {
                LOG.warn("skipping key = " + key + ", topic selector returned null.");
                collector.ack(input);
            }
        } catch (Exception ex) {
            collector.reportError(ex);
            collector.fail(input);
        }
    }

    @Override
    public void declareOutputFields(OutputFieldsDeclarer declarer) {

    }

    @Override
    public void cleanup() {
        producer.close();
    }

    public void setFireAndForget(boolean fireAndForget) {
        this.fireAndForget = fireAndForget;
    }

    public void setAsync(boolean async) {
        this.async = async;
    }
}


text:
namespace Microsoft.CSharp.RuntimeBinder.Semantics
{
    internal abstract class FileRecord
    {
    }
}


text:
package net.jkernelmachines.kernel.extra.bag;

import java.io.Serializable;
import java.util.List;

import net.jkernelmachines.kernel.Kernel;

/**
 * Default kernel on bags : sum all kernel values involving an element from B1 and an element from B2 between specified bounds.
 * @author dpicard
 *
 * @param <S> list type
 * @param <T> type of element in the bag
 */
public class ListKernel<S,T extends List<S>> extends Kernel<T> implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1591055803491554966L;

	private Kernel<S> kernel;
	private double eps = 10e-6;

	/**
	 * @param kernel minor kernel
	 */
	public ListKernel(Kernel<S> kernel) {
		this.kernel = kernel;
	}

	@Override
	public double valueOf(T t1, T t2) {
		double sum = 0;

		for(S s1 : t1)
		for(S s2 : t2)
		{
			double d = kernel.valueOf(s1, s2);
			if(d > eps)
				sum += d;
		}

		return sum/((double)(t1.size()*t2.size()));
	}

	@Override
	public double valueOf(T t1) {
		return valueOf(t1, t1);
	}

}


text:
@echo off

setlocal

pushd %~dp0\..\..\

:buildsln
set buildtool=eng\common\cibuild.cmd -preparemachine -configuration Release -projects dotnet-svcutil.sln /p:Test=false /p:Sign=false
echo %buildtool%
call %buildtool%

:End
popd
endlocal


text:
{% load dajaxice_templatetags %}

<title> NLTK Command Center </title>
{% dajaxice_js_import %}
<link href="{{ STATIC_URL }}css/menu.css" rel="stylesheet" type="text/css">

Word Goes Here

Word Count

Part of Speech

Definition

Synonyms

Show sentences

Exclude word

Select Corpus:
<select id="corpus_dropdown" onchange="corpus_selected()">
	{% for corpus in corpora %}
		<option value="{{corpus.id}}"> {{corpus.name}} </option>
	{% endfor %}
</select>
<select multiple id="document_dropdown">

</select>
<select id="ngram_dropdown">
	<option value="1">1-gram</option>
	<option value="2">2-gram</option>
	<option value="3">3-gram</option>
</select>
<select id="score_dropdown">
    <option value="student_t"> student_t </option>
    <option value="chi_sq"> chi_sq </option>
    <option value="pmi" selected> pmi </option>
    <option value="likelihood_ratio"> likelihood_ratio </option>
    <option value="poisson_stirling"> poisson_stirling </option>
    <option value="jaccard"> jaccard </option>
</select>
<input type="button" value="Generate Word Cloud" onclick="nltk_generate_wordcloud()">

<canvas id="canvas" width="800" height="600">
This text is displayed if your browser does not support HTML5 Canvas.
</canvas>

<input type="button" value="Redraw Word Cloud" onclick="redrawWordCloud()">
<form method="link" action="#" target="_blank">
<input type="submit" value="Redraw in new Window" onclick="localStorage['redraw'] = 1; saveData();">
</form>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="10dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="10dp"
            android:textSize="15sp"
            android:hint="Date"
            android:layout_weight="7"
            android:textStyle="bold"
            android:textColor="@color/black"
            android:id="@+id/date">
        </TextView>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="test"
            android:layout_weight="1"
            android:id="@+id/followerName"
            android:textStyle="bold"
            android:padding="10dp"
            android:textSize="20sp"
            android:textColor="@color/black"/>

    </LinearLayout>

    <ImageView
        android:layout_width = "95dp"
        android:layout_height= "95dp"
        android:layout_gravity="center_horizontal"
        android:id="@+id/moodIcon"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/message"
        android:paddingLeft="15dp"
        android:textStyle="bold"
        android:textColor="@color/black"
        />

</LinearLayout>