text:
<?php
/**
 * Contains the list of the deprecated functions
 * @since 4.2.3
 */

/**
 * Adds information about deprecated functions to plugin settings
 * during its call
 * @see    cptch_display_deprecated_filter()
 * @param  string   $func   The function name
 * @return void
 */
if ( ! function_exists( 'cptch_detect_deprecated' ) ) {
	function cptch_detect_deprecated( $func ) {
		global $cptch_options;

		if ( empty( $cptch_options ) )
			$cptch_options = get_option( 'cptch_options' );
		if ( empty( $cptch_options['deprecated_usage'] ) )
			$cptch_options['deprecated_usage'] = array();
		if ( ! in_array( $func, $cptch_options['deprecated_usage'] ) ) {
			$cptch_options['deprecated_usage'][] = $func;
			update_option( 'cptch_options', $cptch_options );
		}
	}
}

/**
 * Removes information about deprecated functions from plugin settings
 * after the click on the close cross in "deprecated function" message block
 * @see cptch_display_deprecated_function_message();
 */
if ( ! function_exists( 'cptch_remove_deprecated' ) ) {
	function cptch_remove_deprecated() {
		global $cptch_options;

		if ( empty( $cptch_options ) )
			$cptch_options = get_option( 'cptch_options' );

		if ( ! empty( $cptch_options['deprecated_usage'] ) ) {
			unset( $cptch_options['deprecated_usage'] );
			update_option( 'cptch_options', $cptch_options );
		}
	}
}

/**
 * Stores deprecated plugin options field to make an compatibility with old
 * Contact Form plugin versions and to prevent errors during the plugin actiovation
 * if the free plugin version is activated
 * @see    cptch_parse_options(), cptch_get_default_options()
 * @param  boolean  $get_keys_only
 * @return array
 */
if ( ! function_exists( 'cptch_get_not_removable_options' ) ) {
	function cptch_get_not_removable_options( $get_keys_only = true ) {
		$old_options = array(
			'cptch_label_form'         => '',
			'cptch_required_symbol'    => '*',
			'cptch_login_form'         => '1',
			'cptch_comments_form'      => '1',
			'cptch_register_form'      => '1',
			'cptch_lost_password_form' => '1',
			'cptch_contact_form'       => '0'
		);
		return $get_keys_only ? array_keys( $old_options ) : $old_options;
	}
}

