text:
package org.apache.flume.sink.hdfs;

import java.io.IOException;
import org.apache.flume.Context;

import org.apache.flume.Event;
import org.apache.flume.sink.FlumeFormatter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.SequenceFile.CompressionType;
import org.apache.hadoop.io.compress.CompressionCodec;

public class HDFSSequenceFile implements HDFSWriter {

  private SequenceFile.Writer writer;

  public HDFSSequenceFile() {
    writer = null;
  }

  @Override
  public void configure(Context context) {
    // no-op
  }

  @Override
  public void open(String filePath, FlumeFormatter fmt) throws IOException {
    open(filePath, null, CompressionType.NONE, fmt);
  }

  @Override
  public void open(String filePath, CompressionCodec codeC,
      CompressionType compType, FlumeFormatter fmt) throws IOException {
    Configuration conf = new Configuration();
    Path dstPath = new Path(filePath);
    FileSystem hdfs = dstPath.getFileSystem(conf);

    if (conf.getBoolean("hdfs.append.support", false) == true && hdfs.isFile
            (dstPath)) {
      FSDataOutputStream outStream = hdfs.append(dstPath);
      writer = SequenceFile.createWriter(conf, outStream, fmt.getKeyClass(),
          fmt.getValueClass(), compType, codeC);
    } else {
      writer = SequenceFile.createWriter(hdfs, conf, dstPath,
          fmt.getKeyClass(), fmt.getValueClass(), compType, codeC);
    }
  }

  @Override
  public void append(Event e, FlumeFormatter formatter) throws IOException {
    writer.append(formatter.getKey(e), formatter.getValue(e));
  }

  @Override
  public void sync() throws IOException {
    writer.sync();
  }

  @Override
  public void close() throws IOException {
    writer.close();
  }
}


text:
A DropListExample is a simple example of how to use drop lists.

self example

redpajama_set_name: RedPajamaGithub


text:
package cherry.sqlapp.db.gen.dto;

import cherry.foundation.type.DeletedFlag;
import java.io.Serializable;
import org.joda.time.LocalDateTime;