if ( ! function_exists( 'cptch_display_deprecated_function_message' ) ) {
	function cptch_display_deprecated_function_message() {
		global $cptch_options, $cptch_plugin_info;

		if ( empty( $cptch_options ) )
			$cptch_options = is_network_admin() ? get_site_option( 'cptch_options' ) : get_option( 'cptch_options' );

		if ( empty( $cptch_options['deprecated_usage'] ) )
			return '';

		if( isset( $_GET['cptch_nonce'] ) &&  wp_verify_nonce( $_GET['cptch_nonce'], 'cptch_clean_deprecated' ) ) {
			cptch_remove_deprecated();
			return '';
		}

		$funcs = implode( ', ', $cptch_options['deprecated_usage'] );
		$link  = '' . __( 'instruction', 'captcha' ) . '.';
		$url = add_query_arg(
			array(
				'cptch_clean_deprecated' => '1',
				'cptch_nonce'            => wp_create_nonce( 'cptch_clean_deprecated' )
			),
			( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']
		);
		$close_link = "";
		$message = sprintf( __( "Functions from the %1s plugin are used on your site. These functions are deprecated ( %2s ) since version %4s. Please replace them according to the %3s. If you close this message it will appear in case if deprecated function would be called again only", 'captcha' ), $cptch_plugin_info['Name'], $funcs, $link, '4.2.3' );

		return
			"

{$message}
{$close_link}
";
	}
}

if ( ! function_exists( 'cptch_display_deprecated_filter' ) ) {
	function cptch_display_deprecated_filter() {
		if( ! has_filter( 'cptch_forms_list' ) )
			return false;
		$func = sprintf( __( 'some call functions for the "%s" filter hook', 'captcha' ), 'cptch_forms_list' );
		cptch_detect_deprecated( $func ); ?>

			<?php _e( 'Enable the CAPTCHA for', 'captcha' ); ?>

				<fieldset>
					<?php echo apply_filters( 'cptch_forms_list', '' ); ?>
				<fieldset>

	<?php }
} ?>


text:
<?xml version="1.0" encoding="UTF-8"?>
<actions>
        <action>
            <actionName>run</actionName>
            <goals>
                <goal>process-classes</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:1.2:exec</goal>
            </goals>
            <properties>
                <exec.args>-Djavax.net.ssl.trustStore=truststore.jks -Djavax.net.ssl.trustStorePassword=secret -classpath %classpath ${packageClassName} 127.0.0.1 30003</exec.args>
                <exec.executable>java</exec.executable>
                <exec.classpathScope>runtime</exec.classpathScope>
            </properties>
        </action>
        <action>
            <actionName>debug</actionName>
            <goals>
                <goal>process-classes</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:1.2:exec</goal>
            </goals>
            <properties>
                <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Djavax.net.ssl.trustStore=truststore.jks -Djavax.net.ssl.trustStorePassword=secret -classpath %classpath ${packageClassName} 127.0.0.1 30003</exec.args>
                <exec.executable>java</exec.executable>
                <exec.classpathScope>runtime</exec.classpathScope>
                <jpda.listen>true</jpda.listen>
            </properties>
        </action>
        <action>
            <actionName>profile</actionName>
            <goals>
                <goal>process-classes</goal>
                <goal>org.codehaus.mojo:exec-maven-plugin:1.2:exec</goal>
            </goals>
            <properties>
                <exec.args>${profiler.args} -Djavax.net.ssl.trustStore=truststore.jks -Djavax.net.ssl.trustStorePassword=secret -classpath %classpath ${packageClassName} 127.0.0.1 30003</exec.args>
                <exec.executable>${profiler.java}</exec.executable>
                <profiler.action>profile</profiler.action>
            </properties>
        </action>
    </actions>

redpajama_set_name: RedPajamaGithub


text:
package cubicchunks.server;

import com.google.common.base.Throwables;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.management.PlayerChunkMapEntry;
import net.minecraft.util.math.ChunkPos;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.world.ChunkWatchEvent;

import java.lang.invoke.MethodHandle;
import java.util.List;

import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;

import cubicchunks.CubicChunks;
import cubicchunks.network.PacketColumn;
import cubicchunks.network.PacketDispatcher;
import cubicchunks.network.PacketUnloadColumn;
import cubicchunks.server.chunkio.async.forge.AsyncWorldIOExecutor;
import cubicchunks.util.CubePos;
import cubicchunks.util.XZAddressable;
import cubicchunks.world.column.Column;
import mcp.MethodsReturnNonnullByDefault;

import static cubicchunks.util.ReflectionUtil.getFieldGetterHandle;
import static cubicchunks.util.ReflectionUtil.getFieldSetterHandle;

@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class ColumnWatcher extends PlayerChunkMapEntry implements XZAddressable {

	private PlayerCubeMap playerCubeMap;
	private static MethodHandle getPlayers = getFieldGetterHandle(PlayerChunkMapEntry.class, "field_187283_c");
	private static MethodHandle setLastUpdateInhabitedTime = getFieldSetterHandle(PlayerChunkMapEntry.class, "field_187289_i");
	private static MethodHandle setSentToPlayers = getFieldSetterHandle(PlayerChunkMapEntry.class, "field_187290_j");
	private static MethodHandle isLoading = getFieldGetterHandle(PlayerChunkMapEntry.class, "loading");//forge field, no srg name
	private static MethodHandle getLoadedRunnable = getFieldGetterHandle(PlayerChunkMapEntry.class, "loadedRunnable");//forge field, no srg name
	private final Runnable loadedRunnable;

	public ColumnWatcher(PlayerCubeMap playerCubeMap, ChunkPos pos) {
		super(playerCubeMap, pos.chunkXPos, pos.chunkZPos);
		this.playerCubeMap = playerCubeMap;
		try {
			this.loadedRunnable = (Runnable) getLoadedRunnable.invoke(this);
		} catch (Throwable throwable) {
			throw new RuntimeException(throwable);
		}
	}

	// CHECKED: 1.10.2-12.18.1.2092
	public void addPlayer(EntityPlayerMP player) {
		if (this.getPlayers().contains(player)) {
			CubicChunks.LOGGER.debug("Failed to add player. {} already is in chunk {}, {}", player,
				this.getPos().chunkXPos,
				this.getPos().chunkZPos);
			return;
		}
		if (this.getPlayers().isEmpty()) {
			this.setLastUpdateInhabitedTime(playerCubeMap.getWorldServer().getTotalWorldTime());
		}

		this.getPlayers().add(player);

		//always sent to players, no need to check it

		if (this.isSentToPlayers()) {
			//this.sendNearbySpecialEntities - done by cube entry
			MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.Watch(this.getPos(), player));
		}
	}

	// CHECKED: 1.10.2-12.18.1.2092//TODO: remove it, the only different line is sending packet
	public void removePlayer(EntityPlayerMP player) {
		if (!this.getPlayers().contains(player)) {
			return;
		}
		if (this.getColumn() == null) {
			this.getPlayers().remove(player);
			if (this.getPlayers().isEmpty()) {
				if (isLoading()) {
					AsyncWorldIOExecutor.dropQueuedColumnLoad(
						playerCubeMap.getWorld(), getPos().chunkXPos, getPos().chunkZPos, (c) -> loadedRunnable.run());
				}
				this.playerCubeMap.removeEntry(this);
			}
			return;
		}

		if (this.isSentToPlayers()) {
			PacketDispatcher.sendTo(new PacketUnloadColumn(getPos()), player);
		}

		this.getPlayers().remove(player);

		MinecraftForge.EVENT_BUS.post(new ChunkWatchEvent.UnWatch(this.getPos(), player));

		if (this.getPlayers().isEmpty()) {
			playerCubeMap.removeEntry(this);
		}
	}

	private List<EntityPlayerMP> getPlayers() {
		try {
			return (List<EntityPlayerMP>) getPlayers.invoke(this);
		} catch (Throwable throwable) {
			throw Throwables.propagate(throwable);
		}
	}

	private void setLastUpdateInhabitedTime(long time) {
		try {
			setLastUpdateInhabitedTime.invoke(this, time);
		} catch (Throwable throwable) {
			throw Throwables.propagate(throwable);
		}
	}

	//providePlayerChunk - ok

	// CHECKED: 1.10.2-12.18.1.2092
	@Override
	//actually sendToPlayers
	public boolean sentToPlayers() {
		if (getColumn() == null) {
			return false;
		}

		try {
			PacketColumn message = new PacketColumn(this.getColumn());
			for (EntityPlayerMP player : this.getPlayers()) {
				PacketDispatcher.sendTo(message, player);
				playerCubeMap.getWorldServer()
					.getEntityTracker()
					.sendLeashedEntitiesInChunk(player, this.getColumn());
			}
			this.setSentToPlayers.invoke(this, true);
		} catch (Throwable throwable) {
			throw new RuntimeException(throwable);
		}
		return true;
	}

	@Override
	@Deprecated
	public void sendNearbySpecialEntities(EntityPlayerMP player) {
		//done by cube watcher
	}

	//updateChunkInhabitedTime - ok

	@Override
	@Deprecated
	public void blockChanged(int x, int y, int z) {
		this.playerCubeMap.getCubeWatcher(CubePos.fromBlockCoords(x, y, z)).blockChanged(x, y, z);
	}

	@Override
	public void update() {
		//no-op, handles by cube entries
	}

	//containsPlayer, hasPlayerMatching, hasPlayerMatchingInRange, isAddedToChunkUpdateQueue, getChunk, getClosestPlayerDistance - ok

	@Nullable
	public Column getColumn() {
		return (Column) this.getChunk();
	}

	private boolean isLoading() {
		try {
			return (boolean) isLoading.invoke(this);
		} catch (Throwable throwable) {
			throw new RuntimeException(throwable);
		}
	}

	@Override public int getX() {
		return this.getPos().chunkXPos;
	}

	@Override public int getZ() {
		return this.getPos().chunkZPos;
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:foreground="@drawable/custom_selector"
    >
  <ImageView
      android:id="@+id/image_view"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:scaleType="fitXY"
      />
</RelativeLayout>


text:
namespace blink {

class SVGResourceDocumentContentTest : public SimTest {};

TEST_F(SVGResourceDocumentContentTest, GetDocumentBeforeLoadComplete) {
  SimRequest main_resource("https://example.com/test.html", "text/html");
  LoadURL("https://example.com/test.html");
  main_resource.Complete("");

  const char kSVGUrl[] = "https://example.com/svg.svg";
  SimSubresourceRequest svg_resource(kSVGUrl, "application/xml");

  // Request a resource from the cache.
  ExecutionContext* execution_context = GetDocument().GetExecutionContext();
  ResourceLoaderOptions options(execution_context->GetCurrentWorld());
  options.initiator_info.name = fetch_initiator_type_names::kCSS;
  FetchParameters params(ResourceRequest(kSVGUrl), options);
  auto* entry =
      SVGResourceDocumentContent::Fetch(params, GetDocument(), nullptr);

  // Write part of the response. The document should not be initialized yet,
  // because the response is not complete. The document would be invalid at this
  // point.
  svg_resource.Start();
  svg_resource.Write("<sv");
  EXPECT_EQ(nullptr, entry->GetDocument());

  // Finish the response, the Document should now be accessible.
  svg_resource.Complete("g></svg>");
  EXPECT_NE(nullptr, entry->GetDocument());
}

}  // namespace blink


text:
This document will walk you through getting your first device setup and running with Nitrogen.

You can use your computer to do this walkthrough. We are going to walk through getting a simple keyboard switch device up and connected to Nitrogen before getting started with actual hardware.

## Preliminaries

1. [Install node.js](http://nodejs.org) for your platform (if you haven't already).
2. Clone the keyboard switch device project into your development directory on your machine:
`git clone http://github.com/nitrogenjs/switch switch`

Nitrogen automatically provisions devices with the security credentials they need to connect to the service on their first connection.

We're going to use the Nitrogen cloud service instance at api.nitrogen.io by defaul in this walkthrough.  You can modify this in config.js if you'd rather use a local instance.

Let's start the device to do that.  Open a shell, change directory into the `switch` project and:
`node switch.js`

This should print out something that looks something like this:
```
warning: couldn't find current store, creating new one.
This principal (523b37c6d2f87e14040013e1) can be claimed using code: POFX-5039
switch is now off.
```

The warning is expected. You didn't previously have a local store for this device so it created one for you. The Nitrogen client stores credential and principal information in its local store so that it has them for authenticating with a Nitrogen service.

It also printed a claim code for your device. Claim codes enable you to associate a device with your user account on a Nitrogen service so you can control it. Let's do that now.

Navigate to https://admin.nitrogen.io. You'll be asked to login to the service. Select 'Create Account' and enter your email, a password, and your full name and 'Create Account' again to create your account.

This will take you to the principals visible to your account. In Nitrogen, a principal is anything that authenticates and has a level of authorization with the service. This includes your user account, your devices, and even the service itself.

Nitrogen automatically attempts to match devices to users if there is only one user originating from the same IP address as the device. If it can't make this determination, you can use your claim code to match the device. Copy it from your shell and enter it into the 'Claim code for device' and claim the device.

The device should now appear in your list of principals. Click on it's id which will take you to its details page. Edit it's name to 'Keyboard Switch' and press save.

Focus the shell that you are running the device in and press any key. This will toggle the switch by sending a switchState message from the device to the service. If you flip back to the Nitrogen admin browser tab you had open for your switch principal you can see this because the message will have been displayed. Most of the Nitrogen admin application is real time so you can use it to watch what is happening with your devices and applications.

You've connected your first device. The switch example represents a simple example of a device that relays its current state to the service.


text:
import AlGDock.BindingPMF_plots
import os, shutil, glob

self = AlGDock.BindingPMF_plots.BPMF_plots(\
  dir_dock='dock', dir_cool='cool',\
  ligand_tarball='prmtopcrd/ligand.tar.gz', \
  ligand_database='ligand.db', \
  forcefield='prmtopcrd/gaff.dat', \
  ligand_prmtop='ligand.prmtop', \
  ligand_inpcrd='ligand.trans.inpcrd', \
  receptor_tarball='prmtopcrd/receptor.tar.gz', \
  receptor_prmtop='receptor.prmtop', \
  receptor_inpcrd='receptor.trans.inpcrd', \
  receptor_fixed_atoms='receptor.pdb', \
  complex_tarball='prmtopcrd/complex.tar.gz', \
  complex_prmtop='complex.prmtop', \
  complex_inpcrd='complex.trans.inpcrd', \
  complex_fixed_atoms='complex.pdb', \
  score = 'prmtopcrd/anchor_and_grow_scored.mol2', \
  dir_grid='grids', \
  protocol='Adaptive', cool_therm_speed=1.5, dock_therm_speed=1.5,\
  sampler='NUTS', \
  MCMC_moves=1, \
  seeds_per_state=10, steps_per_seed=200,
  sweeps_per_cycle=10, attempts_per_sweep=100, steps_per_sweep=50,
  cool_repX_cycles=2, dock_repX_cycles=3, \
  site='Sphere', site_center=[1.91650, 1.91650, 1.91650], site_max_R=0.01, \
  site_density=10., \
  phases=['NAMD_Gas','NAMD_GBSA'], \
  cores=-1, \
  rmsd=True)

lambda_n = self._lambda(1.0)
self._set_universe_evaluator(lambda_n)
from NUTS import NUTSIntegrator
sampler = NUTSIntegrator(self.universe)
sampler(steps=500,T=300,delta_t=0.0015)


text:
describe("Complex Numbers Library", function() {

  it("should return a string expression", function() {
    var numx = new Complex(3, 4);
    expect(numx.toString()).toEqual("3+4i");
  });

  it("should return an object ", function() {
    var numx = new Complex('3+4i');
    expect(numx).toEqual({r: 3, i: 4});
  });

  it("should find the Magnitude check pythogras", function() {
    var numx = new Complex(4, 5);
    expect(numx.abs()).toEqual(Math.sqrt(41));
    expect(new Complex(2, 4).abs()).toEqual(Math.sqrt(20));
    expect(new Complex('2+4i').abs()).toEqual(Math.sqrt(20));
  });
  //check addition
  it("should find addition of two complex numbers ", function() {
    var numx = new Complex('3+i').add('2+2i');
    expect(numx.toString()).toEqual('5+3i');
  });

  it("should find subtraction of two complex numbers ", function() {
    var numx = new Complex('3+i').subtract('2+2i');
    expect(numx.toString()).toEqual('1-i');
  });
  // check multiplication for both numeric and string value
  it("should find product of two complex numbers ", function() {
    var numx = new Complex('2-3i').multiply('1+i');
    expect(numx.toString()).toEqual('5-i');

    numx = new Complex(2, -3).multiply(1, 1);
    expect(numx.toString()).toEqual('5-i');
  });

  it("Should find Square of a complex number", function() {
    var numx = new Complex('3-i').pow(2);
    expect(numx.toString()).toEqual('8-6i');
     numx = new Complex('3-i').pow(3);
     numx = new Complex('3-i').pow('18-26i');

  });

  it('should return the conjugate', function() {
    expect(new Complex(1, 3).conjugate().toString()).toEqual('1-3i');

  });

  it('should z^w, where z and w are complex', function() {
    var n = new Complex('2').pow(2).toString();
    expect(n).toEqual('4');
  });

})


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Xml;
using Tridion.ContentManager.Templating.Debugging;
using TcmDebugger.Extensions;
using TcmDebugger.Misc;
using System.Reflection;
using System.Xml.Linq;
using TcmDebugger.Service;

namespace TcmDebugger.Engines
{
	/// <summary>
	/// <see cref="DebugEngineServer" /> is a hosting process for the Tridion templating debug session as a server
	/// </summary>
    public class DebugEngineServer : Engine
    {
		private static readonly XNamespace templateDebuggingNamespace = "http://www.tridion.com/ContentManager/5.3/TemplateDebugging";

		private String mSessionId;
		private DebugSession mDebugSession;

		private static String StripXmlDeclaration(String xml)
		{
			if (!String.IsNullOrEmpty(xml) && xml.StartsWith("<?xml", StringComparison.OrdinalIgnoreCase))
				return xml.Substring(xml.IndexOf("?>", StringComparison.OrdinalIgnoreCase) + 2);

			return xml;
		}

		private static void WriteLog(String logMessages)
		{
			XElement logXml = XElement.Parse(logMessages);

			foreach (XElement logEntry in logXml.Descendants(templateDebuggingNamespace + "log"))
			{
				System.Diagnostics.TraceEventType logType;
				Enum.TryParse<System.Diagnostics.TraceEventType>(logEntry.Attribute("type").Value, true, out logType);

				Logger.Log(logType, logEntry.Value);
			}
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="DebugEngineServer"/> class.
		/// </summary>
		/// <param name="sessionId">Debug session identifier.</param>
		public DebugEngineServer(String sessionId): base()
		{
			mSessionId = sessionId;
		}

		public DebuggingStatusResult StartDebuggingWithItemUri(String compoundTemplateId, String compoundTemplateXml, String itemId, bool includeSystemLog, System.Diagnostics.TraceEventType logLevel)
		{
			try
			{
				mDebugSession = new DebugSession(mSessionId,
					compoundTemplateId,
					compoundTemplateXml,
					itemId,
					null,
					true,
					"tcm:0-0-0",
					DebuggerConfig.Instance.Templating.EnableImpersonation && !String.IsNullOrEmpty(DebuggerConfig.Instance.Templating.ImpersonationIdentity) ?
						DebuggerConfig.Instance.Templating.ImpersonationIdentity : WindowsIdentity.GetCurrent().Name,
					includeSystemLog,
					logLevel);

				// Signal for any debuggers
				DebuggerHook();

				mDebugSession.SetPreviewLocations(
					DebuggerConfig.Instance.CMS.PreviewDirectory,
					PreviewServer.PreviewUrl);

				mDebugSession.Start();

			}
			catch (Exception ex)
			{
				Logger.Log(System.Diagnostics.TraceEventType.Error, LoggerExtensions.TraceException(ex));
			}

			String logMessages = mDebugSession.GetLogMessagesXml(-1, -1, -1);
			WriteLog(logMessages);

			return new DebuggingStatusResult()
			{
				SessionId = mSessionId,
				IsRunning = mDebugSession.IsRunning(),
				ExecutionStatus = StripXmlDeclaration(mDebugSession.GetExecutionStatusXml()),
				Log = StripXmlDeclaration(logMessages),
				Error = mDebugSession.GetLastException()
			};
		}

		public DebuggingStatusResult StartDebuggingWithPackage(String compoundTemplateId, String compoundTemplateXml, String packageXml, bool includeSystemLog, System.Diagnostics.TraceEventType logLevel)
		{
			try
			{
				mDebugSession = new DebugSession(mSessionId,
					compoundTemplateId,
					compoundTemplateXml,
					null,
					packageXml,
					true,
					"tcm:0-0-0",
					DebuggerConfig.Instance.Templating.EnableImpersonation && !String.IsNullOrEmpty(DebuggerConfig.Instance.Templating.ImpersonationIdentity) ?
						DebuggerConfig.Instance.Templating.ImpersonationIdentity : WindowsIdentity.GetCurrent().Name,
					DebuggerConfig.Instance.Logging.IncludeTridionClasses,
					logLevel);

				// Signal for any debuggers
				DebuggerHook();

				mDebugSession.SetPreviewLocations(
					DebuggerConfig.Instance.CMS.PreviewDirectory,
					PreviewServer.PreviewUrl);

				mDebugSession.Start();
			}
			catch (Exception ex)
			{
				Logger.Log(System.Diagnostics.TraceEventType.Error, LoggerExtensions.TraceException(ex));
			}

			String logMessages = mDebugSession.GetLogMessagesXml(-1, -1, -1);
			WriteLog(logMessages);

			return new DebuggingStatusResult()
			{
				SessionId = mSessionId,
				IsRunning = mDebugSession.IsRunning(),
				ExecutionStatus = StripXmlDeclaration(mDebugSession.GetExecutionStatusXml()),
				Log = StripXmlDeclaration(logMessages),
				Error = mDebugSession.GetLastException()
			};
		}

		public DebuggingStatusResult GetDebuggingState(String debuggerSessionId, String lastLogMessageId)
		{
			int logId = -1;

			if (!int.TryParse(lastLogMessageId, out logId))
				logId = -1;

			if (logId != -1)
				logId++;

			String logMessages = mDebugSession.GetLogMessagesXml(-1, logId, -1);
			WriteLog(logMessages);

			return new DebuggingStatusResult()
			{
				SessionId = mSessionId,
				IsRunning = mDebugSession.IsRunning(),
				ExecutionStatus = StripXmlDeclaration(mDebugSession.GetExecutionStatusXml()),
				Log = StripXmlDeclaration(logMessages),
				Error = mDebugSession.GetLastException()
			};
		}

		public DebuggingStatusResult StopDebugging(String debuggerSessionId, String lastLogMessage)
		{
			try
			{
				if (mDebugSession.IsRunning())
					mDebugSession.Stop();
			}
			catch (Exception ex)
			{
				Logger.Log(System.Diagnostics.TraceEventType.Error, LoggerExtensions.TraceException(ex));
			}

			int logId = -1;

			if (!int.TryParse(lastLogMessage, out logId))
				logId = -1;

			if (logId != -1)
				logId++;

			String logMessages = mDebugSession.GetLogMessagesXml(-1, logId, -1);
			WriteLog(logMessages);

			return new DebuggingStatusResult()
			{
				SessionId = mSessionId,
				IsRunning = mDebugSession.IsRunning(),
				ExecutionStatus = StripXmlDeclaration(mDebugSession.GetExecutionStatusXml()),
				Log = StripXmlDeclaration(logMessages),
				Error = mDebugSession.GetLastException()
			};
	    }

		public void ResetDebugging(String debuggerSessionId)
		{
			//mDebugSession.
		}

		public PackageResponse GetPackage(String debuggerSessionId, String packageId)
		{
			try
			{
				return new PackageResponse()
				{
					Response = mDebugSession.GetPackageXml(packageId)
				};
			}
			catch (Exception ex)
			{
				Logger.Log(System.Diagnostics.TraceEventType.Error, ex.Message);
			}

			return null;
		}

		public PackageResponse GetPackageItem(String debuggerSessionId, String packageItemId)
		{
			try
			{
				return new PackageResponse()
				{
					Response = mDebugSession.GetPackageItemXml(packageItemId)
				};
			}
			catch (Exception ex)
			{
				Logger.Log(System.Diagnostics.TraceEventType.Error, ex.Message);
			}

			return null;
		}
    }
}


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

                «

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans30.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">DATED this 7th day of November 2013
SURFACF nwmpns:
«2%
Trustee

2
£
Address: 2012 17th Court West 3 9
3
Williston, N D 58801
Phone: 701-774-2826

STATE OF Norm Dakota } ACKNOWLfiDGMENT IND'IVID UAL } ss.  COUNTY OF Williams } 5 BE IT REMEMBERED, That on this 7th day om, leis before me, a Notary Public,
in and for said County and State, personally applwl'ed'Josc hine Stan'gcland Irritvocable Trust, Pnul Sinamol. Trustee .m me known to be [ha Taenlical ncrson described In

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

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans17.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">STATE OF

1 ACKNOWLEDéMENT CORPORATION COUNTY or ) '
Before me the undersigned, a Notary Public, in and for said County and State, on éhis day of , 2013, personally appeared O, to me'knowgn to be the identical person who
____..__...____..._..— subscribed the name of the maker lhercof to the foregoing inslrument us its E and acknowledged to me that executed the same as free and voiuntarygact and deed and as the free and
voluntary act and deed of such corporation, for the uses ana purposes therein set forth. Given under my hand and seal o€o£fice lhc day and year last above written? I»

i ;

My commission expires:

Notary Public
NOTARY STAMP

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

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

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans40.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">and whouxgcuted the within andforcgoing instrument and ac knéwledged to 1:11e that [am executed the same as his free and voluntary act and deed for the uses and pug-poses lhelécin set forth. IN WITNESS WI-IEREOF, I have hereunto set my'officiul signaturgand afiixcd my notan'a] seal,
the day and year first above written.
My commission expires: April9,2019 ' NOTARY STAMP

sums {mm wcommssslan Btpinag m1 9, 2019

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
{-# LANGUAGE ForeignFunctionInterface, TemplateHaskell #-}

module Export where
import Foreign.HaPy
import ExampleModule

initHaPy

pythonExport 'foo
pythonExport 'bar
pythonExport 'baz

pythonExport 'arr_arg
pythonExport 'arr_ret
pythonExport 'arr_complex

pythonExport 'string_fun
pythonExport 'char_test


text:
namespace mx
{
    namespace core
    {
        PartAbbreviation::PartAbbreviation()
        :myValue()
        ,myAttributes( std::make_shared<PartAbbreviationAttributes>() )
        {}

        PartAbbreviation::PartAbbreviation( const XsString& value )
        :myValue( value )
        ,myAttributes( std::make_shared<PartAbbreviationAttributes>() )
        {}

        bool PartAbbreviation::hasAttributes() const
        {
            return myAttributes->hasValues();
        }

        bool PartAbbreviation::hasContents() const
        {
            return true;
        }

        std::ostream& PartAbbreviation::streamAttributes( std::ostream& os ) const
        {
            if ( myAttributes )
            {
                myAttributes->toStream( os );
            }
            return os;
        }

        std::ostream& PartAbbreviation::streamName( std::ostream& os ) const
        {
            os << "part-abbreviation";
            return os;
        }

        std::ostream& PartAbbreviation::streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly  ) const
        {
            MX_UNUSED( indentLevel );
            isOneLineOnly = true;
            os << myValue;
            return os;
        }

        PartAbbreviationAttributesPtr PartAbbreviation::getAttributes() const
        {
            return myAttributes;
        }

        void PartAbbreviation::setAttributes( const PartAbbreviationAttributesPtr& value )
        {
            if ( value )
            {
                myAttributes = value;
            }
        }

        XsString PartAbbreviation::getValue() const
        {
            return myValue;
        }

        void PartAbbreviation::setValue( const XsString& value )
        {
            myValue = value;
        }

        bool PartAbbreviation::fromXElementImpl( std::ostream& message, ::ezxml::XElement& xelement )
        {
            bool isSuccess = true;
            isSuccess &= myAttributes->fromXElement( message, xelement );
            myValue.setValue( xelement.getValue() );
            return isSuccess;
        }

    }
}


text:
package com.facebook.imagepipeline.core;

import android.os.Process;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * ThreadFactory that applies a priority to the threads it creates.
 */
public class PriorityThreadFactory implements ThreadFactory {

  private final int mThreadPriority;
  private final String mPrefix;
  private final boolean mAddThreadNumber;

  private final AtomicInteger mThreadNumber = new AtomicInteger(1);

  /**
   * Creates a new PriorityThreadFactory with a given priority.
   *
   * <p>This value should be set to a value compatible with
   * {@link android.os.Process#setThreadPriority}, not {@link Thread#setPriority}.
   *
   */
  public PriorityThreadFactory(int threadPriority) {
    this(threadPriority, "PriorityThreadFactory", true);
  }

  public PriorityThreadFactory(int threadPriority, String prefix, boolean addThreadNumber) {
    mThreadPriority = threadPriority;
    this.mPrefix = prefix;
    this.mAddThreadNumber = addThreadNumber;
  }

  @Override
  public Thread newThread(final Runnable runnable) {
    Runnable wrapperRunnable = new Runnable() {
      @Override
      public void run() {
        try {
          Process.setThreadPriority(mThreadPriority);
        } catch (Throwable t) {
          // just to be safe
        }
        runnable.run();
      }
    };
    final String name;
    if (mAddThreadNumber) {
      name = mPrefix + "-" + mThreadNumber.getAndIncrement();
    } else {
      name = mPrefix;
    }
    return new Thread(wrapperRunnable, name);
  }

}


text:
<?php
class Active extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->load->model('PackingSlips_model');
	}

	public function index()
	{
		$this->load->library('pagination');

		$config['base_url'] = site_url('active/index');
		$config['total_rows'] = $this->PackingSlips_model->record_count();
		$config['per_page'] = 10;
		$config['uri_segment'] = 3;
		$choice = $config['total_rows'] / $config['per_page'];
		$config['num_links'] = floor($choice);

		$config['full_tag_open'] = '
';
		$config['full_tag_close'] = '
';
		$config['first_link'] = false;
		$config['last_link'] = false;
		$config['first_tag_open'] = '
';
		$config['first_tag_close'] = '
';
		$config['prev_link'] = '&laquo';
		$config['prev_tag_open'] = '
';
		$config['prev_tag_close'] = '
';
		$config['next_link'] = '&raquo';
		$config['next_tag_open'] = '
';
		$config['next_tag_close'] = '
';
		$config['cur_tag_open'] = '
';
		$config['cur_tag_close'] = '
';
		$config['num_tag_open'] = '
';
		$config['num_tag_close'] = '
';

		$this->pagination->initialize($config);

		$data['slips'] = $this->PackingSlips_model->get_slips(0, $config['per_page'], $this->uri->segment(3), true);

		$data['pagination'] = $this->pagination->create_links();
		$data['title'] = 'Active Packing Slips';

		$this->load->view('templates/header', $data);
		$this->load->view('active/index.php', $data);
		$this->load->view('templates/footer');
	}
}


text:
// Copyright 2007-2011 Chris Patterson, Dru Sellers, Travis Smith, et. al.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use
// this file except in compliance with the License. You may obtain a copy of the
// License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
namespace MassTransit.Tests.Services.HealthMonitoring
{
    using System;
    using System.Linq;
    using System.Threading;
    using Magnum.Extensions;
    using Magnum.TestFramework;
    using MassTransit.Pipeline.Inspectors;
    using MassTransit.Saga;
    using MassTransit.Services.HealthMonitoring;
    using MassTransit.Services.HealthMonitoring.Messages;
    using MassTransit.Services.HealthMonitoring.Server;
    using MassTransit.Services.Subscriptions.Server;
    using MassTransit.Services.Timeout;
    using MassTransit.Services.Timeout.Server;
    using MassTransit.Transports.Loopback;
    using NUnit.Framework;
    using TestFramework;
    using TestFramework.Fixtures;

    [TestFixture]
    public class When_using_health_monitoring
        : EndpointTestFixture<LoopbackTransportFactory>
    {
        IServiceBus _serviceBus;
        IServiceBus _subscriptionBus;
        IServiceBus _healthBus;
        IServiceBus _timeoutBus;

        TimeoutService _timeoutService;
        HealthService _healthService;
        SubscriptionService _subscriptionService;
        InMemorySagaRepository<HealthSaga> _healthSagas;

        [SetUp]
        void Configure()
        {
            var subscriptionServiceUri = new Uri("loopback://localhost/mt_subscriptions");
            var healthUri = new Uri("loopback://localhost/mt_health");
            var timeoutUri = new Uri("loopback://localhost/mt_timeout");
            var localUri = new Uri("loopback://localhost/local");

            _subscriptionBus = SetupServiceBus(subscriptionServiceUri,
                configurator => configurator.SetConcurrentConsumerLimit(1));

            var subscriptionSagas = new InMemorySagaRepository<SubscriptionSaga>();
            var subscriptionClientSagas = new InMemorySagaRepository<SubscriptionClientSaga>();
            _subscriptionService = new SubscriptionService(_subscriptionBus,subscriptionSagas,subscriptionClientSagas);

            _subscriptionService.Start();

            _timeoutBus = SetupServiceBus(timeoutUri,
                configurator =>
                {
                    configurator.UseControlBus();
                    configurator.UseSubscriptionService(subscriptionServiceUri);
                });

            _timeoutService = new TimeoutService(_timeoutBus, new InMemorySagaRepository<TimeoutSaga>());
            _timeoutService.Start();

            Thread.Sleep(500);

            _healthBus = SetupServiceBus(healthUri,
                configurator =>
                    {
                        configurator.UseControlBus();
                        configurator.UseSubscriptionService(subscriptionServiceUri);
                    });

            _healthSagas = new InMemorySagaRepository<HealthSaga>();
            _healthService = new HealthService(_healthBus, _healthSagas);
            _healthService.Start();

            Thread.Sleep(500);

            _serviceBus = SetupServiceBus(localUri, configurator =>
                {
                    configurator.UseControlBus();
                    configurator.UseHealthMonitoring(1);
                    configurator.UseSubscriptionService(subscriptionServiceUri);
                });

            Thread.Sleep(500);
        }

        [TearDown]
        protected void Cleanup()
        {
            _healthService.Stop();
            _timeoutService.Stop();
            _subscriptionService.Stop();

            _serviceBus.Dispose();
            _healthBus.Dispose();
            _timeoutBus.Dispose();
            _subscriptionBus.Dispose();
        }

        [Test]
        public void Heartbeat_subscriptions_should_be_kept_on_the_control_bus()
        {
            Console.WriteLine("data bus");
            PipelineViewer.Trace(_serviceBus.OutboundPipeline);

            Console.WriteLine("control bus");
            PipelineViewer.Trace(_serviceBus.ControlBus.OutboundPipeline);

            _serviceBus.ControlBus.ShouldHaveRemoteSubscriptionFor<Heartbeat>();
        }

        [Test]
        public void Heartbeat_signals_should_be_received_by_the_health_monitor()
        {
            // give the health client some time to send a couple of heartbeats
            Thread.Sleep(2.Seconds());

            var s = _healthSagas.Where(filter => true).FirstOrDefault();

            s.ShouldNotBeNull();
            s.ShouldBeInState(HealthSaga.Healthy);
        }
    }
}


text:
layout: post
title: "Daily Bite #23"
tags:
    - learn
    - life
    - hack
    - development

category: dailybite
page_type: long
published: true
---

- [NIST's new password rules](https://nakedsecurity.sophos.com/2016/08/18/nists-new-password-rules-what-you-need-to-know/) -- an old read, but one of the fine rule how to create password guide for your users.

- [Just HODL!](https://coinsutra.com/hodl-popular-cryptocurrency-terms/) -- couple new lingo from crytocurrencies market, and how the users using it in the chat or forums, some of it hillarious (i have private group to discuss crypto market).

- [Open Railway Map](http://www.openrailwaymap.org/) -- a crowdsourcing data for railway all over the world.


text:
/**
 * @module ol/geom/flat/simplify
 */
// Based on simplify-js https://github.com/mourner/simplify-js
// Copyright (c) 2012, Vladimir Agafonkin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//    1. Redistributions of source code must retain the above copyright notice,
//       this list of conditions and the following disclaimer.
//
//    2. Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

import {squaredSegmentDistance, squaredDistance} from '../../math.js';
const _ol_geom_flat_simplify_ = {};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {number} end End.
 * @param {number} stride Stride.
 * @param {number} squaredTolerance Squared tolerance.
 * @param {boolean} highQuality Highest quality.
 * @param {Array.<number>=} opt_simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @return {Array.<number>} Simplified line string.
 */
_ol_geom_flat_simplify_.lineString = function(flatCoordinates, offset, end,
  stride, squaredTolerance, highQuality, opt_simplifiedFlatCoordinates) {
  const simplifiedFlatCoordinates = opt_simplifiedFlatCoordinates !== undefined ?
    opt_simplifiedFlatCoordinates : [];
  if (!highQuality) {
    end = _ol_geom_flat_simplify_.radialDistance(flatCoordinates, offset, end,
      stride, squaredTolerance,
      simplifiedFlatCoordinates, 0);
    flatCoordinates = simplifiedFlatCoordinates;
    offset = 0;
    stride = 2;
  }
  simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.douglasPeucker(
    flatCoordinates, offset, end, stride, squaredTolerance,
    simplifiedFlatCoordinates, 0);
  return simplifiedFlatCoordinates;
};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {number} end End.
 * @param {number} stride Stride.
 * @param {number} squaredTolerance Squared tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.douglasPeucker = function(flatCoordinates, offset, end,
  stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {
  const n = (end - offset) / stride;
  if (n < 3) {
    for (; offset < end; offset += stride) {
      simplifiedFlatCoordinates[simplifiedOffset++] =
          flatCoordinates[offset];
      simplifiedFlatCoordinates[simplifiedOffset++] =
          flatCoordinates[offset + 1];
    }
    return simplifiedOffset;
  }
  /** @type {Array.<number>} */
  const markers = new Array(n);
  markers[0] = 1;
  markers[n - 1] = 1;
  /** @type {Array.<number>} */
  const stack = [offset, end - stride];
  let index = 0;
  while (stack.length > 0) {
    const last = stack.pop();
    const first = stack.pop();
    let maxSquaredDistance = 0;
    const x1 = flatCoordinates[first];
    const y1 = flatCoordinates[first + 1];
    const x2 = flatCoordinates[last];
    const y2 = flatCoordinates[last + 1];
    for (let i = first + stride; i < last; i += stride) {
      const x = flatCoordinates[i];
      const y = flatCoordinates[i + 1];
      const squaredDistance = squaredSegmentDistance(
        x, y, x1, y1, x2, y2);
      if (squaredDistance > maxSquaredDistance) {
        index = i;
        maxSquaredDistance = squaredDistance;
      }
    }
    if (maxSquaredDistance > squaredTolerance) {
      markers[(index - offset) / stride] = 1;
      if (first + stride < index) {
        stack.push(first, index);
      }
      if (index + stride < last) {
        stack.push(index, last);
      }
    }
  }
  for (let i = 0; i < n; ++i) {
    if (markers[i]) {
      simplifiedFlatCoordinates[simplifiedOffset++] =
          flatCoordinates[offset + i * stride];
      simplifiedFlatCoordinates[simplifiedOffset++] =
          flatCoordinates[offset + i * stride + 1];
    }
  }
  return simplifiedOffset;
};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {Array.<number>} ends Ends.
 * @param {number} stride Stride.
 * @param {number} squaredTolerance Squared tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @param {Array.<number>} simplifiedEnds Simplified ends.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.douglasPeuckers = function(flatCoordinates, offset,
  ends, stride, squaredTolerance, simplifiedFlatCoordinates,
  simplifiedOffset, simplifiedEnds) {
  for (let i = 0, ii = ends.length; i < ii; ++i) {
    const end = ends[i];
    simplifiedOffset = _ol_geom_flat_simplify_.douglasPeucker(
      flatCoordinates, offset, end, stride, squaredTolerance,
      simplifiedFlatCoordinates, simplifiedOffset);
    simplifiedEnds.push(simplifiedOffset);
    offset = end;
  }
  return simplifiedOffset;
};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {Array.<Array.<number>>} endss Endss.
 * @param {number} stride Stride.
 * @param {number} squaredTolerance Squared tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @param {Array.<Array.<number>>} simplifiedEndss Simplified endss.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.douglasPeuckerss = function(
  flatCoordinates, offset, endss, stride, squaredTolerance,
  simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {
  for (let i = 0, ii = endss.length; i < ii; ++i) {
    const ends = endss[i];
    const simplifiedEnds = [];
    simplifiedOffset = _ol_geom_flat_simplify_.douglasPeuckers(
      flatCoordinates, offset, ends, stride, squaredTolerance,
      simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);
    simplifiedEndss.push(simplifiedEnds);
    offset = ends[ends.length - 1];
  }
  return simplifiedOffset;
};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {number} end End.
 * @param {number} stride Stride.
 * @param {number} squaredTolerance Squared tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.radialDistance = function(flatCoordinates, offset, end,
  stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {
  if (end <= offset + stride) {
    // zero or one point, no simplification possible, so copy and return
    for (; offset < end; offset += stride) {
      simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];
      simplifiedFlatCoordinates[simplifiedOffset++] =
          flatCoordinates[offset + 1];
    }
    return simplifiedOffset;
  }
  let x1 = flatCoordinates[offset];
  let y1 = flatCoordinates[offset + 1];
  // copy first point
  simplifiedFlatCoordinates[simplifiedOffset++] = x1;
  simplifiedFlatCoordinates[simplifiedOffset++] = y1;
  let x2 = x1;
  let y2 = y1;
  for (offset += stride; offset < end; offset += stride) {
    x2 = flatCoordinates[offset];
    y2 = flatCoordinates[offset + 1];
    if (squaredDistance(x1, y1, x2, y2) > squaredTolerance) {
      // copy point at offset
      simplifiedFlatCoordinates[simplifiedOffset++] = x2;
      simplifiedFlatCoordinates[simplifiedOffset++] = y2;
      x1 = x2;
      y1 = y2;
    }
  }
  if (x2 != x1 || y2 != y1) {
    // copy last point
    simplifiedFlatCoordinates[simplifiedOffset++] = x2;
    simplifiedFlatCoordinates[simplifiedOffset++] = y2;
  }
  return simplifiedOffset;
};

/**
 * @param {number} value Value.
 * @param {number} tolerance Tolerance.
 * @return {number} Rounded value.
 */
_ol_geom_flat_simplify_.snap = function(value, tolerance) {
  return tolerance * Math.round(value / tolerance);
};

/**
 * Simplifies a line string using an algorithm designed by Tim Schaub.
 * Coordinates are snapped to the nearest value in a virtual grid and
 * consecutive duplicate coordinates are discarded.  This effectively preserves
 * topology as the simplification of any subsection of a line string is
 * independent of the rest of the line string.  This means that, for examples,
 * the common edge between two polygons will be simplified to the same line
 * string independently in both polygons.  This implementation uses a single
 * pass over the coordinates and eliminates intermediate collinear points.
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {number} end End.
 * @param {number} stride Stride.
 * @param {number} tolerance Tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.quantize = function(flatCoordinates, offset, end, stride,
  tolerance, simplifiedFlatCoordinates, simplifiedOffset) {
  // do nothing if the line is empty
  if (offset == end) {
    return simplifiedOffset;
  }
  // snap the first coordinate (P1)
  let x1 = _ol_geom_flat_simplify_.snap(flatCoordinates[offset], tolerance);
  let y1 = _ol_geom_flat_simplify_.snap(flatCoordinates[offset + 1], tolerance);
  offset += stride;
  // add the first coordinate to the output
  simplifiedFlatCoordinates[simplifiedOffset++] = x1;
  simplifiedFlatCoordinates[simplifiedOffset++] = y1;
  // find the next coordinate that does not snap to the same value as the first
  // coordinate (P2)
  let x2, y2;
  do {
    x2 = _ol_geom_flat_simplify_.snap(flatCoordinates[offset], tolerance);
    y2 = _ol_geom_flat_simplify_.snap(flatCoordinates[offset + 1], tolerance);
    offset += stride;
    if (offset == end) {
      // all coordinates snap to the same value, the line collapses to a point
      // push the last snapped value anyway to ensure that the output contains
      // at least two points
      // FIXME should we really return at least two points anyway?
      simplifiedFlatCoordinates[simplifiedOffset++] = x2;
      simplifiedFlatCoordinates[simplifiedOffset++] = y2;
      return simplifiedOffset;
    }
  } while (x2 == x1 && y2 == y1);
  while (offset < end) {
    // snap the next coordinate (P3)
    const x3 = _ol_geom_flat_simplify_.snap(flatCoordinates[offset], tolerance);
    const y3 = _ol_geom_flat_simplify_.snap(flatCoordinates[offset + 1], tolerance);
    offset += stride;
    // skip P3 if it is equal to P2
    if (x3 == x2 && y3 == y2) {
      continue;
    }
    // calculate the delta between P1 and P2
    const dx1 = x2 - x1;
    const dy1 = y2 - y1;
    // calculate the delta between P3 and P1
    const dx2 = x3 - x1;
    const dy2 = y3 - y1;
    // if P1, P2, and P3 are colinear and P3 is further from P1 than P2 is from
    // P1 in the same direction then P2 is on the straight line between P1 and
    // P3
    if ((dx1 * dy2 == dy1 * dx2) &&
        ((dx1 < 0 && dx2 < dx1) || dx1 == dx2 || (dx1 > 0 && dx2 > dx1)) &&
        ((dy1 < 0 && dy2 < dy1) || dy1 == dy2 || (dy1 > 0 && dy2 > dy1))) {
      // discard P2 and set P2 = P3
      x2 = x3;
      y2 = y3;
      continue;
    }
    // either P1, P2, and P3 are not colinear, or they are colinear but P3 is
    // between P3 and P1 or on the opposite half of the line to P2.  add P2,
    // and continue with P1 = P2 and P2 = P3
    simplifiedFlatCoordinates[simplifiedOffset++] = x2;
    simplifiedFlatCoordinates[simplifiedOffset++] = y2;
    x1 = x2;
    y1 = y2;
    x2 = x3;
    y2 = y3;
  }
  // add the last point (P2)
  simplifiedFlatCoordinates[simplifiedOffset++] = x2;
  simplifiedFlatCoordinates[simplifiedOffset++] = y2;
  return simplifiedOffset;
};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {Array.<number>} ends Ends.
 * @param {number} stride Stride.
 * @param {number} tolerance Tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @param {Array.<number>} simplifiedEnds Simplified ends.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.quantizes = function(
  flatCoordinates, offset, ends, stride,
  tolerance,
  simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {
  for (let i = 0, ii = ends.length; i < ii; ++i) {
    const end = ends[i];
    simplifiedOffset = _ol_geom_flat_simplify_.quantize(
      flatCoordinates, offset, end, stride,
      tolerance,
      simplifiedFlatCoordinates, simplifiedOffset);
    simplifiedEnds.push(simplifiedOffset);
    offset = end;
  }
  return simplifiedOffset;
};

/**
 * @param {Array.<number>} flatCoordinates Flat coordinates.
 * @param {number} offset Offset.
 * @param {Array.<Array.<number>>} endss Endss.
 * @param {number} stride Stride.
 * @param {number} tolerance Tolerance.
 * @param {Array.<number>} simplifiedFlatCoordinates Simplified flat
 *     coordinates.
 * @param {number} simplifiedOffset Simplified offset.
 * @param {Array.<Array.<number>>} simplifiedEndss Simplified endss.
 * @return {number} Simplified offset.
 */
_ol_geom_flat_simplify_.quantizess = function(
  flatCoordinates, offset, endss, stride,
  tolerance,
  simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {
  for (let i = 0, ii = endss.length; i < ii; ++i) {
    const ends = endss[i];
    const simplifiedEnds = [];
    simplifiedOffset = _ol_geom_flat_simplify_.quantizes(
      flatCoordinates, offset, ends, stride,
      tolerance,
      simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);
    simplifiedEndss.push(simplifiedEnds);
    offset = ends[ends.length - 1];
  }
  return simplifiedOffset;
};
export default _ol_geom_flat_simplify_;


text:
package main

import (
	"bytes"
	"log"
	"math/rand"
	"os"
	"path/filepath"
	"strings"
	"testing"
	"time"
)

var benchmarkTestDir = ""

func randString(length int) string {
	now := time.Now()
	rand.Seed(now.UnixNano())

	res := ""
	maxLen := len(alphaNum)
	for i := 0; i <= length; i++ {
		res = res + string(alphaNum[rand.Intn(maxLen)])
	}
	return res
}

//recursivelly create directories and files given `directory`
func createFiles(directory string, level, maxLevel int) {
	if level == maxLevel {
		return
	}

	// create 5 directories and 5 files on this level
	for i := 0; i <= 10; i++ {
		filename := filepath.Join(directory, randString(6))
		if i%2 == 0 { //create a file
			os.Create(filename)
		} else { //create a directory
			if err := os.Mkdir(filename, 0777); err == nil {
				createFiles(filename, level+1, maxLevel)
			}
		}
	}
}

//Create a random temporary directory with `levels` and return the absolute path
func createTestDirs(levels int) string {
	targetDir := createTempDir()
	createFiles(targetDir, 0, levels)
	return targetDir
}

// just create a temp dir and return the absolute path
// Note: you should clean the directory yourself
func createTempDir() string {
	defaultTmpDir := os.TempDir()
	targetDir := filepath.Join(defaultTmpDir, randString(6))
	if err := os.Mkdir(targetDir, 0777); err != nil {
		log.Fatal(err)
	}
	return targetDir
}

func TestUnixRegexp(t *testing.T) {
	var patterns = map[string]string{
		"test*":  "test.*",
		"test.*": "test\\..*",
		"*.png":  ".*\\.png",
		"a?":     "a.",
		"hello-": "hello\\-",
	}

	for pattern, expected := range patterns {
		result := unixRegexp(pattern)
		if result != expected {
			t.Errorf("Got %s expected %s", result, expected)
		}
	}
}

// try to create the directories
func TestFindSimple(t *testing.T) {
	dir := createTempDir()
	defer os.RemoveAll(dir)

	os.Create(filepath.Join(dir, "hello"))
	os.Create(filepath.Join(dir, "world"))

	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":   "hell",
		"directory": dir,
	}, outputBuf)

	expected := "hello"
	result := outputBuf.Bytes()
	if !bytes.Contains(result, []byte(expected)) {
		t.Errorf("Got %s expected %s", result, expected)
	}
}

func TestFindLevels(t *testing.T) {
	levels := 3
	testDir := createTestDirs(levels)
	defer os.RemoveAll(testDir)

	// check if we really have 3 levels.
	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":   "",
		"directory": testDir,
	}, outputBuf)
	lines := strings.Split(outputBuf.String(), "\n")

	result := 0
	for _, line := range lines {
		slices := strings.Split(line, testDir)
		if len(slices) > 1 {
			parts := strings.Split(slices[1],
				string(os.PathSeparator))
			if len(parts) > result {
				result = len(parts)
			}
			if len(parts) == levels { // we found enough levels
				return
			}
		}
	}
	t.Errorf("Expected %d levels but only got %d", levels, result)
}

// find using the unix question mark pattern
func TestFindUnixPatternQue(t *testing.T) {
	dir := createTempDir()
	defer os.RemoveAll(dir)

	os.Create(filepath.Join(dir, "foo"))
	os.Create(filepath.Join(dir, "baar"))
	os.Create(filepath.Join(dir, "food"))

	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":   unixRegexp("fo?d"),
		"directory": dir,
	}, outputBuf)

	expected := "food\n"
	parts := strings.Split(outputBuf.String(), string(os.PathSeparator))
	result := parts[len(parts)-1]
	if result != expected {
		t.Errorf("Got %s expected %s", result, expected)
	}
}

// find using the * unix pattern
func TestFindUnixPatternStar(t *testing.T) {
	dir := createTempDir()
	defer os.RemoveAll(dir)

	os.Create(filepath.Join(dir, "foo"))
	os.Create(filepath.Join(dir, "baar"))
	os.Create(filepath.Join(dir, "food"))

	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":   unixRegexp("foo*"),
		"directory": dir,
	}, outputBuf)

	output := outputBuf.String()
	if !(strings.Contains(output, "foo\n") &&
		strings.Contains(output, "food\n")) {
		t.Errorf("Didn't get foo and food")
	}
}

func TestFindRegexp(t *testing.T) {
	dir := createTempDir()
	defer os.RemoveAll(dir)

	os.Create(filepath.Join(dir, "faroo"))
	os.Create(filepath.Join(dir, "bar"))
	os.Create(filepath.Join(dir, "food"))

	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":   "ar$",
		"directory": dir,
	}, outputBuf)

	if !strings.Contains(outputBuf.String(), "bar\n") {
		t.Errorf("Didn't get foo and food")
	}
}

func TestFindCaseSensitive(t *testing.T) {
	dir := createTempDir()
	defer os.RemoveAll(dir)

	os.Create(filepath.Join(dir, "Foo"))
	os.Create(filepath.Join(dir, "foo"))

	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":       "Foo",
		"directory":     dir,
		"caseSensitive": "true",
	}, outputBuf)

	output := outputBuf.String()
	if !strings.Contains(output, "Foo") {
		t.Errorf("Didn't find 'Foo' in %s", output)
	}

	if strings.Contains(output, "foo") {
		t.Errorf("Shouldn't get 'foo' in %s", output)
	}
}

// Find just files and directories
func TestFindFileType(t *testing.T) {
	dir := createTempDir()
	defer os.RemoveAll(dir)

	os.Create(filepath.Join(dir, "foo_file"))
	os.Mkdir(filepath.Join(dir, "foo_dir"), 0777)

	// Find just files and not dirs
	outputBuf := bytes.NewBufferString("")
	Find(map[string]string{
		"pattern":   "foo",
		"directory": dir,
		"filetype":  "f",
	}, outputBuf)

	output := outputBuf.String()
	if !strings.Contains(output, "foo_file") {
		t.Errorf("Must contain 'foo_file' in %s", output)
	}

	if strings.Contains(output, "foo_dir") {
		t.Errorf("Shouldn't contain 'foo_dir' in %s", output)
	}

	// Find just dirs and not files
	outputBuf = bytes.NewBufferString("") // start with a new buffer
	Find(map[string]string{
		"pattern":   "foo",
		"directory": dir,
		"filetype":  "d",
	}, outputBuf)

	output = outputBuf.String()
	if !strings.Contains(output, "foo_dir") {
		t.Errorf("Must contain 'foo_dir' in %s", output)
	}

	if strings.Contains(output, "foo_file") {
		t.Errorf("Shouldn't contain 'foo_file' in %s", output)
	}

	// Find both files and directories
	outputBuf = bytes.NewBufferString("") // start with a new buffer
	Find(map[string]string{
		"pattern":   "foo",
		"directory": dir,
		"filetype":  "f,d",
	}, outputBuf)

	output = outputBuf.String()
	if !strings.Contains(output, "foo_dir") {
		t.Errorf("Must contain 'foo_dir' in %s", output)
	}

	if !strings.Contains(output, "foo_file") {
		t.Errorf("Must contain 'foo_file' in %s", output)
	}
}