public class AsyncProcessFileResult implements Serializable {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.ID
     *
     * @mbggenerated
     */
    private Long id;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.ASYNC_ID
     *
     * @mbggenerated
     */
    private Long asyncId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.TOTAL_COUNT
     *
     * @mbggenerated
     */
    private Long totalCount;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.OK_COUNT
     *
     * @mbggenerated
     */
    private Long okCount;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.NG_COUNT
     *
     * @mbggenerated
     */
    private Long ngCount;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.UPDATED_AT
     *
     * @mbggenerated
     */
    private LocalDateTime updatedAt;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.CREATED_AT
     *
     * @mbggenerated
     */
    private LocalDateTime createdAt;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.LOCK_VERSION
     *
     * @mbggenerated
     */
    private Integer lockVersion;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ASYNC_PROCESS_FILE_RESULT.DELETED_FLG
     *
     * @mbggenerated
     */
    private DeletedFlag deletedFlg;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table ASYNC_PROCESS_FILE_RESULT
     *
     * @mbggenerated
     */
    private static final long serialVersionUID = 1L;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.ID
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.ID
     *
     * @mbggenerated
     */
    public Long getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.ID
     *
     * @param id the value for ASYNC_PROCESS_FILE_RESULT.ID
     *
     * @mbggenerated
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.ASYNC_ID
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.ASYNC_ID
     *
     * @mbggenerated
     */
    public Long getAsyncId() {
        return asyncId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.ASYNC_ID
     *
     * @param asyncId the value for ASYNC_PROCESS_FILE_RESULT.ASYNC_ID
     *
     * @mbggenerated
     */
    public void setAsyncId(Long asyncId) {
        this.asyncId = asyncId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.TOTAL_COUNT
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.TOTAL_COUNT
     *
     * @mbggenerated
     */
    public Long getTotalCount() {
        return totalCount;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.TOTAL_COUNT
     *
     * @param totalCount the value for ASYNC_PROCESS_FILE_RESULT.TOTAL_COUNT
     *
     * @mbggenerated
     */
    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.OK_COUNT
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.OK_COUNT
     *
     * @mbggenerated
     */
    public Long getOkCount() {
        return okCount;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.OK_COUNT
     *
     * @param okCount the value for ASYNC_PROCESS_FILE_RESULT.OK_COUNT
     *
     * @mbggenerated
     */
    public void setOkCount(Long okCount) {
        this.okCount = okCount;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.NG_COUNT
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.NG_COUNT
     *
     * @mbggenerated
     */
    public Long getNgCount() {
        return ngCount;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.NG_COUNT
     *
     * @param ngCount the value for ASYNC_PROCESS_FILE_RESULT.NG_COUNT
     *
     * @mbggenerated
     */
    public void setNgCount(Long ngCount) {
        this.ngCount = ngCount;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.UPDATED_AT
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.UPDATED_AT
     *
     * @mbggenerated
     */
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.UPDATED_AT
     *
     * @param updatedAt the value for ASYNC_PROCESS_FILE_RESULT.UPDATED_AT
     *
     * @mbggenerated
     */
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.CREATED_AT
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.CREATED_AT
     *
     * @mbggenerated
     */
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.CREATED_AT
     *
     * @param createdAt the value for ASYNC_PROCESS_FILE_RESULT.CREATED_AT
     *
     * @mbggenerated
     */
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.LOCK_VERSION
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.LOCK_VERSION
     *
     * @mbggenerated
     */
    public Integer getLockVersion() {
        return lockVersion;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.LOCK_VERSION
     *
     * @param lockVersion the value for ASYNC_PROCESS_FILE_RESULT.LOCK_VERSION
     *
     * @mbggenerated
     */
    public void setLockVersion(Integer lockVersion) {
        this.lockVersion = lockVersion;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ASYNC_PROCESS_FILE_RESULT.DELETED_FLG
     *
     * @return the value of ASYNC_PROCESS_FILE_RESULT.DELETED_FLG
     *
     * @mbggenerated
     */
    public DeletedFlag getDeletedFlg() {
        return deletedFlg;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ASYNC_PROCESS_FILE_RESULT.DELETED_FLG
     *
     * @param deletedFlg the value for ASYNC_PROCESS_FILE_RESULT.DELETED_FLG
     *
     * @mbggenerated
     */
    public void setDeletedFlg(DeletedFlag deletedFlg) {
        this.deletedFlg = deletedFlg;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_FILE_RESULT
     *
     * @mbggenerated
     */
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AsyncProcessFileResult other = (AsyncProcessFileResult) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAsyncId() == null ? other.getAsyncId() == null : this.getAsyncId().equals(other.getAsyncId()))
            && (this.getTotalCount() == null ? other.getTotalCount() == null : this.getTotalCount().equals(other.getTotalCount()))
            && (this.getOkCount() == null ? other.getOkCount() == null : this.getOkCount().equals(other.getOkCount()))
            && (this.getNgCount() == null ? other.getNgCount() == null : this.getNgCount().equals(other.getNgCount()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getLockVersion() == null ? other.getLockVersion() == null : this.getLockVersion().equals(other.getLockVersion()))
            && (this.getDeletedFlg() == null ? other.getDeletedFlg() == null : this.getDeletedFlg().equals(other.getDeletedFlg()));
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_FILE_RESULT
     *
     * @mbggenerated
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAsyncId() == null) ? 0 : getAsyncId().hashCode());
        result = prime * result + ((getTotalCount() == null) ? 0 : getTotalCount().hashCode());
        result = prime * result + ((getOkCount() == null) ? 0 : getOkCount().hashCode());
        result = prime * result + ((getNgCount() == null) ? 0 : getNgCount().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getLockVersion() == null) ? 0 : getLockVersion().hashCode());
        result = prime * result + ((getDeletedFlg() == null) ? 0 : getDeletedFlg().hashCode());
        return result;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table ASYNC_PROCESS_FILE_RESULT
     *
     * @mbggenerated
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", asyncId=").append(asyncId);
        sb.append(", totalCount=").append(totalCount);
        sb.append(", okCount=").append(okCount);
        sb.append(", ngCount=").append(ngCount);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", lockVersion=").append(lockVersion);
        sb.append(", deletedFlg=").append(deletedFlg);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}


text:
from setuptools import setup, find_packages
from setuptools.command.test import test

class Tox(test):
    def finalize_options(self):
        test.finalize_options(self)
        self.test_args = ["-v", "-epy"]
        self.test_suite = True

    def run_tests(self):
        # import here, cause outside the eggs aren't loaded
        import tox
        tox.cmdline(self.test_args)

setup(
    name='boosh',
    version='0.1.0.dev1',
    description='SSH to your your private EC2 instances by ID',
    packages=find_packages(),
    install_requires=[
        'botocore>=0.94.0',
    ],
    entry_points={
        'console_scripts': [
            'boosh_proxy = boosh.ssh:main',
        ],
    },
    tests_require=['tox'],
    cmdclass={'test': Tox},
    author='Paul Handly',
    author_email='ph@betaworks.com',
    url='https://github.com/betaworks/boosh',
    license='MIT',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2 :: Only',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python',
        'Topic :: Utilities',
    ],
    keywords=['ec2', 'ssh', 'shell', 'aws', 'bastion', 'firewall', 'proxy'],
)


text:
@interface PodsDummy_Pods_BLAMPayment_Example : NSObject
@end
@implementation PodsDummy_Pods_BLAMPayment_Example
@end


text:
package principal.items.objetos;

import java.awt.Point;

public class ObjetoTiled {

	private Point posicion;
	private Objeto objeto; //objeto la clase creada no la de java, un objeto que se encuentra en el mapa//

	public ObjetoTiled(Point posicion, Objeto objeto){
		this.posicion = posicion;
		this.objeto = objeto;
	}

	public Point obtenerPosicion(){
		return posicion;
	}

	public Objeto obtenerObjeto(){
		return objeto;
	}
}


text:
#if !__NOIPENDPOINT__
using NetEndPoint = System.Net.IPEndPoint;
using NetAddress = System.Net.IPAddress;
#endif

using System;
using System.Net;

using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Security.Cryptography;

namespace Lidgren.Network
{
	/// <summary>
	/// Utility methods
	/// </summary>
	public static partial class NetUtility
	{
		private static readonly bool IsMono = Type.GetType("Mono.Runtime") != null;

		/// <summary>
		/// Resolve endpoint callback
		/// </summary>
		public delegate void ResolveEndPointCallback(NetEndPoint endPoint);

		/// <summary>
		/// Resolve address callback
		/// </summary>
		public delegate void ResolveAddressCallback(NetAddress adr);

		/// <summary>
		/// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number (asynchronous version)
		/// </summary>
		public static void ResolveAsync(string ipOrHost, int port, ResolveEndPointCallback callback)
		{
			ResolveAsync(ipOrHost, delegate(NetAddress adr)
			{
				if (adr == null)
				{
					callback(null);
				}
				else
				{
					callback(new NetEndPoint(adr, port));
				}
			});
		}

		/// <summary>
		/// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number
		/// </summary>
		public static NetEndPoint Resolve(string ipOrHost, int port)
		{
			var adr = Resolve(ipOrHost);
			return adr == null ? null : new NetEndPoint(adr, port);
		}

		private static IPAddress s_broadcastAddress;
		public static IPAddress GetCachedBroadcastAddress()
		{
			if (s_broadcastAddress == null)
				s_broadcastAddress = GetBroadcastAddress();
			return s_broadcastAddress;
		}

		/// <summary>
		/// Get IPv4 address from notation (xxx.xxx.xxx.xxx) or hostname (asynchronous version)
		/// </summary>
		public static void ResolveAsync(string ipOrHost, ResolveAddressCallback callback)
		{
			if (string.IsNullOrEmpty(ipOrHost))
				throw new ArgumentException("Supplied string must not be empty", "ipOrHost");

			ipOrHost = ipOrHost.Trim();

			NetAddress ipAddress = null;
			if (NetAddress.TryParse(ipOrHost, out ipAddress))
			{
				if (ipAddress.AddressFamily == AddressFamily.InterNetwork)
				{
					callback(ipAddress);
					return;
				}
				throw new ArgumentException("This method will not currently resolve other than ipv4 addresses");
			}

			// ok must be a host name
			IPHostEntry entry;
			try
			{
				Dns.BeginGetHostEntry(ipOrHost, delegate(IAsyncResult result)
				{
					try
					{
						entry = Dns.EndGetHostEntry(result);
					}
					catch (SocketException ex)
					{
						if (ex.SocketErrorCode == SocketError.HostNotFound)
						{
							//LogWrite(string.Format(CultureInfo.InvariantCulture, "Failed to resolve host '{0}'.", ipOrHost));
							callback(null);
							return;
						}
						else
						{
							throw;
						}
					}

					if (entry == null)
					{
						callback(null);
						return;
					}

					// check each entry for a valid IP address
					foreach (var ipCurrent in entry.AddressList)
					{
						if (ipCurrent.AddressFamily == AddressFamily.InterNetwork)
						{
							callback(ipCurrent);
							return;
						}
					}

					callback(null);
				}, null);
			}
			catch (SocketException ex)
			{
				if (ex.SocketErrorCode == SocketError.HostNotFound)
				{
					//LogWrite(string.Format(CultureInfo.InvariantCulture, "Failed to resolve host '{0}'.", ipOrHost));
					callback(null);
				}
				else
				{
					throw;
				}
			}
		}

		/// <summary>
		/// Get IPv4 address from notation (xxx.xxx.xxx.xxx) or hostname
		/// </summary>
		public static NetAddress Resolve(string ipOrHost)
		{
			if (string.IsNullOrEmpty(ipOrHost))
				throw new ArgumentException("Supplied string must not be empty", "ipOrHost");

			ipOrHost = ipOrHost.Trim();

			NetAddress ipAddress = null;
			if (NetAddress.TryParse(ipOrHost, out ipAddress))
			{
				if (ipAddress.AddressFamily == AddressFamily.InterNetwork)
					return ipAddress;
				throw new ArgumentException("This method will not currently resolve other than ipv4 addresses");
			}

			// ok must be a host name
			try
			{
				var addresses = Dns.GetHostAddresses(ipOrHost);
				if (addresses == null)
					return null;
				foreach (var address in addresses)
				{
					if (address.AddressFamily == AddressFamily.InterNetwork)
						return address;
				}
				return null;
			}
			catch (SocketException ex)
			{
				if (ex.SocketErrorCode == SocketError.HostNotFound)
				{
					//LogWrite(string.Format(CultureInfo.InvariantCulture, "Failed to resolve host '{0}'.", ipOrHost));
					return null;
				}
				else
				{
					throw;
				}
			}
		}

		/// <summary>
		/// Create a hex string from an Int64 value
		/// </summary>
		public static string ToHexString(long data)
		{
			return ToHexString(BitConverter.GetBytes(data));
		}

		/// <summary>
		/// Create a hex string from an array of bytes
		/// </summary>
		public static string ToHexString(byte[] data)
		{
			return ToHexString(data, 0, data.Length);
		}

		/// <summary>
		/// Create a hex string from an array of bytes
		/// </summary>
		public static string ToHexString(byte[] data, int offset, int length)
		{
			char[] c = new char[length * 2];
			byte b;
			for (int i = 0; i < length; ++i)
			{
				b = ((byte)(data[offset + i] >> 4));
				c[i * 2] = (char)(b > 9 ? b + 0x37 : b + 0x30);
				b = ((byte)(data[offset + i] & 0xF));
				c[i * 2 + 1] = (char)(b > 9 ? b + 0x37 : b + 0x30);
			}
			return new string(c);
		}

		/// <summary>
		/// Returns true if the endpoint supplied is on the same subnet as this host
		/// </summary>
		public static bool IsLocal(NetEndPoint endPoint)
		{
			if (endPoint == null)
				return false;
			return IsLocal(endPoint.Address);
		}

		/// <summary>
		/// Returns true if the IPAddress supplied is on the same subnet as this host
		/// </summary>
		public static bool IsLocal(NetAddress remote)
		{
			NetAddress mask;
			var local = GetMyAddress(out mask);

			if (mask == null)
				return false;

			uint maskBits = BitConverter.ToUInt32(mask.GetAddressBytes(), 0);
			uint remoteBits = BitConverter.ToUInt32(remote.GetAddressBytes(), 0);
			uint localBits = BitConverter.ToUInt32(local.GetAddressBytes(), 0);

			// compare network portions
			return ((remoteBits & maskBits) == (localBits & maskBits));
		}

		/// <summary>
		/// Returns how many bits are necessary to hold a certain number
		/// </summary>
		[CLSCompliant(false)]
		public static int BitsToHoldUInt(uint value)
		{
			int bits = 1;
			while ((value >>= 1) != 0)
				bits++;
			return bits;
		}

		/// <summary>
		/// Returns how many bytes are required to hold a certain number of bits
		/// </summary>
		public static int BytesToHoldBits(int numBits)
		{
			return (numBits + 7) / 8;
		}

		internal static UInt32 SwapByteOrder(UInt32 value)
		{
			return
				((value & 0xff000000) >> 24) |
				((value & 0x00ff0000) >> 8) |
				((value & 0x0000ff00) << 8) |
				((value & 0x000000ff) << 24);
		}

		internal static UInt64 SwapByteOrder(UInt64 value)
		{
			return
				((value & 0xff00000000000000L) >> 56) |
				((value & 0x00ff000000000000L) >> 40) |
				((value & 0x0000ff0000000000L) >> 24) |
				((value & 0x000000ff00000000L) >> 8) |
				((value & 0x00000000ff000000L) << 8) |
				((value & 0x0000000000ff0000L) << 24) |
				((value & 0x000000000000ff00L) << 40) |
				((value & 0x00000000000000ffL) << 56);
		}

		internal static bool CompareElements(byte[] one, byte[] two)
		{
			if (one.Length != two.Length)
				return false;
			for (int i = 0; i < one.Length; i++)
				if (one[i] != two[i])
					return false;
			return true;
		}

		/// <summary>
		/// Convert a hexadecimal string to a byte array
		/// </summary>
		public static byte[] ToByteArray(String hexString)
		{
			byte[] retval = new byte[hexString.Length / 2];
			for (int i = 0; i < hexString.Length; i += 2)
				retval[i / 2] = Convert.ToByte(hexString.Substring(i, 2), 16);
			return retval;
		}

		/// <summary>
		/// Converts a number of bytes to a shorter, more readable string representation
		/// </summary>
		public static string ToHumanReadable(long bytes)
		{
			if (bytes < 4000) // 1-4 kb is printed in bytes
				return bytes + " bytes";
			if (bytes < 1000 * 1000) // 4-999 kb is printed in kb
				return Math.Round(((double)bytes / 1000.0), 2) + " kilobytes";
			return Math.Round(((double)bytes / (1000.0 * 1000.0)), 2) + " megabytes"; // else megabytes
		}

		internal static int RelativeSequenceNumber(int nr, int expected)
		{
			return (nr - expected + NetConstants.NumSequenceNumbers + (NetConstants.NumSequenceNumbers / 2)) % NetConstants.NumSequenceNumbers - (NetConstants.NumSequenceNumbers / 2);

			// old impl:
			//int retval = ((nr + NetConstants.NumSequenceNumbers) - expected) % NetConstants.NumSequenceNumbers;
			//if (retval > (NetConstants.NumSequenceNumbers / 2))
			//	retval -= NetConstants.NumSequenceNumbers;
			//return retval;
		}

		/// <summary>
		/// Gets the window size used internally in the library for a certain delivery method
		/// </summary>
		public static int GetWindowSize(NetDeliveryMethod method)
		{
			switch (method)
			{
				case NetDeliveryMethod.Unknown:
					return 0;

				case NetDeliveryMethod.Unreliable:
				case NetDeliveryMethod.UnreliableSequenced:
					return NetConstants.UnreliableWindowSize;

				case NetDeliveryMethod.ReliableOrdered:
					return NetConstants.ReliableOrderedWindowSize;

				case NetDeliveryMethod.ReliableSequenced:
				case NetDeliveryMethod.ReliableUnordered:
				default:
					return NetConstants.DefaultWindowSize;
			}
		}

		// shell sort
		internal static void SortMembersList(System.Reflection.MemberInfo[] list)
		{
			int h;
			int j;
			System.Reflection.MemberInfo tmp;

			h = 1;
			while (h * 3 + 1 <= list.Length)
				h = 3 * h + 1;

			while (h > 0)
			{
				for (int i = h - 1; i < list.Length; i++)
				{
					tmp = list[i];
					j = i;
					while (true)
					{
						if (j >= h)
						{
							if (string.Compare(list[j - h].Name, tmp.Name, StringComparison.InvariantCulture) > 0)
							{
								list[j] = list[j - h];
								j -= h;
							}
							else
								break;
						}
						else
							break;
					}

					list[j] = tmp;
				}
				h /= 3;
			}
		}

		internal static NetDeliveryMethod GetDeliveryMethod(NetMessageType mtp)
		{
			if (mtp >= NetMessageType.UserReliableOrdered1)
				return NetDeliveryMethod.ReliableOrdered;
			else if (mtp >= NetMessageType.UserReliableSequenced1)
				return NetDeliveryMethod.ReliableSequenced;
			else if (mtp >= NetMessageType.UserReliableUnordered)
				return NetDeliveryMethod.ReliableUnordered;
			else if (mtp >= NetMessageType.UserSequenced1)
				return NetDeliveryMethod.UnreliableSequenced;
			return NetDeliveryMethod.Unreliable;
		}

		/// <summary>
		/// Creates a comma delimited string from a lite of items
		/// </summary>
		public static string MakeCommaDelimitedList<T>(IList<T> list)
		{
			var cnt = list.Count;
			StringBuilder bdr = new StringBuilder(cnt * 5); // educated guess
			for(int i=0;i<cnt;i++)
			{
				bdr.Append(list[i].ToString());
				if (i != cnt - 1)
					bdr.Append(", ");
			}
			return bdr.ToString();
		}

		public static byte[] ComputeSHAHash(byte[] bytes)
		{
			// this is defined in the platform specific files
			return ComputeSHAHash(bytes, 0, bytes.Length);
		}
	}
}


text:
{#-
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you 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.
-#}
{% extends g.theme.master %}

{% do g.register_forge_css('css/forge/deck.css') %}
{% do g.register_forge_js('js/project_groups.js', location='body_js_tail') %}

{% block title %}{{c.project.name}} / User Permissions {% endblock %}

{% block header %}User Permissions{% endblock %}

{% macro show_perms_for_role(role) %}

    {% for perm in permissions_by_role[role._id.__str__()] %}

         {{perm['name']}}

    {% endfor %}

{% endmacro %}
{% macro group_icon(icon) %}

{% endmacro %}

{% block content %}

Project permissions are assigned to groups of users. Add users to a group appropriate to the role they fill in your project. more...

By default, your project has three groups of progressively more privileged users (Member, Developer, and Admin groups). There are also catch alls for any logged in user (Authenticated) and any user even if they aren't logged in (Anonymous). Permissions allowed to a less privileged group are inherited by more privileged ones.

Group permissions can be toggled on and off by clicking on them. A permission with a barred circle icon is not granted to the group. A check icon means the permission is granted to the group. A check in a circle indicates that the permission is inherited from another group. To see where the permission is inherited from, hover over the permission and a tooltip will appear. less...

      Group
      Users
      Permissions

    {% for role in c.project.named_roles %}

        {{role.name}}{{group_icon('group')}}
        {% if role.name not in ['Admin', 'Developer', 'Member'] %}
        Remove
        {% endif %}

          {% for r in role.parent_roles() if r.name %}

All users in {{ r.name }} group

          {% endfor %}
          {% for r in role.users_with_role() %}

            {{ r.user.display_name }} ({{r.user.username}})

          {% endfor %}

            <form class="add_user">
              <input type="text" placeholder="type a username">
              <input type="submit" value="Save" class="nofloat">
              cancel
            </form>

            Add

      {{show_perms_for_role(role)}}

    {% endfor %}

      Authenticated{{group_icon('secure')}}

Any logged in user

      {{show_perms_for_role(auth_role)}}

      Anonymous{{group_icon('unsecure')}}

Any user including those not logged in

      {{show_perms_for_role(anon_role)}}

          Add a new group

{{c.admin_modal.display(content='

')}}
{% endblock %}

{% block extra_js %}

{% endblock %}


text:
What is it?
===========

**Postal Codes** is an application to show activity on a map based on postal code coordinates. It is designed for [Portugal](http://en.wikipedia.org/wiki/Portugal) specifically, but you can use it as a starting point to tailor it to another country if you wish. The code is [free](http://www.opensource.org/licenses/mit-license.php) after all.

Below you can see how it looks like in its default configuration (to fit standard widescreen TVs). However, the appearance can be easily [customized](https://github.com/carlosefr/postalcodes/wiki/Customizing) to fit your own branding just by replacing/modifying the background image and changing a couple of colors in a properties file.

![screenshot](https://raw.githubusercontent.com/carlosefr/postalcodes/master/screenshots/postalcodes.jpg)
[[video](http://www.youtube.com/watch?v=0PTb9AgNhrE)]

It works as a client-server application where the graphical portion listens on the network and one or more client agents on another (or the same) machine sends it postal codes to map on screen. The protocol is based on UDP and is very simple, so custom client agents are easy to make in whatever language you choose.

Besides the graphical application, based on [Processing](http://processing.org/), it also includes an [example client agent](more/testclient.py) and a [script](more/makedb.py) to import [GeoNames](http://www.geonames.org/postal-codes/postal-codes-portugal.html)' postal codes database into the required format.

What does it need to run?
=========================

  * [Java](https://jdk.java.net/) (either as a separate download or, preferably, the version included with Processing)
  * [Processing](http://processing.org/) Processing 3.5 (for the graphical application)
  * [UDP](http://ubaa.net/shared/processing/udp/) sockets library for Processing
  * [Python](http://python.org/) 3.7.7 or newer (optional, for the example agent and database import script)

Older versions of any of these packages may work, but haven't been tested. Newer versions should also work, and you should use them if possible.

**Postal Codes** has been tested on macOS 10.15, but it should work wherever Processing works.


text:
#ifndef STDLIB_H_
#define STDLIB_H_

#include <libcgc.h>
#include <stdarg.h>
#include <stddef.h>

extern int writeall(int fd, const void *buf, size_t n);
extern int debug_printf(const char *fmt, ...);
extern int fdprintf(int fd, const char *fmt, ...);
extern int sprintf(char *s, const char *fmt, ...);
extern int snprintf(char *s, size_t size, const char *fmt, ...);
extern int vsnprintf(char *s, size_t size, const char *fmt, va_list ap);
#define printf(...) fdprintf(1, __VA_ARGS__)

long strtol(const char *str, char **endptr, int base);
unsigned long strtoul(const char *str, char **endptr, int base);

extern void *malloc(size_t size);
extern void *calloc(size_t nmemb, size_t size);
extern void *realloc(void *ptr, size_t size);
extern void free(void *ptr);
extern size_t malloc_size(void *ptr);

static void cgc_exit(int ret)
{
    _terminate(ret);
}

#endif /* !STDLIB_H_ */


text:
class UserCallout < ActiveRecord::Base
  belongs_to :user

  # We use `UserCalloutEnums.feature_names` here so that EE can more easily
  # extend this `Hash` with new values.
  enum feature_name: ::UserCalloutEnums.feature_names

  validates :user, presence: true
  validates :feature_name,
    presence: true,
    uniqueness: { scope: :user_id },
    inclusion: { in: UserCallout.feature_names.keys }
end


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "grafts".
 *
 * @property integer $graftId
 * @property string $graftName
 *
 * @property GraftsPeoples[] $graftsPeoples
 */
class Grafts extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'grafts';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['graftName'], 'required'],
            [['graftName'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'graftId' => 'ID',
            'graftName' => 'Назва',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getGraftsPeoples()
    {
        return $this->hasMany(GraftsPeoples::className(), ['graftId' => 'graftId']);
    }
}


text:
using System;
using System.Collections.Generic;
using Encog.App.Analyst.CSV.Basic;

namespace Encog.App.Quant.Indicators
{
    /// <summary>
    ///     An indicator, used by Encog.
    /// </summary>
    public abstract class Indicator : BaseCachedColumn
    {
        /// <summary>
        ///     Construct the indicator.
        /// </summary>
        /// <param name="name">The indicator name.</param>
        /// <param name="input">Is this indicator used to predict?</param>
        /// <param name="output">Is this indicator what we are trying to predict.</param>
        public Indicator(String name, bool input,
                         bool output) : base(name, input, output)
        {
        }

        /// <value>the beginningIndex to set</value>
        public int BeginningIndex { get; set; }

        /// <value>the endingIndex to set.</value>
        public int EndingIndex { get; set; }

        /// <value>The number of periods this indicator is for.</value>
        public abstract int Periods { get; }

        /// <summary>
        ///     Calculate this indicator.
        /// </summary>
        /// <param name="data">The data available to this indicator.</param>
        /// <param name="length">The length of data to use.</param>
        public abstract void Calculate(IDictionary<String, BaseCachedColumn> data,
                                       int length);

        /// <summary>
        ///     Require a specific type of underlying data.
        /// </summary>
        /// <param name="theData">The data available.</param>
        /// <param name="item">The type of data we are looking for.</param>
        public void Require(IDictionary<String, BaseCachedColumn> theData,
                            String item)
        {
            if (!theData.ContainsKey(item))
            {
                throw new QuantError(
                    "To use this indicator, the underlying data must contain: "
                    + item);
            }
        }
    }
}


text:
package us.la.lft.traffic;

public class CameraImageUrlGenerator {
	// Original source for image values: http://www.lafayettela.gov/trafficcameras/traffic_cameras.aspx
	public static String getUrl(String image) {
		return "http://www.lafayettela.gov/tcams/getTCamera.aspx?ptzid=" + image;
	}
}


text:
using System;

namespace Umbraco.Core.Configuration.UmbracoSettings
{
    public interface IBackOfficeSection
    {
        ITourSection Tours { get; }
        string Id { get; }
    }
}


text:
<?php

namespace AppBundle\Form;

use AppBundle\Entity\Question;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class QuestionFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('question', TextareaType::class, [
            'label' => 'Вопрос',
        ]);

        $builder->add('variants', CollectionType::class, [
            'entry_type' => VariantFormType::class,
            'allow_add' => true,
            'allow_delete' => true,
            'label' => false,
            'prototype_name' => '__variant_number__',
            'by_reference' => false,
        ]);

        $builder->add('type', ChoiceType::class, [
            'label' => 'Тип вопроса:',
            'multiple' => false,
            'expanded' => true,
            'choices' => [
                'Ввести слово' => Question::TYPE_STRING_TYPEIN,
                'Ввести число' => Question::TYPE_NUMBER_TYPEIN,
                'Выбрать вариант из списка' => Question::TYPE_SINGLE_VARIANT,
                'Выбрать несколько вариантов' => Question::TYPE_MULTIPLE_VARIANTS,
            ],
            'label_attr' => [
                'class' => 'radio-inline'
            ],
        ]);

        $builder->add('price', IntegerType::class, [
            'required' => true,
            'empty_data' => 1,
            'label' => 'Баллов за ответ',
            'attr' => ['min' => 1, 'max' => 100],
        ]);

        $builder->add('precision', IntegerType::class, [
            'label' => 'Точность (минимальное кол-во знаков после запятой)',
            'empty_data' => 0,
            'required' => false,
            'attr' => ['min' => 0, 'max' => 100],
        ]);

        $builder->add('serialNumber', HiddenType::class);
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => Question::class,
        ]);
    }
}


text:
package org.springframework.cloud.gcp.autoconfigure.datastore.health;

import java.util.function.Supplier;

import com.google.cloud.datastore.Datastore;

import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.gcp.autoconfigure.datastore.DatastoreProvider;
import org.springframework.cloud.gcp.autoconfigure.datastore.GcpDatastoreAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * {@link HealthContributorAutoConfiguration Auto-configuration} for
 * {@link DatastoreHealthIndicator}.
 *
 * @author Raghavan N S
 * @author Srinivasa Meenavalli
 * @author Mike Eltsufin
 * @author Chengyuan Zhao
 *
 * @since 1.2
 */
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Datastore.class, HealthIndicator.class })
@ConditionalOnBean(value = Datastore.class, parameterizedContainer = Supplier.class)
@ConditionalOnEnabledHealthIndicator("datastore")
@AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(GcpDatastoreAutoConfiguration.class)
public class DatastoreHealthIndicatorAutoConfiguration {

	@Bean
	@ConditionalOnMissingBean
	public HealthIndicator datastoreHealthIndicator(DatastoreProvider datastore) {
		return new DatastoreHealthIndicator(datastore);
	}

}


text:
#include "Video.hpp"
#include "params.hpp"
#include "ONI_Video.hpp"
#include "util.hpp"
#include <boost/filesystem.hpp>
#ifdef DD_CXX11
#include <boost/filesystem/path.hpp>
#endif
#include "IKSynther.hpp"
#include "ICL_MetaData.hpp"
#include "MetaData_Pool.hpp"
#include "TestModel.hpp"
#include "RegEx.hpp"
#include "PXCSupport.hpp"
#include "MiscDataSets.hpp"
#include "Cache.hpp"
#include "NYU_Hands.hpp"
#include "ASTAR_Hands.hpp"
#include "Orthography.hpp"
#include "Colors.hpp"

namespace deformable_depth
{
  static string titleOfDirec(string filename)
  {
    boost::filesystem::path path(filename);
    return path.parent_path().leaf().c_str();
  }

  //
  // SECTION: Video, abstract base class
  //
  Video::~Video()
  {
  }

  bool Video::is_frame_annotated(int index)
  {
    return index % annotation_stride() == 0;
  }

  int Video::annotation_stride() const
  {
    return params::video_annotation_stride();
  }

  shared_ptr<MetaData> Video::getFrame_raw(int index,bool read_only)
  {
    return getFrame(index,read_only);
  }

  //
  // SECTION: Video: OpenCV/Def. Depth Video
  //
  shared_ptr< MetaData_YML_Backed > Video_CV_DD::HandDatumAssemblage
  (shared_ptr<BaselineDetection> annotation,shared_ptr<ImRGBZ> im)
  {
    // setup the image
    shared_ptr<Metadata_Simple> metadata(new Metadata_Simple(uuid(),true));
    metadata->setIm(*im);

    // now setup the annotations
    if(boost::regex_match(annotation->notes,boost::regex(".*left.*",boost::regex::icase)))
    {
      metadata->set_is_left_hand(true);
      log_file << "metadata->set_is_left_hand(true);" << endl;
    }
    else
    {
      metadata->set_is_left_hand(false);
      log_file << "metadata->set_is_left_hand(false);" << endl;
    }

    // set the bbs
    map<string,AnnotationBoundingBox> parts;
    metadata->set_HandBB(annotation->bb);
    for(auto && sub_det : annotation->parts)
    {
      static_cast<Rect_<double>&>(parts[sub_det.first]) = AnnotationBoundingBox(sub_det.second.bb,true);
    }
    metadata->setPositives(parts);

    return metadata;
  }

  shared_ptr< MetaData_YML_Backed > Video_CV_DD::getFrame(int index, bool read_only)
  {
    lock_guard<decltype(monitor)> l(monitor);
    log_file << "Video_CV_DD::getFrame: " << index << endl;

    ensure_read_ready();
    // load the image for frame and convert to a metadata
    string key = printfpp("frame%d",(int)index);
    if((*store_read)[key].empty())
    {
      log_file << "warning: (*store_read)[key].empty()" << endl;
      return nullptr;
    }
    shared_ptr<ImRGBZ> im; (*store_read)[key] >> im;

    // strip the image filename and get the metadata filename
    // test_data11.oni.frame0.im.gz => test_data11.oni.frame0(.labels.yml)
    const string img_filename =
      boost::regex_replace(im->filename,boost::regex(".im.gz"),string(""));
    string oni_filename = boost::regex_replace(    filename,boost::regex("/yml_videos/"),"/depth_video/");
           oni_filename = boost::regex_replace(oni_filename,boost::regex(".oni.yml.gz"),".oni");
    string metadata_filename =
	    printfpp("%s.frame%d",oni_filename.c_str(),index);
    log_once(safe_printf("Video_CV_DD::getFrame replaced % => %",im->filename,oni_filename));

    // load the metadata
    vector<shared_ptr<BaselineDetection>> gts;
    read_in_map((*store_read)[key + "gts"],gts);
    map<string, shared_ptr<MetaData_YML_Backed> > sub_data;
    for(auto && gt : gts)
    {
      shared_ptr< MetaData_YML_Backed > new_assemblage = HandDatumAssemblage(gt,im);
      auto poss = new_assemblage->get_positives();
      Rect handBB = poss["HandBB"];
      if(handBB != Rect())
      {
	log_file << "loaded: " << index << " \"" << gt->notes << "\"" << endl;
	sub_data[gt->notes] = new_assemblage;
      }
    }

    // load the left right annotation
    shared_ptr< MetaData_YML_Backed > result;
    if(sub_data.empty())
    {
      auto metadata = make_shared<Metadata_Simple>(metadata_filename,read_only);
      metadata->setIm(*im);
      log_file << "Video_CV_DD::getFrame simple" << endl;
      result = metadata;
    }
    else
    {
      result = make_shared<MetaDataAggregate>(sub_data);
      log_file << "Video_CV_DD::getFrame aggregate" << endl;
    }
    result->change_filename(metadata_filename);

    return result;
  }

  void Video_CV_DD::ensure_read_ready() const
  {
    lock_guard<decltype(monitor)> lock(monitor);
    if(store_read == nullptr)
      store_read.reset(new FileStorage(filename,FileStorage::READ));
  }

  void Video_CV_DD::ensure_store_ready()
  {
    lock_guard<decltype(monitor)> lock(monitor);

    while(store_write == nullptr)
    {
      cout << safe_printf("Video_CV_DD::ensure_store_ready allocating %",filename) << cout;
      store_write.reset(new FileStorage(filename,FileStorage::WRITE));
    }

    while(not store_write->isOpened())
    {
      cout << safe_printf("Video_CV_DD::ensure_store_ready opening %",filename) << cout;
      store_write->open(filename,FileStorage::WRITE);
    }

    assert(store_write->isOpened());
  }

  void Video_CV_DD::writeFrame(shared_ptr< ImRGBZ >& frame, const vector< shared_ptr<BaselineDetection> >&gts,bool leftP,int index)
  {
    ensure_store_ready();

    string key = printfpp("frame%d",index < 0?(int)length:index);
    *store_write << key << frame;
    *store_write << (key + "leftP") << leftP;
    string s;
    *store_write << (key + "gts"); write_in_map(*store_write,s,gts);
    //*store_write << (key + "gts") << gts;
    //*store_write << (key + "poss"); write(*store_write,s,poss);

    length++;
  }

  void Video_CV_DD::setAnnotationStride(int stride)
  {
    ensure_store_ready();

    *store_write << "annotation_stride" << stride;
  }

  int Video_CV_DD::annotation_stride() const
  {
    ensure_read_ready();
    int annotation_stride; (*store_read)["annotation_stride"] >> annotation_stride;
    return annotation_stride;
  }

  int Video_CV_DD::getNumberOfFrames()
  {
    lock_guard<decltype(monitor)> l(monitor);
    if(store_read == nullptr)
      store_read.reset(new FileStorage(filename,FileStorage::READ));

    if(length == -1)
    {
      // find the max frame numbers
      for(auto iter = store_read->root().begin(); iter != store_read->root().end(); ++iter)
      {
	FileNode current_node = *iter;
	string node_name = current_node.name();
	vector<string> matches = deformable_depth::regex_match(node_name,boost::regex("\\d+"));
	for(string s : matches)
	{
	  int frame_number = fromString<int>(s);
	  length = std::max(length,frame_number);
	}
      }
    }

    //int frame_cnt = store_read->root().size();
    return length;
  }

  Video_CV_DD::Video_CV_DD(string filename) :
    filename(filename),
    length(-1)
  {
  }

  Video_CV_DD::~Video_CV_DD()
  {
  }

  string Video_CV_DD::get_name()
  {
    boost::filesystem::path v_path(filename);
    return v_path.leaf().string();
  }

  // section, show a frame from a video
  void show_frame()
  {
    // parse the command line
    string video_filename = g_params.get_value("video");
    int frame_index = fromString<int>(g_params.get_value("frame"));

    Mat frame_image;
    Mat depth_frame;
    if(boost::regex_match(video_filename,boost::regex(".*oni")))
    {
      cout << "Using dd::ONI_Video" << endl;
#ifdef DD_ENABLE_OPENNI
      ONI_Video video(video_filename);
      shared_ptr<MetaData> frame = video.getFrame_raw(frame_index,true);
      shared_ptr<ImRGBZ> im = frame->load_im();
      frame_image = im->RGB.clone();
      depth_frame = im->Z.clone();
      cout << "depth size: " << depth_frame.size() << endl;
      cout << "color size: " << frame_image.size() << endl;
      // let the user crop
      Rect cropRect = getRect("Crop Rect", frame_image);
      cout << "crop Rect = " << cropRect << endl;
      cout << "skin_ratio = " << im->skin_ratio(cropRect) << endl;
      frame_image = frame_image(cropRect);
      depth_frame = depth_frame(cropRect);
#else
      assert(false);
#endif
    }
    else
    {
      // grab the frame
      cout << "Using cv::VideoCapture" << endl;
      cv::VideoCapture frame_reader(video_filename);
      cout << "video's frame count: " << frame_reader.get(CV_CAP_PROP_FRAME_COUNT) << endl;
      frame_reader.set(CV_CAP_PROP_POS_FRAMES,frame_index);
      frame_reader.read(frame_image);
      frame_reader.release();
    }

    // show it
    image_safe("Frame - RGB",frame_image);
    if(!depth_frame.empty())
      imageeq("Frame - Depth",depth_frame);
    waitKey_safe(0);
  }

  void export_annotations_codalab(int trackbar_value,shared_ptr<MetaData> datum)
  {
    //string prefix = safe_printf(params::our_dir() + "annotations_%d",trackbar_value);
    //ofstream ofs(prefix);
    // TODO?
  }

  // make -j16 &&  ./deformable_depth show_video VIDEO=data/depth_video/bailey.oni NO_BACKGROUND_REPAINTER=TRUE
  void show_video()
  {
    shared_ptr< Video > video = load_video(g_params.require("VIDEO"));
    if(!video)
    {
      cout << "Failed to load Video!" << endl;
      return;
    }
    cout << "Loaded video with frame count = " << video->getNumberOfFrames() << endl;
    int trackbar_value;
    namedWindow("frame");
    createTrackbar("frame_trackbar","frame",&trackbar_value,video->getNumberOfFrames());

    shared_ptr<MetaData> datum = video->getFrame(0,true);
    for(trackbar_value = 0; true; ++trackbar_value)
    {
      // get the images
      shared_ptr<MetaData> newDatum = video->getFrame(trackbar_value,true);
      if(newDatum)
	datum = newDatum;
      Mat RGB(params::depth_vRes,params::depth_hRes,DataType<Vec3b>::type,Scalar(0,0,0));
      Mat Z(params::depth_vRes,params::depth_hRes,DataType<float>::type,Scalar(0,0,0));
      if(datum)
      {
	RGB = datum->load_im()->RGB.clone();
	Z = datum->load_im()->Z.clone();
	// show to codalab
	export_annotations_codalab(trackbar_value,datum);
      }
      Mat visZ = imageeq("",Z,false,false);

      // decorate the images
      if(g_params.option_is_set("SHOW_VIDEO_ANNOTATIONS"))
      {
	for(auto && sub_datum : datum->get_subdata())
	{
	  Rect handBB = sub_datum.second->get_positives()["HandBB"];
	  cv::rectangle(RGB,handBB.tl(),handBB.br(),Scalar(0,0,255));
	  cv::rectangle(visZ,handBB.tl(),handBB.br(),Scalar(0,0,255));
	  log_file << "drawing: " << sub_datum.first << " " << handBB.size() << endl;
	  // draw the parts
	  for(auto && part : sub_datum.second->get_positives())
	  {
	    if(part.first != "HandBB")
	    {
	      cv::rectangle(RGB,part.second.tl(),part.second.br(),Scalar(255,0,0));
	      cv::rectangle(visZ,part.second.tl(),part.second.br(),Scalar(255,0,0));
	    }
	  }
	  // draw the keypoitns
	  for(auto && kp_name : sub_datum.second->keypoint_names())
	  {
	    pair<Point3d,bool> kp = sub_datum.second->keypoint(kp_name);
	    Point2i kp_center(kp.first.x,kp.first.y);
	    cv::circle(RGB,Point(kp_center),5,toScalar(BLUE),-1);
	    cv::circle(visZ,Point(kp_center),5,toScalar(BLUE),-1);
	  }
	}
      }

      // paint an orthographic version
      //shared_ptr<ImRGBZ> im = datum->load_im();
      //Mat vis_ortho = imageeq("",paint_orthographic(*im),false,false);

      // show the images
      image_safe("frame",horizCat(RGB,visZ));
      setTrackbarPos("frame_trackbar","frame",trackbar_value);
      waitKey_safe(20);

      if(trackbar_value >= video->getNumberOfFrames())
	trackbar_value = 0;
    }
  }

  //
  // SECTION: Video format conversion
  //
  static void export_frame_2_dataset(
    shared_ptr<Video> input_video,
    string export_dir,
    shared_ptr<MetaData> metadata,
    int frameIter)
  {
    shared_ptr<ImRGBZ> im = metadata->load_im();
    Mat vis = horizCat(imageeq("Converting Depth Frame",im->Z,false,false),im->RGB);
    image_safe("converting",vis);
    log_im(input_video->get_name() + std::to_string(frameIter),vis);

    // save to the export directory
    if(export_dir != "")
    {
      // write the depths
      imwrite(export_dir + printfpp("depth_%05d",(int)frameIter) + ".exr",im->Z);
      imwrite(export_dir + printfpp("depth_%05d",(int)frameIter) + ".png",depth_float2uint16(im->Z));
      imwrite(export_dir + printfpp("raw_depth_%05d",(int)frameIter) + ".png",depth_float2uint16(metadata->load_raw_depth()));

      // write the RGB
      Mat ZVis = imageeq("",im->Z,false,false);
      Mat rawRGB = metadata->load_raw_RGB();
      Mat RGB_Vis; cv::resize(rawRGB,RGB_Vis,im->Z.size());
      imwrite(export_dir + printfpp("registered_color_%05d",(int)frameIter) + ".png",im->RGB);
      imwrite(export_dir + printfpp("raw_color_%05d",(int)frameIter) + ".png",rawRGB);
      imwrite(export_dir + printfpp("both_%05d",(int)frameIter) + ".png",vertCat(RGB_Vis,ZVis));

      // write the semantic segmentation and annotations
      string note_file = printfpp((export_dir + "/gen%05d.annotations").c_str(),(int)frameIter);
      metadata->export_annotations(note_file);
      string kp_file = printfpp((export_dir + "/gen%05d.keypoints").c_str(),(int)frameIter);
      metadata->export_keypoints(kp_file);
      //string gt_file = printfpp((export_dir + "/gt_%05d.csv").c_str(),(int)frameIter);
      //metadata->export_one_line_per_hand(gt_file);
      Mat seg = metadata->getSemanticSegmentation();
      if(not seg.empty())
	imwrite(export_dir + printfpp("seg_%05d",(int)frameIter) + ".png",seg);
    }
  }

  static void do_export_video(shared_ptr<Video>   input_video, string YML_filename, string export_dir = "")
  {
    TaskBlock do_export_video("do_export_video");
    int n_frames = input_video->getNumberOfFrames();
    for(int frameIter = 0; frameIter < n_frames; frameIter += input_video->annotation_stride())
    {
      do_export_video.add_callee([&,frameIter]()
				 {
				   shared_ptr<MetaData> metadata = input_video->getFrame_raw(frameIter,true);
				   if(metadata)
				     export_frame_2_dataset(input_video,export_dir, metadata,frameIter);
				 });
    }
    do_export_video.execute();
  }

  static void do_convert_export_video(shared_ptr<Video>   input_video, string YML_filename, string export_dir = "")
  {
    // create the videos
    log_file << "do_convert_export_video: " << YML_filename <<
      " export_dir = " << export_dir <<
      " frames = " << input_video->getNumberOfFrames() << endl;
    Video_CV_DD cv_video(YML_filename);
    cv_video.setAnnotationStride(input_video->annotation_stride());

    // copy each frame from the Input_Video to the CV Video
    int n_frames = input_video->getNumberOfFrames();
    for(int frameIter = 0; frameIter < n_frames; frameIter += 1)
    {
      if(!input_video->is_frame_annotated(frameIter))
	continue;

      // write the image
      cout << printfpp("frame %d of %d",frameIter,n_frames) << endl;
      shared_ptr<MetaData> metadata = input_video->getFrame_raw(frameIter,true);
      if(metadata)
      {
	// write the annotations?
	auto input_poss = metadata->get_positives();
	bool leftP = metadata->leftP();

	// export to the dataset
	export_frame_2_dataset(input_video,export_dir, metadata, frameIter);

	// commit the frame
	shared_ptr<ImRGBZ> im = metadata->load_im();
	auto gts = metadata->ground_truths();
	cv_video.writeFrame(im,gts,leftP,frameIter);
      }
    }
  }

  void convert_video(int argc, char**argv)
  {
#ifdef DD_ENABLE_OPENNI
    {
      // get the filenames
      string oni_filename = g_params.get_value("INPUT");
      string YML_filename  = g_params.get_value("YML");

      shared_ptr<Video>   input_video = load_video(oni_filename);
      do_convert_export_video(input_video,YML_filename);
    }

    std::exit(0);
#else
    throw std::runtime_error("unsupported");
#endif
  }

  // rm -rv ./outs/*; rm -rv ./data/yml_videos/*; make -j16 && gdb ./deformable_depth -ex 'catch throw' -ex 'r convert_all_videos CFG_FILE=scripts/hand_convert.cfg'
  // ./www/compress_vids.py
  void convert_all_videos()
  {
    cout << "+convert_all_videos()" << endl;
    TaskBlock convert_all_videos("convert_all_videos");
    vector<string> vids = test_video_filenames();
    string message = safe_printf("+convert_all_videos() % vids",vids.size());
    log_file << message << endl;
    cout << message << endl;
    static std::recursive_mutex m;

    auto export_vid = [&](string input_filename, bool convert)
    {
      // (1) load the video
      unique_lock<recursive_mutex> l(m);
      cout << "converting " << input_filename << endl;
      shared_ptr<Video>   input_video = load_video(input_filename);

      // (2) generate the output filename
      string output_filename = string("data/yml_videos/") + input_video->get_name() + ".yml.gz";
      log_once(printfpp("converting %s to %s",input_filename.c_str(),output_filename.c_str()));

      // (3) generate the output directory name
      boost::filesystem::path export_path(
	string("./data/yml_videos/") + input_video->get_name() + "/");
      log_file << safe_printf("export_dir = %",export_path.string()) << endl;

      // (4) create the output directory (if necessay)
      if(!boost::filesystem::exists(export_path.string()))
	boost::filesystem::create_directory(export_path.string());
      l.unlock();
      // (5) write the video into the output directory
      if(convert)
	do_convert_export_video(input_video,output_filename,export_path.string());
      else
	do_export_video(input_video,output_filename,export_path.string());
    };

    for(string & input_filename : vids)
    {
      convert_all_videos.add_callee([&,input_filename]()
				    {
				      export_vid(input_filename,true);
				    });
    }
    for(auto & export_only_pair : g_params.matching_keys("EXPORT_ONLY_VIDEO_FILE.*"))
    {
      convert_all_videos.add_callee([&,export_only_pair]()
				    {
				      export_vid(export_only_pair.second,false);
				    });
    }
    convert_all_videos.execute();
    cout << "-convert_all_videos()" << endl;
  }

  ///
  /// SECTION: LoadVideo
  ///
  static shared_ptr< Video > do_load_video(string filename)
  {
    // we have three types of video we support
    // .ONI
    // .yml.gz
    // directory
    boost::filesystem::path vid_path(filename);
    shared_ptr<Video> ptr;
    if(vid_path.extension() != "")
    {
      log_file << printfpp("Loading video %s w/ ext = %s",filename.c_str(),vid_path.extension().c_str()) << endl;
      if(vid_path.extension() == ".ASTAR_HANDS")
	ptr = make_shared<ASTAR_Video>(fromString<int>(vid_path.stem().string()));
      //else if(vid_path.extension() == ".PTB")
      //ptr = make_shared<PTB_Video>(vid_path.stem().string());
      else if(vid_path == "0.NYU_HANDS")
	ptr = make_shared<NYU_Video>();
      else
#ifdef DD_ENABLE_OPENNI
      if(vid_path.extension() == ".oni")
	ptr = shared_ptr<Video>(new ONI_Video(filename));
      else
#endif
      if(vid_path.extension() == ".gz")
	ptr = shared_ptr<Video>(new Video_CV_DD(filename));
      else if(vid_path.extension() == ".ICL")
	ptr = shared_ptr<Video>(new ICL_Video(filename));
    }
    else
    {
      log_file << safe_printf("% has no extension",filename) << endl;
#ifdef DD_ENABLE_HAND_SYNTH
      if(boost::regex_match(filename,boost::regex(".*ego.*",boost::regex::icase)))
	ptr = shared_ptr<Video>(new VideoDirectory(filename));
      else
	ptr = shared_ptr<Video>(new VideoMetaDataDirectory(filename));
#endif
    }

    log_file << safe_printf("do_load_video: % %",filename,typeid(ptr.get()).name()) << endl;
    return ptr;
  }

  shared_ptr< Video > load_video(string filename)
  {
    static Cache<shared_ptr<Video> > vid_pool;

    return vid_pool.get(filename,[&]()
			{
			  return do_load_video(filename);
			});
  }

  ///
  /// SECTION: Video Directory
  ///
#ifdef DD_ENABLE_HAND_SYNTH
  string VideoDirectory::get_name()
  {
    return title;
  }

  void VideoDirectory::loadAnnotations(shared_ptr<MetaDataAggregate>&metadata,int index,const Mat&D)
  {
    log_once(safe_printf("VideoDirectory::loadAnnotations++  %",metadata->get_filename()));
    // write the annotations
    string annotation_filename1 = filename + "/" + printfpp("frame%d-1-Depth.txt",index);
    string annotation_filename2 = filename + "/" + printfpp("frame%d-2-Depth.txt",index);
    IK_Grasp_Pose pose;
    if(boost::filesystem::exists(annotation_filename1))
    {
      // 1 is right hand
      IK_Grasp_Pose pose1 = greg_load_grasp_pose_one(filename,annotation_filename1,false);
      setAnnotations(metadata->get_subdata_yml().at("right_hand"),pose1);
      metadata->get_subdata_yml().at("right_hand")->set_is_left_hand(false);
      log_once(safe_printf("VideoDirectory::loadAnnotations got RIGHT %",metadata->get_filename()));
    }
    if(boost::filesystem::exists(annotation_filename2))
    {
      // 2 is left hand
      IK_Grasp_Pose pose2 = greg_load_grasp_pose_one(filename,annotation_filename2,false);

      setAnnotations(metadata->get_subdata_yml().at("left_hand"),pose2);
      metadata->get_subdata_yml().at("left_hand")->set_is_left_hand(true);
      log_once(safe_printf("VideoDirectory::loadAnnotations got LEFT %",metadata->get_filename()));
    }
  }

  shared_ptr<VideoDirectoryDatum> load_video_directory_datum(string directory, int index)
  {
    string depth_filename = directory + "/" + printfpp("frame%d.mat.exr",index);
    string rgb_filename = directory + "/" + printfpp("frame%d.mat.png",index);
    log_file << "DirVideo: " << depth_filename << " " << rgb_filename << endl;
    Mat D   = imread(depth_filename,CV_LOAD_IMAGE_ANYDEPTH|CV_LOAD_IMAGE_GRAYSCALE);
    if(D.empty())
    {
      cout << "warning couldn't load " << depth_filename << endl;
      return nullptr;
    }
    D = 0.1 * D.t();
    Mat RGB = imread(rgb_filename);

    // load the UV Map
    string u_filename = directory + "/" + printfpp("frame%d.matu.exr",index);
    string v_filename = directory + "/" + printfpp("frame%d.matv.exr",index);
    Mat u = imread(u_filename,CV_LOAD_IMAGE_ANYDEPTH|CV_LOAD_IMAGE_GRAYSCALE);
    Mat v = imread(v_filename,CV_LOAD_IMAGE_ANYDEPTH|CV_LOAD_IMAGE_GRAYSCALE);
    if(u.empty() or v.empty() or u.size() != v.size())
    {
      log_file << "warning bad UV map" << endl;
      return nullptr;
    }
    u.convertTo(u,DataType<float>::type);
    u = u.reshape(0,u.cols);
    v.convertTo(v,DataType<float>::type);
    v = v.reshape(0,v.cols);
    Mat UV; cv::merge(vector<Mat>{u,v},UV);
    assert(UV.type() == DataType<Vec2f>::type);

    return make_shared<VideoDirectoryDatum>(D,RGB,UV);
  }

  // here we load a video converted from Greg's format using the matlab/mat2exr.m script
  shared_ptr< MetaData_YML_Backed > VideoDirectory::getFrame(int index, bool read_only)
  {
    index++;
    // load the image data
    shared_ptr<VideoDirectoryDatum> vdd = load_video_directory_datum(filename,index);
    if(!vdd)
      return nullptr;

    // form the metadatum
    string metadata_filename = filename + "/" + printfpp("frame%d_metadata.yml.gz",index);
    shared_ptr<MetaDataAggregate> metadata = form_Metadatum(vdd->RGB,vdd->D,vdd->UV,
							    get_name() + "_" + printfpp("_%d_raw",index),metadata_filename);
    if(is_frame_annotated(index))
      loadAnnotations(metadata,index,vdd->D);

    return metadata;
  }

  int VideoDirectory::getNumberOfFrames()
  {
    if(length == -1)
    {
      vector<string> gt_files = find_files(filename,boost::regex(".*exr"));
      length =  gt_files.size();
    }
    return length;
  }

  VideoDirectory::VideoDirectory(string filename) :
    filename(filename)
  {
    // extract the video's title from its filename
    title = titleOfDirec(filename);
    log_once(safe_printf("opening VideoDirectory = %",filename));
  }

  VideoDirectory::~VideoDirectory()
  {
  }

  bool VideoDirectory::is_frame_annotated(int index)
  {
    string annotation_filename1 = filename + "/" + printfpp("frame%d-1-Depth.txt",index);
    string annotation_filename2 = filename + "/" + printfpp("frame%d-2-Depth.txt",index);
    string frame_gt_file = printfpp("frame%d_RGB_GT.png",index);
    string rgb_vis_path = filename + "/" + frame_gt_file;

    bool frame_annotated = false;
    for(auto path : vector<string>{annotation_filename1,annotation_filename2,rgb_vis_path})
      if(boost::filesystem::exists(path))
	 frame_annotated = true;

    if(frame_annotated)
    {
      log_once(safe_printf("VideoDirectory::is_frame_annotated YES %",annotation_filename1));
      return true;
    }
    else
    {
      log_once(safe_printf("VideoDirectory::is_frame_annotated NO %",annotation_filename1));
      return false;
    }
  }
#endif

  ///
  /// SECTION: VideoMetaDataDirectory
  ///
  VideoMetaDataDirectory::VideoMetaDataDirectory(string filename) : filename(filename)
  {
    // extract the video's title from its filename
    title = titleOfDirec(filename);

    // load the frames
    frames = metadata_build_all(filename, false, true);
    log_once(safe_printf("VideoMetaDataDirectory::VideoMetaDataDirectory % %",filename,frames.size()));
  }

  VideoMetaDataDirectory::~VideoMetaDataDirectory()
  {
  }

  shared_ptr<MetaData_YML_Backed> VideoMetaDataDirectory::getFrame(int index,bool read_only)
  {
    shared_ptr<MetaData> datum = getFrame_raw(index,read_only);
    shared_ptr<MetaData_Pooled> pooled_datum =
      std::dynamic_pointer_cast<MetaData_Pooled>(datum);
    assert(pooled_datum);
    shared_ptr<MetaData_YML_Backed> yml_datum =
      std::dynamic_pointer_cast<MetaData_YML_Backed>(pooled_datum->getBackend());
    assert(yml_datum);
    return yml_datum;
  }

  shared_ptr<MetaData> VideoMetaDataDirectory::getFrame_raw(int index,bool read_only)
  {
    int frame_index = clamp<int>(0,index,frames.size());
    shared_ptr<MetaData> datum = frames[frame_index];
    assert(datum);
    return datum;
  }

  int VideoMetaDataDirectory::getNumberOfFrames()
  {
    return frames.size();
  }

  string VideoMetaDataDirectory::get_name()
  {
    return title;
  }

  bool VideoMetaDataDirectory::is_frame_annotated(int index)
  {
    return true;
  }

  int VideoMetaDataDirectory::annotation_stride() const
  {
    string annotation_file = filename + "annotation_stride";
    if(boost::filesystem::exists(annotation_file))
    {
      log_once(string("using annotation file = ") + annotation_file);
      ifstream ifs(annotation_file);
      int stride; ifs >> stride;
      return stride;
    }
    else
    {
      return 1;
      //return params::video_annotation_stride();
    }
  }

  //
  // SECTION: Convert public to private video names
  //
  string vid_public_name(string private_name)
  {
    string map_filename = "www/eq_names.csv";
    ifstream ifs(map_filename);
    while(ifs)
    {
      string line; std::getline(ifs,line);
      istringstream iss(line);
      string priv; std::getline(iss,priv,',');
      string publ; std::getline(iss,publ,',');
      if(priv == private_name)
	return publ;
    }
    string err_msg = safe_printf("vid_public_name bad private name %",private_name);
    cout << err_msg << endl;
    log_file << err_msg << endl;
    throw std::runtime_error(err_msg);
  }

  int vid_type_id(string vidName)
  {
    if(boost::regex_match(vidName,boost::regex(".*(Greg|Marga).*")))
      return 5;
    if(boost::regex_match(vidName,boost::regex(".*sequ.*")))
      return 4;
    else if(boost::regex_match(vidName,boost::regex(".*NYU.*")))
      return 3;
    else if(boost::regex_match(vidName,boost::regex(".*ASTAR.*")))
      return 2;
    else if(boost::regex_match(vidName,boost::regex(".*ICL.*")))
      return 1;
    else
      return 0;
  }
}


text:
// #region License
//
//
//
// #endregion

using System;
using System.Globalization;
using System.Windows.Data;

namespace Pickles.UserInterface.Mvvm
{
    public class BooleanToInvisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is bool && (bool)value)
            {
                return System.Windows.Visibility.Hidden;
            }

            return System.Windows.Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}


text:
<?php
session_start();

echo $_SESSION['gebruiker_ingelogd'];

?>


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

using Test.Cryptography;

namespace System.Tests
{
    public partial class ConvertTests
    {
        [Theory]
        [InlineData(new byte[0], "")]
        [InlineData(new byte[] { 5, 6, 7, 8 }, "BQYHCA==")]
        public void ToBase64String_Span_ProducesExpectedOutput(byte[] input, string expected)
        {
            Assert.Equal(expected, Convert.ToBase64String(input.AsSpan()));
            Assert.Equal(expected, Convert.ToBase64String(input.AsSpan(), Base64FormattingOptions.None));
            Assert.Equal(expected, Convert.ToBase64String(input.AsSpan(), Base64FormattingOptions.InsertLineBreaks));
        }

        [Fact]
        public void ToBase64String_Span_LongWithOptions_ProducesExpectedOutput()
        {
            byte[] input = Enumerable.Range(0, 120).Select(i => (byte)i).ToArray();

            Assert.Equal(
                "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4" +
                "OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx" +
                "cnN0dXZ3",
                Convert.ToBase64String(input));

            Assert.Equal(
                "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4" +
                "OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx" +
                "cnN0dXZ3",
                Convert.ToBase64String(input, Base64FormattingOptions.None));

            Assert.Equal(
                "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4\r\n" +
                "OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx\r\n" +
                "cnN0dXZ3",
                Convert.ToBase64String(input, Base64FormattingOptions.InsertLineBreaks));
        }

        [Theory]
        [InlineData((Base64FormattingOptions)(-1))]
        [InlineData((Base64FormattingOptions)(2))]
        public void ToBase64String_Span_InvalidOptions_Throws(Base64FormattingOptions invalidOption)
        {
            AssertExtensions.Throws<ArgumentException>("options", () => Convert.ToBase64String(new byte[0].AsSpan(), invalidOption));
        }

        [Theory]
        [InlineData(new byte[0], "")]
        [InlineData(new byte[] { 5, 6, 7, 8 }, "BQYHCA==")]
        public void TryToBase64Chars_ProducesExpectedOutput(byte[] input, string expected)
        {
            Span<char> dest;

            // Just right
            dest = new char[expected.Length];
            Assert.True(Convert.TryToBase64Chars(input.AsSpan(), dest, out int charsWritten));
            Assert.Equal(expected.Length, charsWritten);
            Assert.Equal<char>(expected.ToCharArray(), dest.ToArray());

            // Too short
            if (expected.Length > 0)
            {
                dest = new char[expected.Length - 1];
                Assert.False(Convert.TryToBase64Chars(input.AsSpan(), dest, out charsWritten));
                Assert.Equal(0, charsWritten);
            }

            // Longer than needed
            dest = new char[expected.Length + 1];
            Assert.True(Convert.TryToBase64Chars(input.AsSpan(), dest, out charsWritten));
            Assert.Equal(expected.Length, charsWritten);
            Assert.Equal<char>(expected.ToCharArray(), dest.Slice(0, expected.Length).ToArray());
            Assert.Equal(0, dest[dest.Length - 1]);
        }

        [Theory]
        [InlineData((Base64FormattingOptions)(-1))]
        [InlineData((Base64FormattingOptions)(2))]
        public void TryToBase64Chars_InvalidOptions_Throws(Base64FormattingOptions invalidOption)
        {
            AssertExtensions.Throws<ArgumentException>("options",
                () => Convert.TryToBase64Chars(new byte[0].AsSpan(), new char[0].AsSpan(), out int charsWritten, invalidOption));
        }

        [Theory]
        [MemberData(nameof(Base64TestData))]
        public static void TryFromBase64String(string encoded, byte[] expected)
        {
            if (expected == null)
            {
                Span<byte> actual = new byte[1000];
                bool success = Convert.TryFromBase64String(encoded, actual, out int bytesWritten);
                Assert.False(success);
                Assert.Equal(0, bytesWritten);
            }
            else
            {
                // Exact-sized buffer
                {
                    byte[] actual = new byte[expected.Length];
                    bool success = Convert.TryFromBase64String(encoded, actual, out int bytesWritten);
                    Assert.True(success);
                    Assert.Equal<byte>(expected, actual);
                    Assert.Equal(expected.Length, bytesWritten);
                }

                // Buffer too short
                if (expected.Length != 0)
                {
                    byte[] actual = new byte[expected.Length - 1];
                    bool success = Convert.TryFromBase64String(encoded, actual, out int bytesWritten);
                    Assert.False(success);
                    Assert.Equal(0, bytesWritten);
                }

                // Buffer larger than needed
                {
                    byte[] actual = new byte[expected.Length + 1];
                    actual[expected.Length] = 99;
                    bool success = Convert.TryFromBase64String(encoded, actual, out int bytesWritten);
                    Assert.True(success);
                    Assert.Equal(99, actual[expected.Length]);
                    Assert.Equal<byte>(expected, actual.Take(expected.Length));
                    Assert.Equal(expected.Length, bytesWritten);
                }
            }
        }

        [Theory]
        [MemberData(nameof(Base64TestData))]
        public static void TryFromBase64Chars(string encodedAsString, byte[] expected)
        {
            ReadOnlySpan<char> encoded = encodedAsString;  // Executing the conversion to ROS here so people debugging don't have to step through it at the api callsite.
            if (expected == null)
            {
                Span<byte> actual = new byte[1000];
                bool success = Convert.TryFromBase64Chars(encoded, actual, out int bytesWritten);
                Assert.False(success);
                Assert.Equal(0, bytesWritten);
            }
            else
            {
                // Exact-sized buffer
                {
                    byte[] actual = new byte[expected.Length];
                    bool success = Convert.TryFromBase64Chars(encoded, actual, out int bytesWritten);
                    Assert.True(success);
                    Assert.Equal<byte>(expected, actual);
                    Assert.Equal(expected.Length, bytesWritten);
                }

                // Buffer too short
                if (expected.Length != 0)
                {
                    byte[] actual = new byte[expected.Length - 1];
                    bool success = Convert.TryFromBase64Chars(encoded, actual, out int bytesWritten);
                    Assert.False(success);
                    Assert.Equal(0, bytesWritten);
                }

                // Buffer larger than needed
                {
                    byte[] actual = new byte[expected.Length + 1];
                    actual[expected.Length] = 99;
                    bool success = Convert.TryFromBase64Chars(encoded, actual, out int bytesWritten);
                    Assert.True(success);
                    Assert.Equal(99, actual[expected.Length]);
                    Assert.Equal<byte>(expected, actual.Take(expected.Length));
                    Assert.Equal(expected.Length, bytesWritten);
                }
            }
        }

        public static IEnumerable<object[]> Base64TestData
        {
            get
            {
                foreach (Tuple<string, byte[]> tuple in Base64TestDataSeed)
                {
                    yield return new object[] { tuple.Item1, tuple.Item2 };
                    yield return new object[] { InsertSpaces(tuple.Item1, 1), tuple.Item2 };
                    yield return new object[] { InsertSpaces(tuple.Item1, 4), tuple.Item2 };
                }
            }
        }

        public static IEnumerable<Tuple<string, byte[]>> Base64TestDataSeed
        {
            get
            {
                // Empty
                yield return Tuple.Create<string, byte[]>("", Array.Empty<byte>());

                // All whitespace characters.
                yield return Tuple.Create<string, byte[]>(" \t\r\n", Array.Empty<byte>());

                // Pad characters
                yield return Tuple.Create<string, byte[]>("BQYHCAZ=", "0506070806".HexToByteArray());
                yield return Tuple.Create<string, byte[]>("BQYHCA==", "05060708".HexToByteArray());

                // Typical
                yield return Tuple.Create<string, byte[]>(
                    "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0" +
                    "BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3",

                    ("000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E" +
                     "3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071727374757677").HexToByteArray()
                );

                // Input length not multiple of 4
                yield return Tuple.Create<string, byte[]>("A", null);
                yield return Tuple.Create<string, byte[]>("AA", null);
                yield return Tuple.Create<string, byte[]>("AAA", null);
                yield return Tuple.Create<string, byte[]>("AAAAA", null);
                yield return Tuple.Create<string, byte[]>("AAAAAA", null);
                yield return Tuple.Create<string, byte[]>("AAAAAAA", null);

                // Cannot continue past end pad
                yield return Tuple.Create<string, byte[]>("AAA=BBBB", null);
                yield return Tuple.Create<string, byte[]>("AA==BBBB", null);

                // Cannot have more than two end pads
                yield return Tuple.Create<string, byte[]>("A===", null);
                yield return Tuple.Create<string, byte[]>("====", null);

                // Verify negative entries of charmap.
                for (int i = 0; i < 256; i++)
                {
                    char c = (char)i;
                    if (!IsValidBase64Char(c))
                    {
                        string text = new string(c, 1) + "AAA";
                        yield return Tuple.Create<string, byte[]>(text, null);
                    }
                }

                // Verify >255 character handling.
                string largerThanByte = new string((char)256, 1);
                yield return Tuple.Create<string, byte[]>(largerThanByte + "AAA", null);
                yield return Tuple.Create<string, byte[]>("A" + largerThanByte + "AA", null);
                yield return Tuple.Create<string, byte[]>("AA" + largerThanByte + "A", null);
                yield return Tuple.Create<string, byte[]>("AAA" + largerThanByte, null);
                yield return Tuple.Create<string, byte[]>("AAAA" + largerThanByte + "AAA", null);
                yield return Tuple.Create<string, byte[]>("AAAA" + "A" + largerThanByte + "AA", null);
                yield return Tuple.Create<string, byte[]>("AAAA" + "AA" + largerThanByte + "A", null);
                yield return Tuple.Create<string, byte[]>("AAAA" + "AAA" + largerThanByte, null);

                // Verify positive entries of charmap.
                yield return Tuple.Create<string, byte[]>("+A==", new byte[] { 0xf8 });
                yield return Tuple.Create<string, byte[]>("/A==", new byte[] { 0xfc });
                yield return Tuple.Create<string, byte[]>("0A==", new byte[] { 0xd0 });
                yield return Tuple.Create<string, byte[]>("1A==", new byte[] { 0xd4 });
                yield return Tuple.Create<string, byte[]>("2A==", new byte[] { 0xd8 });
                yield return Tuple.Create<string, byte[]>("3A==", new byte[] { 0xdc });
                yield return Tuple.Create<string, byte[]>("4A==", new byte[] { 0xe0 });
                yield return Tuple.Create<string, byte[]>("5A==", new byte[] { 0xe4 });
                yield return Tuple.Create<string, byte[]>("6A==", new byte[] { 0xe8 });
                yield return Tuple.Create<string, byte[]>("7A==", new byte[] { 0xec });
                yield return Tuple.Create<string, byte[]>("8A==", new byte[] { 0xf0 });
                yield return Tuple.Create<string, byte[]>("9A==", new byte[] { 0xf4 });
                yield return Tuple.Create<string, byte[]>("AA==", new byte[] { 0x00 });
                yield return Tuple.Create<string, byte[]>("BA==", new byte[] { 0x04 });
                yield return Tuple.Create<string, byte[]>("CA==", new byte[] { 0x08 });
                yield return Tuple.Create<string, byte[]>("DA==", new byte[] { 0x0c });
                yield return Tuple.Create<string, byte[]>("EA==", new byte[] { 0x10 });
                yield return Tuple.Create<string, byte[]>("FA==", new byte[] { 0x14 });
                yield return Tuple.Create<string, byte[]>("GA==", new byte[] { 0x18 });
                yield return Tuple.Create<string, byte[]>("HA==", new byte[] { 0x1c });
                yield return Tuple.Create<string, byte[]>("IA==", new byte[] { 0x20 });
                yield return Tuple.Create<string, byte[]>("JA==", new byte[] { 0x24 });
                yield return Tuple.Create<string, byte[]>("KA==", new byte[] { 0x28 });
                yield return Tuple.Create<string, byte[]>("LA==", new byte[] { 0x2c });
                yield return Tuple.Create<string, byte[]>("MA==", new byte[] { 0x30 });
                yield return Tuple.Create<string, byte[]>("NA==", new byte[] { 0x34 });
                yield return Tuple.Create<string, byte[]>("OA==", new byte[] { 0x38 });
                yield return Tuple.Create<string, byte[]>("PA==", new byte[] { 0x3c });
                yield return Tuple.Create<string, byte[]>("QA==", new byte[] { 0x40 });
                yield return Tuple.Create<string, byte[]>("RA==", new byte[] { 0x44 });
                yield return Tuple.Create<string, byte[]>("SA==", new byte[] { 0x48 });
                yield return Tuple.Create<string, byte[]>("TA==", new byte[] { 0x4c });
                yield return Tuple.Create<string, byte[]>("UA==", new byte[] { 0x50 });
                yield return Tuple.Create<string, byte[]>("VA==", new byte[] { 0x54 });
                yield return Tuple.Create<string, byte[]>("WA==", new byte[] { 0x58 });
                yield return Tuple.Create<string, byte[]>("XA==", new byte[] { 0x5c });
                yield return Tuple.Create<string, byte[]>("YA==", new byte[] { 0x60 });
                yield return Tuple.Create<string, byte[]>("ZA==", new byte[] { 0x64 });
                yield return Tuple.Create<string, byte[]>("aA==", new byte[] { 0x68 });
                yield return Tuple.Create<string, byte[]>("bA==", new byte[] { 0x6c });
                yield return Tuple.Create<string, byte[]>("cA==", new byte[] { 0x70 });
                yield return Tuple.Create<string, byte[]>("dA==", new byte[] { 0x74 });
                yield return Tuple.Create<string, byte[]>("eA==", new byte[] { 0x78 });
                yield return Tuple.Create<string, byte[]>("fA==", new byte[] { 0x7c });
                yield return Tuple.Create<string, byte[]>("gA==", new byte[] { 0x80 });
                yield return Tuple.Create<string, byte[]>("hA==", new byte[] { 0x84 });
                yield return Tuple.Create<string, byte[]>("iA==", new byte[] { 0x88 });
                yield return Tuple.Create<string, byte[]>("jA==", new byte[] { 0x8c });
                yield return Tuple.Create<string, byte[]>("kA==", new byte[] { 0x90 });
                yield return Tuple.Create<string, byte[]>("lA==", new byte[] { 0x94 });
                yield return Tuple.Create<string, byte[]>("mA==", new byte[] { 0x98 });
                yield return Tuple.Create<string, byte[]>("nA==", new byte[] { 0x9c });
                yield return Tuple.Create<string, byte[]>("oA==", new byte[] { 0xa0 });
                yield return Tuple.Create<string, byte[]>("pA==", new byte[] { 0xa4 });
                yield return Tuple.Create<string, byte[]>("qA==", new byte[] { 0xa8 });
                yield return Tuple.Create<string, byte[]>("rA==", new byte[] { 0xac });
                yield return Tuple.Create<string, byte[]>("sA==", new byte[] { 0xb0 });
                yield return Tuple.Create<string, byte[]>("tA==", new byte[] { 0xb4 });
                yield return Tuple.Create<string, byte[]>("uA==", new byte[] { 0xb8 });
                yield return Tuple.Create<string, byte[]>("vA==", new byte[] { 0xbc });
                yield return Tuple.Create<string, byte[]>("wA==", new byte[] { 0xc0 });
                yield return Tuple.Create<string, byte[]>("xA==", new byte[] { 0xc4 });
                yield return Tuple.Create<string, byte[]>("yA==", new byte[] { 0xc8 });
                yield return Tuple.Create<string, byte[]>("zA==", new byte[] { 0xcc });
            }
        }

        private static string InsertSpaces(string text, int period)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < text.Length; i++)
            {
                if ((i % period) == 0)
                {
                    sb.Append("  ");
                }
                sb.Append(text[i]);
            }
            sb.Append("  ");
            return sb.ToString();
        }

        private static bool IsValidBase64Char(char c)
        {
            return c >= 'A' && c <= 'Z'
                || c >= 'a' && c <= 'z'
                || c >= '0' && c <= '9'
                || c == '+'
                || c == '/';
        }
    }
}


text:
package org.ldap.test;

import org.junit.After;
import org.junit.Before;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.LdapTemplate;

import com.unboundid.ldap.listener.InMemoryDirectoryServer;
import com.unboundid.ldap.listener.InMemoryDirectoryServerConfig;
import com.unboundid.ldap.listener.InMemoryListenerConfig;
import com.unboundid.ldap.sdk.schema.Schema;

public class BaseLDAPUnitTest{

	private static InMemoryDirectoryServer ds;

	@Before
	public void setupClass() throws Exception {

		InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=example,dc=com");
		config.addAdditionalBindCredentials("cn=Directory Manager", "password");
		config.setListenerConfigs(InMemoryListenerConfig.createLDAPConfig("LDAP", 389));
		config.setSchema(
				Schema.getSchema(
						"src/test/resources/schema.ldif"
		));

		ds = new InMemoryDirectoryServer(config);
		ds.importFromLDIF(true, "src/test/resources/data.ldif");
		ds.startListening();
	}

	@After
	public void afterClass(){
		ds.shutDown(true);
	}

	protected Object[] getAttributeValues(String dn, String attributeName){
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-ldap.xml");
		LdapTemplate ldapTemplate = (LdapTemplate) context.getBean("ldapTemplate");

		DirContextAdapter dircontext = (DirContextAdapter) ldapTemplate.lookup(dn);

		return dircontext.getObjectAttributes(attributeName);
	}
}


text:
package model;

import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ServerValue;
import com.google.firebase.database.ValueEventListener;

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

/**
 * Created by Gustavo on 20/01/2017.
 */

public class ClienteDAO {
    protected String id;
    protected String key;
    protected HashMap<String, Object> tabMedidas = null;
    protected String nome;
    protected String telefone;
    protected String[] itens_medidas;

    protected String fb_email;

    protected Map<String, String> timestamp;

    protected DatabaseReference refDB;

    public ClienteDAO() {

    }

    public ClienteDAO(String id, String nome, String telefone, String [] medidas, String fb_email) {
        this.id             = id;
        this.nome           = nome;
        this.telefone       = telefone;
        this.itens_medidas  = medidas;
	    this.fb_email       = fb_email;

    }

    public void createNew() {
        createNewClient();
        createNewMedida();
    }

    private void createNewClient() {
        refDB = FirebaseDatabase.getInstance()
		        .getReferenceFromUrl("https://medidas-90407.firebaseio.com/").child("costureiras")
		        .child(fb_email).child("clientes");
        //pega novo id unico
        key = refDB.push().getKey();
        System.out.println("Key: " + key);
        //grava os dados do cliente
        HashMap<String, Object> map = new HashMap<>();
        map.put("id", this.id);
        map.put("nome", this.nome);
        map.put("telefone", this.telefone);
        this.timestamp = ServerValue.TIMESTAMP;
        map.put("timestamp", this.timestamp);

        //indexado pela chave unica
        refDB.child(key).updateChildren(map);
    }

    //função que cria nova lista de medidas com os valores em -1
    private void createNewMedida() {
        refDB = refDB.getRoot().child("costureiras").child(fb_email).child("medidas");

        //grava os novos dados de medida
        HashMap<String, Object> medidas = new HashMap<>();
        //pega os itens da tabela de medidas

        // inicializa os itens da medida com -1 o que
        // significa que o valor está nulo
        for (int i = 0; i < itens_medidas.length; i++) {
            medidas.put (itens_medidas[i], "");
        }
        //usa o mesmo timestamp da criação do cliente na lista
        medidas.put("timestamp", this.timestamp);

        refDB.child(key).updateChildren(medidas);
    }

    public void setData(String[] medidas, String[] valores) {
        if (tabMedidas == null) {
            tabMedidas = new HashMap<>();
        }

        for (int i = 0; i < medidas.length; i++) {
            tabMedidas.put(medidas[i], valores[i]);
        }
    }

    public boolean sendData() {

        refDB.child(telefone).child("nome").setValue(nome);

        refDB.child(telefone).child("medidas").updateChildren(tabMedidas);

        return true;
    }
}


text:
<?php
/**
 * smart_foundation functions and definitions
 *
 * @package smart_foundation
 */

/**
 * Set the content width based on the theme's design and stylesheet.
 */
if ( ! isset( $content_width ) ) {
	$content_width = 640; /* pixels */
}

if ( ! function_exists( 'smart_foundation_setup' ) ) :
/**
 * Sets up theme defaults and registers support for various WordPress features.
 *
 * Note that this function is hooked into the after_setup_theme hook, which
 * runs before the init hook. The init hook is too late for some features, such
 * as indicating support for post thumbnails.
 */
function smart_foundation_setup() {

	/*
	 * Make theme available for translation.
	 * Translations can be filed in the /languages/ directory.
	 * If you're building a theme based on smart_foundation, use a find and replace
	 * to change 'smart_foundation' to the name of your theme in all the template files
	 */
	load_theme_textdomain( 'smart_foundation', get_template_directory() . '/languages' );

	// Add default posts and comments RSS feed links to head.
	add_theme_support( 'automatic-feed-links' );

	/*
	 * Enable support for Post Thumbnails on posts and pages.
	 *
	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
	 */
	add_theme_support( 'post-thumbnails' );

	// This theme uses wp_nav_menu() in one location.
	register_nav_menus( array(
		'primary' => __( 'Primary Menu', 'smart_foundation' ),
	) );

	// Enable support for Post Formats.
	add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );

	// Setup the WordPress core custom background feature.
	add_theme_support( 'custom-background', apply_filters( 'smart_foundation_custom_background_args', array(
		'default-color' => 'ffffff',
		'default-image' => '',
	) ) );

	// Enable support for HTML5 markup.
	add_theme_support( 'html5', array(
		'comment-list',
		'search-form',
		'comment-form',
		'gallery',
		'caption',
	) );

	/**
	 * Add Advanced Custom Fields Options pages
	 */
	if( function_exists('acf_set_options_page_title') )
	{
	    acf_set_options_page_title( __('Options', 'smart') );
	}
	if( function_exists('acf_set_options_page_menu') )
	{
	    acf_set_options_page_menu( __('Options', 'smart') );
	}
}
endif; // smart_foundation_setup
add_action( 'after_setup_theme', 'smart_foundation_setup' );

/**
 * Register widget area.
 *
 * @link http://codex.wordpress.org/Function_Reference/register_sidebar
 */
function smart_foundation_widgets_init() {
	register_sidebar( array(
		'name'          => __( 'Sidebar', 'smart_foundation' ),
		'id'            => 'sidebar-1',
		'description'   => '',
		'before_widget' => '',
		'after_widget'  => '',
		'before_title'  => '
',
		'after_title'   => '
',
	) );

	/*register_sidebar( array(
		'name'          => __( 'Menu', 'smart' ),
		'id'            => 'offcanvas-1',
		'before_widget' => '
',
		'after_widget'  => '
',
		'before_title'  => '

',
		'after_title'   => '

',
	) );*/
}
add_action( 'widgets_init', 'smart_foundation_widgets_init' );

/**
 * Add TinyMCE editor styles
 */
function smart_add_editor_styles() {
    add_editor_style();
}
add_action( 'init', 'smart_add_editor_styles' );

/**
 * Enqueue scripts and styles.
 */
function smart_foundation_scripts() {
	// Core styles and theme stylesheet
	wp_enqueue_style( 'wp-core-styles', get_template_directory_uri() . '/css/wp-core-styles.css');
	wp_enqueue_style( 'smart_foundation-style', get_stylesheet_uri() );

	// Scripts
	// jQuery
	wp_enqueue_script( 'jquery' );

	// REM Polyfill for rem support in the hell of IE
	wp_enqueue_script('rem-polyfill', get_template_directory_uri() . '/js/rem-polyfill.js', array('jquery'), false, true);

	// jQuery Viewport (mostly for parallax websites or to give elements classes and stuff when in viewport)
	//wp_enqueue_script('jquery-viewport', get_template_directory_uri() . '/js/jquery.viewport.min.js', array('jquery'), false, true);

	// Foundation JS
	wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/assets/modernizr/modernizr.js', array('jquery'), false, true);
	wp_enqueue_script( 'foundation-script', get_template_directory_uri() . '/assets/foundation/js/foundation.js', array('jquery'), false, true);
	wp_enqueue_script( 'foundation-topbar-script', get_template_directory_uri() . '/assets/foundation/js/foundation/foundation.topbar.js', array('jquery', 'foundation-script'), false, true);
	//wp_enqueue_script( 'foundation-offcanvas-script', get_template_directory_uri() . '/assets/bower-foundation/js/foundation/foundation.offcanvas.js', array('jquery', 'foundation-script'), false, true);

	// Main Script
	wp_enqueue_script('main-script', get_template_directory_uri() . '/js/main.js', array('jquery','webfont-loader'), false, true);

	// Google Webfont Loader
	wp_enqueue_script('webfont-loader', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js', false, true);

	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
		wp_enqueue_script( 'comment-reply' );
	}
}
add_action( 'wp_enqueue_scripts', 'smart_foundation_scripts' );

/**
 * Implement the Custom Header feature.
 */
//require get_template_directory() . '/inc/custom-header.php';

/**
 * Load Matthew Ruddy image resizer file.
 */
require_once get_template_directory() . '/inc/image-resizer.php';

/**
 * Load custom Foundation walker file.
 */
require_once get_template_directory() . '/inc/foundation-walker.php';

/**
 * Custom template tags for this theme.
 */
require get_template_directory() . '/inc/template-tags.php';

/**
 * Load Types and Fields.
 */
require_once get_template_directory() . '/inc/types-and-fields.php';

/**
 * Custom functions that act independently of the theme templates.
 */
require get_template_directory() . '/inc/extras.php';

/**
 * Customizer additions.
 */
require get_template_directory() . '/inc/customizer.php';

/**
 * Load Jetpack compatibility file.
 */
require get_template_directory() . '/inc/jetpack.php';