//Not sure yet how to detect symlinks?
func TestFindFileTypeSymLink(t *testing.T) {

}

func BenchmarkFind(b *testing.B) {
	defer os.RemoveAll(benchmarkTestDir)
	outputBuf := bytes.NewBufferString("")

	for i := 0; i <= b.N; i++ {
		//this will find all the files
		Find(map[string]string{
			"pattern":   "",
			"directory": benchmarkTestDir,
		}, outputBuf)
		outputBuf.Reset()
	}

}

// this is executed only once. We don't want to influence the benchmark with the creation of the directories
func init() {
	benchmarkTestDir = createTestDirs(3) // this will create 10^3 directories and files.
}


text:
import logging
import os
from collections import namedtuple

import requests

DEFAULT_URL = "https://vpn.tuxed.net/vpn-user-portal/new"
DEFAULT_USERNAME = "foo"
DEFAULT_PASSWORD = "bar"
DEFAULT_NAME = "sensor_1"

logger = logging.getLogger(__name__)

ALL_ENV = ['SENSOR_URL', 'SENSOR_USERNAME', 'SENSOR_PASSWORD', 'SENSOR_NAME']

config = namedtuple('config', ['username', 'password', 'url', 'name'])

def get_config():
    """
    Tries to get config from environment variables, if not set will use default values from this file.

    return: config namedtuple
    """
    username = os.environ.get("SENSOR_USERNAME", "") or DEFAULT_USERNAME
    password = os.environ.get("SENSOR_PASSWORD", "") or DEFAULT_PASSWORD
    url = os.environ.get("SENSOR_URL", "") or DEFAULT_URL
    name = os.environ.get("SENSOR_NAME", "") or DEFAULT_NAME
    return config(username=username, password=password, url=url, name=name)

def fetch_openvpn_config(config):
    """
    raises requests.exceptions.RequestException
    """
    logger.info("retrieving config from %s with username %s password %s..." % (config.url,
                                                                               config.username,
                                                                               '*' * len(config.password)))
    r = requests.post(config.url, auth=(config.username, config.password), data={'name': config.name})
    if r.status_code != 200:
        raise requests.exceptions.RequestException(str(r.status_code) + r.text)
    return r.text


text:
package egovframework.com.cop.smt.mtm.web;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import egovframework.com.cmm.ComDefaultCodeVO;
import egovframework.com.cmm.EgovMessageSource;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
import egovframework.com.cop.smt.mtm.service.EgovMemoTodoService;
import egovframework.com.cop.smt.mtm.service.MemoTodo;
import egovframework.com.cop.smt.mtm.service.MemoTodoVO;

import egovframework.rte.fdl.property.EgovPropertyService;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springmodules.validation.commons.DefaultBeanValidator;

/**
 * 개요
 * - 메모할일에 대한 controller 클래스를 정의한다.
 *
 * 상세내용
 * - 메모할일에 대한 등록, 수정, 삭제, 조회기능을 제공한다.
 * - 메모할일의 조회기능은 목록조회, 상세조회, 오늘의 할일조회로 구분된다.
 * @author 장철호
 * @version 1.0
 * @created 19-7-2010 오전 10:12:46
 * <pre>
 * << 개정이력(Modification Information) >>
 *
 *   수정일      수정자           수정내용
 *  -------    --------    ---------------------------
 *   2010.7.19	장철호          최초 생성
 *   2011.8.26	정진오			IncludedInfo annotation 추가
 *
 * </pre>
 */

@Controller
public class EgovMemoTodoController {

	@Resource(name="EgovMemoTodoService")
    protected EgovMemoTodoService memoTodoService;

	@Resource(name="propertiesService")
    protected EgovPropertyService propertyService;

    @Resource(name="egovMessageSource")
    EgovMessageSource egovMessageSource;

    @Autowired
    private DefaultBeanValidator beanValidator;

    //Logger log = Logger.getLogger(this.getClass());

	/**
	 * 메모할일 정보에 대한 목록을 조회한다.
	 * @param MemoTodoVO - 메모할일 VO
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodoVO
	 */
    @IncludedInfo(name="메모할일관리", order = 420 ,gid = 40)
    @RequestMapping("/cop/smt/mtm/selectMemoTodoList.do")
	public String selectMemoTodoList(@ModelAttribute("searchVO") MemoTodoVO memoTodoVO, ModelMap model) throws Exception{
    	//로그인 객체 선언
		LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
   	 	// KISA 보안취약점 조치 (2018-12-10, 신용호)
        Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

        if(!isAuthenticated) {
            return "egovframework/com/uat/uia/EgovLoginUsr";
        }

		memoTodoVO.setPageUnit(propertyService.getInt("pageUnit"));
		memoTodoVO.setPageSize(propertyService.getInt("pageSize"));

		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(memoTodoVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(memoTodoVO.getPageUnit());
		paginationInfo.setPageSize(memoTodoVO.getPageSize());

		memoTodoVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
		memoTodoVO.setLastIndex(paginationInfo.getLastRecordIndex());
		memoTodoVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

		memoTodoVO.setSearchId(loginVO.getUniqId());

		Map<String, Object> map = memoTodoService.selectMemoTodoList(memoTodoVO);
		int totCnt = Integer.parseInt((String)map.get("resultCnt"));
		paginationInfo.setTotalRecordCount(totCnt);

		model.addAttribute("resultList", map.get("resultList"));
		model.addAttribute("resultCnt", map.get("resultCnt"));
		model.addAttribute("paginationInfo", paginationInfo);

		return "egovframework/com/cop/smt/mtm/EgovMemoTodoList";
	}

	/**
	 * 메모할일 정보를 조회한다.
	 * @param MemoTodoVO - 메모할일 VO
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodoVO
	 */
    @RequestMapping("/cop/smt/mtm/selectMemoTodo.do")
	public String selectMemoTodo(@ModelAttribute("memoTodoVO") MemoTodoVO memoTodoVO, ModelMap model) throws Exception{
    	MemoTodo memoTodo = memoTodoService.selectMemoTodo(memoTodoVO);
		model.addAttribute("memoTodo", memoTodo);

		return "egovframework/com/cop/smt/mtm/EgovMemoTodoDetail";
	}

	/**
	 * 메모할일 정보의 등록페이지로 이동한다.
	 * @param MemoTodo - 메모할일 model
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodo
	 */
    @RequestMapping("/cop/smt/mtm/addMemoTodo.do")
	public String addMemoTodo(@ModelAttribute("memoTodoVO") MemoTodoVO memoTodoVO, BindingResult bindingResult, ModelMap model) throws Exception{
    	String sLocationUrl = "egovframework/com/cop/smt/mtm/EgovMemoTodoRegist";

    	// 0. Spring Security 사용자권한 처리
    	Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}

    	// 1. 로그인 객체 선언
		LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();

    	java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd", java.util.Locale.KOREA);
		memoTodoVO.setTodoDe(formatter.format(new java.util.Date()));
    	memoTodoVO.setWrterId(loginVO.getUniqId());
    	memoTodoVO.setWrterNm(loginVO.getName());

    	//할일시작일자(시)
    	model.addAttribute("todoBeginHour", (List<ComDefaultCodeVO>)getTimeHH());
    	//할일시작일자(분)
    	model.addAttribute("todoBeginMin", (List<ComDefaultCodeVO>)getTimeMM());
    	//할일종료일자(시)
    	model.addAttribute("todoEndHour", (List<ComDefaultCodeVO>)getTimeHH());
    	//할일정료일자(분)
    	model.addAttribute("todoEndMin", (List<ComDefaultCodeVO>)getTimeMM());

    	return sLocationUrl;
	}

	/**
	 * 메모할일 정보의 수정페이지로 이동한다.
	 * @param MemoTodo - 메모할일 model
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodo
	 */
    @RequestMapping("/cop/smt/mtm/modifyMemoTodo.do")
	public String modifyMemoTodo(@ModelAttribute("memoTodoVO") MemoTodoVO memoTodoVO, BindingResult bindingResult, ModelMap model) throws Exception{
    	// 0. Spring Security 사용자권한 처리
    	Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}

    	//할일시작일자(시)
    	model.addAttribute("todoBeginHour", (List<ComDefaultCodeVO>)getTimeHH());
    	//할일시작일자(분)
    	model.addAttribute("todoBeginMin", (List<ComDefaultCodeVO>)getTimeMM());
    	//할일종료일자(시)
    	model.addAttribute("todoEndHour", (List<ComDefaultCodeVO>)getTimeHH());
    	//할일정료일자(분)
    	model.addAttribute("todoEndMin", (List<ComDefaultCodeVO>)getTimeMM());

    	MemoTodoVO resultVO = memoTodoService.selectMemoTodo(memoTodoVO);
		resultVO.setSearchCnd(memoTodoVO.getSearchCnd());
		resultVO.setSearchWrd(memoTodoVO.getSearchWrd());
		resultVO.setSearchBgnDe(memoTodoVO.getSearchBgnDe());
		resultVO.setSearchEndDe(memoTodoVO.getSearchEndDe());
		resultVO.setSearchDe(memoTodoVO.getSearchDe());
		resultVO.setPageIndex(memoTodoVO.getPageIndex());
        model.addAttribute("memoTodoVO", resultVO);

		return "egovframework/com/cop/smt/mtm/EgovMemoTodoUpdt";
	}

	/**
	 * 메모할일 정보를 수정한다.
	 * @param MemoTodo - 메모할일 model
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodo
	 */
    @RequestMapping("/cop/smt/mtm/updateMemoTodo.do")
	public String updateMemoTodo(@ModelAttribute("memoTodoVO") MemoTodoVO memoTodoVO, BindingResult bindingResult, ModelMap model) throws Exception{
		LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
		Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

		beanValidator.validate(memoTodoVO, bindingResult);
		if (bindingResult.hasErrors()) {
			MemoTodo memoTodo = memoTodoService.selectMemoTodo(memoTodoVO);
		    model.addAttribute("memoTodo", memoTodo);
		    return "egovframework/com/cop/smt/mtm/EgovMemoTodoUpdt";
		}

		if (isAuthenticated) {
			memoTodoVO.setTodoBeginTime(memoTodoVO.getTodoDe() + memoTodoVO.getTodoBeginHour() + memoTodoVO.getTodoBeginMin());
			memoTodoVO.setTodoEndTime(memoTodoVO.getTodoDe() + memoTodoVO.getTodoEndHour() + memoTodoVO.getTodoEndMin());

    		memoTodoVO.setLastUpdusrId(user.getUniqId());
    		memoTodoService.updateMemoTodo(memoTodoVO);
		}

		return "forward:/cop/smt/mtm/selectMemoTodoList.do";
	}

	/**
	 * 메모할일 정보를 등록한다.
	 * @param MemoTodo - 메모할일 model
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodo
	 */
    @RequestMapping("/cop/smt/mtm/insertMemoTodo.do")
	public String insertMemoTodo(@ModelAttribute("memoTodoVO") MemoTodoVO memoTodoVO, BindingResult bindingResult, ModelMap model) throws Exception{
		// 0. Spring Security 사용자권한 처리
    	Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}

		//로그인 객체 선언
		LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();

		String sLocationUrl = "egovframework/com/cop/smt/mtm/EgovMemoTodoRegist";

		//서버  validate 체크
        beanValidator.validate(memoTodoVO, bindingResult);
		if(bindingResult.hasErrors()){
			return sLocationUrl;
		}

		memoTodoVO.setTodoBeginTime(memoTodoVO.getTodoDe() + memoTodoVO.getTodoBeginHour() + memoTodoVO.getTodoBeginMin());
		memoTodoVO.setTodoEndTime(memoTodoVO.getTodoDe() + memoTodoVO.getTodoEndHour() + memoTodoVO.getTodoEndMin());
		//아이디 설정
		memoTodoVO.setFrstRegisterId((String)loginVO.getUniqId());
		memoTodoVO.setLastUpdusrId((String)loginVO.getUniqId());

		memoTodoService.insertMemoTodo(memoTodoVO);
    	sLocationUrl = "forward:/cop/smt/mtm/selectMemoTodoList.do";

        return sLocationUrl;
	}

	/**
	 * 메모할일 정보를 삭제한다.
	 * @param MemoTodo - 메모할일 model
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodo
	 */
    @RequestMapping("/cop/smt/mtm/deleteMemoTodo.do")
	public String deleteMemoTodo(@ModelAttribute("memoTodoVO") MemoTodoVO memoTodoVO, ModelMap model) throws Exception{
		// 0. Spring Security 사용자권한 처리
    	Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    	if(!isAuthenticated) {
    		model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
        	return "egovframework/com/uat/uia/EgovLoginUsr";
    	}
    	memoTodoService.deleteMemoTodo(memoTodoVO);
		return "forward:/cop/smt/mtm/selectMemoTodoList.do";
	}

	/**
	 * 메모할일 정보 중 오늘의 할일 대한 목록을 조회한다.
	 * @param MemoTodoVO - 메모할일 VO
	 * @return  String - 리턴 URL
	 *
	 * @param memoTodoVO
	 */
    @RequestMapping("/cop/smt/mtm/selectMemoTodoListToday.do")
	public String selectMemoTodoListToday(@ModelAttribute("searchVO") MemoTodoVO memoTodoVO, ModelMap model) throws Exception{
		//로그인 객체 선언
		LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
   	 	// KISA 보안취약점 조치 (2018-12-10, 신용호)
        Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

        if(!isAuthenticated) {
            return "egovframework/com/uat/uia/EgovLoginUsr";
        }

		memoTodoVO.setSearchId(loginVO.getUniqId());

		java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd", java.util.Locale.KOREA);
		String strToday = formatter.format(new java.util.Date());
		memoTodoVO.setSearchBgnDe(strToday + "0000");
		memoTodoVO.setSearchEndDe(strToday + "2359");

		List<MemoTodoVO> memoTodoList = memoTodoService.selectMemoTodoListToday(memoTodoVO);
		model.addAttribute("resultList", memoTodoList);
		model.addAttribute("resultToday", strToday);

		return "egovframework/com/cop/smt/mtm/EgovMemoTodoListToday";
	}

    /**
	 * 시간의 LIST를 반환한다.
	 * @return  List
	 * @throws
	 */
	private List<ComDefaultCodeVO> getTimeHH (){
    	ArrayList<ComDefaultCodeVO> listHH = new ArrayList<ComDefaultCodeVO>();
    	//HashMap hmHHMM;
    	for(int i=0;i < 24; i++){
    		String sHH = "";
    		String strI = String.valueOf(i);
    		if(i<10){
    			sHH = "0" + strI;
    		}else{
    			sHH = strI;
    		}

    		ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
    		codeVO.setCode(sHH);
    		codeVO.setCodeNm(sHH);

    		listHH.add(codeVO);
    	}

    	return listHH;
	}

	/**
	 * 분의 LIST를 반환한다.
	 * @return  List
	 * @throws
	 */
	private List<ComDefaultCodeVO> getTimeMM (){
    	ArrayList<ComDefaultCodeVO> listMM = new ArrayList<ComDefaultCodeVO>();
    	//HashMap hmHHMM;
    	for(int i=0;i < 60; i++){

    		String sMM = "";
    		String strI = String.valueOf(i);
    		if(i<10){
    			sMM = "0" + strI;
    		}else{
    			sMM = strI;
    		}

    		ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
    		codeVO.setCode(sMM);
    		codeVO.setCodeNm(sMM);

    		listMM.add(codeVO);
    	}
    	return listMM;
	}

}


text:
AliAnalysisTask * AddTaskZDCEP(TString ZDCCalibFileName,
                               TString trigger="MB",
                               TString dataset="pass1",
                               TString Label="",
                               const char* suffix="")
{
  // the manager is static, so get the existing manager via the static method
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    printf("No analysis manager to connect to!\n");
    return NULL;
  }

  // just to see if all went well, check if the input event handler has been connected
  if (!mgr->GetInputEventHandler()) {
    printf("This task requires an input event handler!\n");
    return NULL;
  }

  // get the default name of the output file ("AnalysisResults.root")
  TString file = "AnalysisResults";

  // get the common input container from the analysis manager
  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();

  // create the flow analysis tasks
  TString AnalysisTaskName = "AnalysisTaskZDCEP";
  AnalysisTaskName += Label;
  AnalysisTaskName += suffix;
  AliAnalysisTaskZDCEP *taskZDC = new AliAnalysisTaskZDCEP(AnalysisTaskName);
  if(trigger=="MB") taskZDC->SelectCollisionCandidates(AliVEvent::kINT7);
  if(dataset=="pass1") taskZDC->SetDataSet(AliAnalysisTaskZDCEP::k2015o_pass1_pass1pidfix);
  if(trigger=="muon_single") taskZDC->SelectCollisionCandidates(AliVEvent::kMuonSingleHighPt7 | AliVEvent::kMuonSingleLowPt7);
  if(dataset=="muon_calo_pass1") taskZDC->SetDataSet(AliAnalysisTaskZDCEP::k2015o_muon_calo_pass1);

  // add list for ZDC towers gain equalization
  TString ZDCTowerEqFileName = "";
  if(dataset=="pass1") ZDCTowerEqFileName = "alien:///alice/cern.ch/user/j/jmargutt/15oHI_EZDCcalib.root";
  if(dataset=="muon_calo_pass1") ZDCTowerEqFileName = "alien:///alice/cern.ch/user/j/jmargutt/15oHI_muon_calo_pass1_EZDCcalib.root";
  TFile* ZDCTowerEqFile = TFile::Open(ZDCTowerEqFileName,"READ");
  if(!ZDCTowerEqFile) {
    cout << "ERROR: ZDC tower equalisation: file not found!" << endl;
    exit(1);
  }
  gROOT->cd();
  TList* ZDCTowerEqList = (TList*)(ZDCTowerEqFile->FindObjectAny("EZNcalib"));
  if(ZDCTowerEqList) {
    taskZDC->SetTowerEqList(ZDCTowerEqList);
    cout << "ZDC tower equalisation: set! (from " <<  ZDCTowerEqFileName.Data() << ")" << endl;
  } else {
    cout << "ERROR: ZDC tower equalisation: EZNcalib TList not found!" << endl;
    exit(1);
  }
  delete ZDCTowerEqFile;

  if(ZDCCalibFileName!="") {
    // add list for ZDC Q-vector re-centering
    TFile* ZDCCalibFile = TFile::Open(ZDCCalibFileName,"READ");
    if(!ZDCCalibFile) {
      cout << "ERROR: ZDC Q-vector calibration: file not found!" << endl;
      exit(1);
    }
    TList* ZDCCalibList = dynamic_cast<TList*>(ZDCCalibFile->FindObjectAny("Q Vectors"));
    if(ZDCCalibList) {
      taskZDC->SetZDCCalibList(ZDCCalibList);
      cout << "ZDC Q-vector calibration: set! (from " <<  ZDCCalibFileName.Data() << ")" << endl;
    } else {
      cout << "ERROR: ZDC Q-vector calibration: Q Vectors TList not found!" << endl;
      exit(1);
    }
    delete ZDCCalibFile;
  }

  // connect the task to the analysis manager
  mgr->AddTask(taskZDC);

  // create a data container for the output of the flow event task
  TString taskZDCEPname = "ZDCEPExchangeContainer";
  taskZDCEPname += Label;
  taskZDCEPname += suffix;
  AliAnalysisDataContainer *coutputFE = mgr->CreateContainer(taskZDCEPname,
    AliFlowEventSimple::Class(),
    AliAnalysisManager::kExchangeContainer);
    // connect the input data to the flow event task
    mgr->ConnectInput(taskZDC,0,cinput);
    // and connect the output to the flow event task
    mgr->ConnectOutput(taskZDC,1,coutputFE);

    // QA OUTPUT CONTAINER
    TString taskZDCQAname = "AnalysisResults.root:ZDCQA";
    taskZDCQAname += Label;
    taskZDCQAname += suffix;
    AliAnalysisDataContainer* coutputZDCQA = mgr->CreateContainer(taskZDCQAname.Data(),
    TList::Class(),
    AliAnalysisManager::kOutputContainer,
    taskZDCQAname);
    // and connect the qa output container to the flow event.
    // this container will be written to the output file
    mgr->ConnectOutput(taskZDC,2,coutputZDCQA);

    return taskZDC;
  }


text:
package com.example.user.billardtrainningapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

/**
 * Created by user on 2017-04-05.
 */

public class CourseBook_Youpdol_Basic extends AppCompatActivity {
    ViewPager Youpdol_Basic_Pager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.coursebook_basic_viewpager);

        Youpdol_Basic_Pager = (ViewPager)findViewById(R.id.basic_pager);
        CourseBook_Basic_Viewpager adapter= new CourseBook_Basic_Viewpager(getLayoutInflater());
        Youpdol_Basic_Pager.setAdapter(adapter);
    }
    public void CourseBook_youpdol_basic_wide(View v){
        Intent CourseBook_Summary_Button_Intent;
        CourseBook_Summary_Button_Intent = new Intent(this,CourseBook_Youpdol_Basic_Wide.class);

        switch (v.getId()){
            case R.id.coursebook_youpdol_button_1:
                CourseBook_Summary_Button_Intent.putExtra("Level","1");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_2:
                CourseBook_Summary_Button_Intent.putExtra("Level","2");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_3:
                CourseBook_Summary_Button_Intent.putExtra("Level","3");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_4:
                CourseBook_Summary_Button_Intent.putExtra("Level","4");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_5:
                CourseBook_Summary_Button_Intent.putExtra("Level","5");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_6:
                CourseBook_Summary_Button_Intent.putExtra("Level","6");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_7:
                CourseBook_Summary_Button_Intent.putExtra("Level","7");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_8:
                CourseBook_Summary_Button_Intent.putExtra("Level","8");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_9:
                CourseBook_Summary_Button_Intent.putExtra("Level","9");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_10:
                CourseBook_Summary_Button_Intent.putExtra("Level","10");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_11:
                CourseBook_Summary_Button_Intent.putExtra("Level","11");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
            case R.id.coursebook_youpdol_button_12:
                CourseBook_Summary_Button_Intent.putExtra("Level","12");
                startActivity(CourseBook_Summary_Button_Intent);
                break;
        }
    }
}


text:
"""send.py unit tests."""
from slack import WebClient
from slack.errors import SlackApiError
import pytest
from unittest.mock import patch
from pypyr.context import Context
from pypyr.errors import KeyInContextHasNoValueError, KeyNotInContextError
from pypyrslack.errors import SlackSendError
from pypyrslack.steps import send

@patch.object(WebClient, 'chat_postMessage')
@patch.object(WebClient, '__init__', return_value=None)
def test_send_pass(mock_client, mock_post):
    """Success case for slack send."""
    mock_post.return_value = {'ok': True}
    context = Context({'slackToken': 'in your dreams',
                       'slackChannel': '#blah',
                       'slackText': 'this is :boom: text'})
    send.run_step(context)

    mock_client.assert_called_once_with('in your dreams')
    mock_post.assert_called_once_with(
        channel='#blah',
        text='this is :boom: text')

@patch.object(WebClient, 'chat_postMessage')
@patch.object(WebClient, '__init__', return_value=None)
def test_send_with_string_interpolation(mock_client, mock_post):
    """Slack send with string interpolation."""
    mock_post.return_value = {'ok': True}
    context = Context({'arbkey1': 'arb value1',
                       'arbkey2': 'arb value2',
                       'arbkey3': 'channelarb',
                       'slackToken': 'in {arbkey1} dreams',
                       'slackChannel': '#{arbkey3}',
                       'slackText': '{arbkey2} this is :boom: text {arbkey1}'})

    send.run_step(context)

    mock_client.assert_called_once_with('in arb value1 dreams')
    mock_post.assert_called_once_with(
        channel='#channelarb',
        text='arb value2 this is :boom: text arb value1')

@patch.object(WebClient, 'chat_postMessage')
@patch.object(WebClient, '__init__', return_value=None)
def test_slack_error_raises(mock_client, mock_post):
    """A SlackSendError on slack failure."""
    # Actual error example: {'ok': False, 'error': 'channel_not_found'}
    mock_post.side_effect = SlackApiError(response={'error': 'bang bang'},
                                          message="bang bang msg")
    context = Context({'slackToken': 'in your dreams',
                       'slackChannel': '#blah',
                       'slackText': 'this is :boom: text'})

    with pytest.raises(SlackSendError) as err_info:
        send.run_step(context)

    assert str(err_info.value) == "bang bang"

def test_no_slack_token_raises():
    """The slackToken context required."""
    with pytest.raises(KeyNotInContextError) as err_info:
        context = Context({'slackChannel': '#blah',
                           'slackText': 'this is :boom: text'})
        send.run_step(context)

    assert str(err_info.value) == (
        "context['slackToken'] doesn't exist. It must exist for "
        "pypyrslack.steps.send.")

def test_no_slack_channel_raises():
    """The slackChannel context required."""
    with pytest.raises(KeyNotInContextError) as err_info:
        context = Context({'slackToken': 'in your dreams',
                           'slackText': 'this is :boom: text'})
        send.run_step(context)

    assert str(err_info.value) == (
        "context['slackChannel'] doesn't exist. It must exist for "
        "pypyrslack.steps.send.")

def test_no_slack_text_raises():
    """The slackChannel context required."""
    with pytest.raises(KeyNotInContextError) as err_info:
        context = Context({'slackToken': 'in your dreams',
                           'slackChannel': '#blah'})
        send.run_step(context)

    assert str(err_info.value) == (
        "context['slackText'] doesn't exist. It must exist for "
        "pypyrslack.steps.send.")

def test_slack_token_no_value_raises():
    """The slackToken context value required."""
    with pytest.raises(KeyInContextHasNoValueError) as err_info:
        context = Context({
            'slackToken': None,
            'slackChannel': '#blah',
            'slackText': 'this is :boom: text'})
        send.run_step(context)

    assert str(err_info.value) == (
        "context['slackToken'] must have a value for pypyrslack.steps.send.")

def test_slack_channel_no_value_raises():
    """The slackChannel context value required."""
    with pytest.raises(KeyInContextHasNoValueError) as err_info:
        context = Context({
            'slackToken': 'token here',
            'slackChannel': None,
            'slackText': 'this is :boom: text'})
        send.run_step(context)

    assert str(err_info.value) == (
        "context['slackChannel'] must have a value for pypyrslack.steps.send.")


text:
package com.thoughtworks.go.domain.feed;

import com.thoughtworks.go.domain.BaseCollection;

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

/**
 * @understands a collection of feeds
 */
public class FeedEntries extends BaseCollection<FeedEntry> {

    public FeedEntries(List<FeedEntry> feeds) {
        super(feeds);
    }

    public FeedEntries(FeedEntry... feeds) {
        super(feeds);
    }

    public FeedEntries() {
    }

    public Long firstEntryId() {
        return isEmpty() ? null : first().getEntryId();
    }

    public Long lastEntryId() {
        return isEmpty() ? null : last().getEntryId();
    }

    public Date lastUpdatedDate() {
        return isEmpty() ? new Date() : first().getUpdatedDate();
    }
}


text:
package goalplanner;

public class EffectSummary {

	/** Contains the definite effects of this summary's node. */
	protected EffectSet definite;

	/** Contains the potential effects of this summary's node. */
	protected EffectSet potential;

	public EffectSummary(EffectSet definite, EffectSet potential) {
		this.definite = definite;
		this.potential = potential;
	}

	public EffectSummary(String planName, String[] effects) {
		this(new EffectSet(planName, effects), new EffectSet());
	}

	public EffectSummary multiply(EffectSummary other) {
		EffectSet definite = this.definite.intersect(other.definite);
		EffectSet potential = this.potential.union(other.potential);
		EffectSet p1 = this.definite.union(other.definite);
		EffectSet p2 = this.definite.intersect(other.definite);
		potential = potential.union(p1.subtract(p2));
		return new EffectSummary(definite, potential);
	}

	public EffectSummary plus(EffectSummary other) {
		EffectSet definite = this.definite.union(other.definite);
		EffectSet p1 = this.potential.union(other.potential);
		EffectSet p2 = this.definite.union(other.definite);
		EffectSet potential = p1.subtract(p2);
		return new EffectSummary(definite, potential);
	}

	public boolean hasEffect(String effect) {
		return this.definite.hasEffect(effect) || this.potential.hasEffect(effect);
	}

	public String toString() {
		return "<" + definite.toString() + ", " + potential.toString() + ">";
	}

	public EffectSet getDefinite() {
		return definite;
	}

	public EffectSet getPotential() {
		return potential;
	}

}


text:
(function (fn) {
  if (document.readyState == "loading") {
    addEventListener("DOMContentLoaded", fn, false);
  } else {
    fn();
  }
})(function () {
  console.log('Disabling Ads');
  var player = document.getElementById("movie_player"),
    clean_player = player.cloneNode(true),
    flash_vars = player.getAttribute("flashvars");
  flash_vars = flash_vars.replace(/&ad[^&]+/g, "");
  clean_player.setAttribute("flashvars", flash_vars);
  player.parentNode.replaceChild(clean_player, player);
});


text:
/* list.h - a generic doubly linked list implementation
 */
#ifndef LIST_H
#define LIST_H

typedef struct list_node {
    struct list_node *prev;
    struct list_node *next;
    void *value;
} list_node;

typedef struct list_iter {
    list_node *next;
    int direction;
} list_iter;

typedef struct list {
    list_node *head;
    list_node *tail;
    void *(*dup)(void *ptr);
    void (*free)(void *ptr);
    int (*match)(void *ptr, void *key);
    unsigned long len;
} list;

/* Functions implemented as macros */
#define list_length(l) ((l)->len)
#define list_first(l) ((l)->head)
#define list_last(l) ((l)->tail)
#define list_prev_node(n) ((n)->prev)
#define list_next_node(n) ((n)->next)
#define list_node_value(n) ((n)->value)

#define list_set_dup_method(l,m) ((l)->dup = (m))
#define list_set_free_method(l,m) ((l)->free = (m))
#define list_set_match_method(l,m) ((l)->match = (m))

#define list_get_dup_method(l) ((l)->dup)
#define list_get_free_method(l) ((l)->free)
#define list_get_match_method(l) ((l)->match)

/* Prototypes */
list *list_create(void);
void list_release(list *list);
list *list_add_node_head(list *list, void *value);
list *list_add_node_tail(list *list, void *value);
list *list_insert_node(list *list, list_node *old_node, void *value, int after);
void list_del_node(list *list, list_node *node);
list_iter *list_get_iterator(list *list, int direction);
list_node *list_next(list_iter *iter);
void list_release_iterator(list_iter *iter);
list *list_dup(list *orig);
list_node *list_search_key(list *list, void *key);
list_node *list_index(list *list, long index);
void list_rewind(list *list, list_iter *li);
void list_rewind_tail(list *list, list_iter *li);
void list_rotate(list *list);

/* directions for iterators */
#define START_FROM_HEAD 0
#define START_FROM_TAIL 1

#endif /* LIST_H */


text:
#import "NSObject.h"

@class NSTextTableBlock;

// Not exported
@interface NSTextBlockLayoutHelper : NSObject
{
    NSTextTableBlock *_block;
    struct _NSRange _charRange;
    struct _NSRange _glyphRange;
    struct CGRect _layoutRect;
    struct CGRect _boundsRect;
    double _lMargin;
    double _lBorder;
    double _lPadding;
    double _tMargin;
    double _tBorder;
    double _tPadding;
    double _width;
    double _height;
    double _rPadding;
    double _rBorder;
    double _rMargin;
    double _bPadding;
    double _bBorder;
    double _bMargin;
}

- (void)dealloc;
- (id)description;
- (id)initWithTextTable:(id)arg1 charIndex:(unsigned long long)arg2 text:(id)arg3 layoutManager:(id)arg4 containerWidth:(double)arg5 collapseBorders:(_Bool)arg6;
- (id)initWithTextBlock:(id)arg1 charIndex:(unsigned long long)arg2 text:(id)arg3 layoutManager:(id)arg4 containerWidth:(double)arg5 collapseBorders:(_Bool)arg6;
- (id)initWithTextBlock:(id)arg1 charRange:(struct _NSRange)arg2 text:(id)arg3 layoutManager:(id)arg4 containerWidth:(double)arg5 collapseBorders:(_Bool)arg6;
- (id)initWithTextBlock:(id)arg1 charRange:(struct _NSRange)arg2 glyphRange:(struct _NSRange)arg3 layoutRect:(struct CGRect)arg4 boundsRect:(struct CGRect)arg5 containerWidth:(double)arg6 allowMargins:(_Bool)arg7 collapseBorders:(_Bool)arg8 allowPadding:(_Bool)arg9;

@end


text:
Accounts.config({
  forbidClientAccountCreation : false
});

if(Meteor.isClient){
  Accounts.ui.config({
    forceUsernameLowercase: true,
    forceEmailLowercase: true,
    passwordSignupFields: 'USERNAME_AND_EMAIL'
  });
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<beanio xmlns="http://www.beanio.org/2016/07">
  <template name="DBHB">
    <field name="KE" length="4" literal="DBHB" required="true"/>
    <field name="VZHB" length="1" required="true"/>
    <field name="HB" length="8" required="true" type="int" format="00000000"/>
  </template>
</beanio>


text:
We have a database called people that we would like to backup, and then later restore to the original, or import to another database, people-copy.

Step 1: Dump the database. The follwoing command automatically "dumps" your databases to a directory called dump.

mongodump

Step 2: Restore the database. We need to say which database we want to restore and where to restore it. For example: If I want to put the database called people into old-people I would use the following command.

mongorestore -d old-people dump/people/

Note: Do not forget to re-create your indexes after you restore a database.


text:
<?php

namespace Hris\TrainingBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use FOS\UserBundle\Doctrine;
use Doctrine\ORM\EntityRepository;
class SponsorType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder

            ->add('sponsorName')
            ->add('description')
            ->add('phone')
            ->add('email')
            ->add('box')
            ->add('description')
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Hris\TrainingBundle\Entity\Sponsor'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'hris_trainingbundle_sponsor';
    }
}


text:
package org.apache.reef.wake.rx;

/**
 * Defines a provider for push-based notification.
 */
public interface Observable {
}