text:
0.4
cn

In Weex, we may set the `id` property for a particular element, just as unique identification of a particular element.

`id` can be used by `this.$el(id)` to find an element with a certain id. Take the API [`scrollToElement()`](../modules/dom.md#scrolltoelementnode-options) For example:

```
  <template>
    <container>
      <text id="top">Top</text>
      <container style="height: 10000; background-color: #999999;">
      </container>
      <text onclick="back2Top">Back to Top</text>
    </container>
  </template>
  <script>
    var dom = require('@weex-module/dom')
    module.exports = {
      methods: {
        back2Top: function () {
          var top = this.$el('top')
          dom.scrollToElement(top)
        }
      }
    }
    </script>
```

`id` can also work with `repeat` attribute [See more about display logical control](./display-logic.md), and ensure repetitive elements with different `id`:

```
  <template>
    <container>
      <image id="{{imgId}}" src="{{imgUrl}}" onclick="getImageId" repeat="{{images}}"></image>
    </container>
  </template>
  <script>
  module.exports = {
    data: {
      images: [
        {imgId: 1, imgUrl: '...'},
        {imgId: 2, imgUrl: '...'},
        {imgId: 3, imgUrl: '...'},
        ...
      ]
    },
    methods: {
      getImageId: function(e) {
        // get e.target.id
      }
    }
  }
  </script>
```

Additionally, in the [composed components](./composed-component.md), we can get the corresponding sub component through `this.$vm(id)` APIs.

Next is how to [send messages between composed components](./comm.md).


text:
package org.teavm.ast;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Alexey Andreev
 */
public class BlockStatement extends IdentifiedStatement {
    private List<Statement> body = new ArrayList<>();

    public List<Statement> getBody() {
        return body;
    }

    @Override
    public void acceptVisitor(StatementVisitor visitor) {
        visitor.visit(this);
    }
}

redpajama_set_name: RedPajamaGithub


text:
FROM debian:jessie

RUN apt-get update && apt-get -y install  unzip \
                        xz-utils \
                        curl \
                        bc \
                        git \
                        build-essential \
                        golang \
                        cpio \
                        gcc libc6 libc6-dev \
                        kmod \
                        squashfs-tools \
                        genisoimage \
                        xorriso \
                        syslinux \
                        isolinux \
                        automake \
                        pkg-config \
                        p7zip-full

# https://www.kernel.org/
ENV KERNEL_VERSION  4.1.19

# Fetch the kernel sources
RUN curl --retry 10 https://www.kernel.org/pub/linux/kernel/v${KERNEL_VERSION%%.*}.x/linux-$KERNEL_VERSION.tar.xz | tar -C / -xJ && \
    mv /linux-$KERNEL_VERSION /linux-kernel

# http://aufs.sourceforge.net/
ENV AUFS_REPO       https://github.com/sfjro/aufs4-standalone
ENV AUFS_BRANCH     aufs4.1.13+
ENV AUFS_COMMIT     9b0fe5a0ac42f9dca6ecf3261178ce101a270948
# we use AUFS_COMMIT to get stronger repeatability guarantees

# Download AUFS and apply patches and files, then remove it
RUN git clone -b "$AUFS_BRANCH" "$AUFS_REPO" /aufs-standalone && \
    cd /aufs-standalone && \
    git checkout -q "$AUFS_COMMIT" && \
    cd /linux-kernel && \
    cp -r /aufs-standalone/Documentation /linux-kernel && \
    cp -r /aufs-standalone/fs /linux-kernel && \
    cp -r /aufs-standalone/include/uapi/linux/aufs_type.h /linux-kernel/include/uapi/linux/ && \
    set -e && for patch in \
        /aufs-standalone/aufs*-kbuild.patch \
        /aufs-standalone/aufs*-base.patch \
        /aufs-standalone/aufs*-mmap.patch \
        /aufs-standalone/aufs*-standalone.patch \
        /aufs-standalone/aufs*-loopback.patch \
    ; do \
        patch -p1 < "$patch"; \
    done

COPY kernel_config /linux-kernel/.config

RUN jobs=$(nproc); \
    cd /linux-kernel && \
    make -j ${jobs} oldconfig && \
    make -j ${jobs} bzImage && \
    make -j ${jobs} modules

# The post kernel build process

ENV ROOTFS          /rootfs
ENV TCL_REPO_BASE   http://tinycorelinux.net/7.x/x86_64
# Note that the ncurses is here explicitly so that top continues to work
ENV TCZ_DEPS        iptables \
                    iproute2 \
                    openssh openssl \
                    tar \
                    gcc_libs \
                    ncurses \
                    acpid \
                    xz liblzma \
                    git expat2 libiconv libidn libgpg-error libgcrypt libssh2 \
                    nfs-utils tcp_wrappers portmap rpcbind libtirpc \
                    rsync attr acl \
                    curl ntpclient \
                    procps glib2 libtirpc libffi fuse pcre \
                    udev-lib udev-extra \
                    liblvm2 \
                    parted

# Make the ROOTFS
RUN mkdir -p $ROOTFS

# Prepare the build directory (/tmp/iso)
RUN mkdir -p /tmp/iso/boot

# Install the kernel modules in $ROOTFS
RUN cd /linux-kernel && \
    make INSTALL_MOD_PATH=$ROOTFS modules_install firmware_install

# Remove useless kernel modules, based on unclejack/debian2docker
RUN cd $ROOTFS/lib/modules && \
    rm -rf ./*/kernel/sound/* && \
    rm -rf ./*/kernel/drivers/gpu/* && \
    rm -rf ./*/kernel/drivers/infiniband/* && \
    rm -rf ./*/kernel/drivers/isdn/* && \
    rm -rf ./*/kernel/drivers/media/* && \
    rm -rf ./*/kernel/drivers/staging/lustre/* && \
    rm -rf ./*/kernel/drivers/staging/comedi/* && \
    rm -rf ./*/kernel/fs/ocfs2/* && \
    rm -rf ./*/kernel/net/bluetooth/* && \
    rm -rf ./*/kernel/net/mac80211/* && \
    rm -rf ./*/kernel/net/wireless/*

# Install libcap
RUN curl -fL http://http.debian.net/debian/pool/main/libc/libcap2/libcap2_2.22.orig.tar.gz | tar -C / -xz && \
    cd /libcap-2.22 && \
    sed -i 's/LIBATTR := yes/LIBATTR := no/' Make.Rules && \
    make && \
    mkdir -p output && \
    make prefix=`pwd`/output install && \
    mkdir -p $ROOTFS/usr/local/lib && \
    cp -av `pwd`/output/lib64/* $ROOTFS/usr/local/lib

# Make sure the kernel headers are installed for aufs-util, and then build it
RUN cd /linux-kernel && \
    make INSTALL_HDR_PATH=/tmp/kheaders headers_install && \
    cd / && \
    git clone https://github.com/Distrotech/aufs-util.git && \
    cd /aufs-util && \
    git checkout 5e0c348bd8b1898beb1e043b026bcb0e0c7b0d54 && \
    CPPFLAGS="-I/tmp/kheaders/include" CLFAGS=$CPPFLAGS LDFLAGS=$CPPFLAGS make && \
    DESTDIR=$ROOTFS make install && \
    rm -rf /tmp/kheaders

# Prepare the ISO directory with the kernel
RUN cp -v /linux-kernel/arch/x86_64/boot/bzImage /tmp/iso/boot/vmlinuz64

# Download the rootfs, don't unpack it though:
RUN curl -fL -o /tcl_rootfs.gz $TCL_REPO_BASE/release/distribution_files/rootfs64.gz

# Install the TCZ dependencies
RUN for dep in $TCZ_DEPS; do \
    echo "Download $TCL_REPO_BASE/tcz/$dep.tcz" &&\
        curl -fL -o /tmp/$dep.tcz $TCL_REPO_BASE/tcz/$dep.tcz && \
        unsquashfs -f -d $ROOTFS /tmp/$dep.tcz && \
        rm -f /tmp/$dep.tcz ;\
    done

# get generate_cert
RUN curl -fL -o $ROOTFS/usr/local/bin/generate_cert https://github.com/SvenDowideit/generate_cert/releases/download/0.2/generate_cert-0.2-linux-amd64 && \
    chmod +x $ROOTFS/usr/local/bin/generate_cert

# Build VBox guest additions
ENV VBOX_VERSION 5.0.16
RUN mkdir -p /vboxguest && \
    cd /vboxguest && \
    \
    curl -fL -o vboxguest.iso http://download.virtualbox.org/virtualbox/${VBOX_VERSION}/VBoxGuestAdditions_${VBOX_VERSION}.iso && \
    7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
    rm vboxguest.iso && \
    \
    sh VBoxLinuxAdditions.run --noexec --target . && \
    mkdir amd64 && tar -C amd64 -xjf VBoxGuestAdditions-amd64.tar.bz2 && \
    rm VBoxGuestAdditions*.tar.bz2 && \
    \
    KERN_DIR=/linux-kernel/ make -C amd64/src/vboxguest-${VBOX_VERSION} && \
    cp amd64/src/vboxguest-${VBOX_VERSION}/*.ko $ROOTFS/lib/modules/$KERNEL_VERSION-boot2docker/ && \
    \
    mkdir -p $ROOTFS/sbin && \
    cp amd64/lib/VBoxGuestAdditions/mount.vboxsf amd64/sbin/VBoxService $ROOTFS/sbin/ && \
    mkdir -p $ROOTFS/bin && \
    cp amd64/bin/VBoxClient amd64/bin/VBoxControl $ROOTFS/bin/

# Install build dependencies for VMware Tools
RUN apt-get update && apt-get install -y \
        autoconf \
        libdumbnet-dev \
        libdumbnet1 \
        libfuse-dev \
        libfuse2 \
        libglib2.0-0 \
        libglib2.0-dev \
        libmspack-dev \
        libssl-dev \
        libtirpc-dev \
        libtirpc1 \
        libtool \
    && rm -rf /var/lib/apt/lists/*

# Build VMware Tools
ENV OVT_VERSION 10.0.0-3000743

RUN curl --retry 10 -fsSL "https://github.com/vmware/open-vm-tools/archive/open-vm-tools-${OVT_VERSION}.tar.gz" | tar -xz --strip-components=1 -C /

# Compile user space components, we're no longer building kernel module as we're
# now bundling FUSE shared folders support.
RUN cd /open-vm-tools && \
    autoreconf -i && \
    ./configure --disable-multimon --disable-docs --disable-tests --with-gnu-ld \
                --without-kernel-modules --without-procps --without-gtk2 \
                --without-gtkmm --without-pam --without-x --without-icu \
                --without-xerces --without-xmlsecurity --without-ssl && \
    make LIBS="-ltirpc" CFLAGS="-Wno-implicit-function-declaration" && \
    make DESTDIR=$ROOTFS install &&\
    /open-vm-tools/libtool --finish $ROOTFS/usr/local/lib

# Building the Libdnet library for VMware Tools.
ENV LIBDNET libdnet-1.12
RUN curl -fL -o /tmp/${LIBDNET}.zip https://github.com/dugsong/libdnet/archive/${LIBDNET}.zip &&\
    unzip /tmp/${LIBDNET}.zip -d /vmtoolsd &&\
    cd /vmtoolsd/libdnet-${LIBDNET} && ./configure --build=i486-pc-linux-gnu &&\
    make &&\
    make install && make DESTDIR=$ROOTFS install

# Horrible hack again
RUN cd $ROOTFS && cd usr/local/lib && ln -s libdnet.1 libdumbnet.so.1 &&\
    cd $ROOTFS && ln -s lib lib64

# Download and build Parallels Tools
ENV PRL_MAJOR 11
ENV PRL_VERSION 11.1.0
ENV PRL_BUILD 32202

RUN mkdir -p /prl_tools && \
    curl -fL http://download.parallels.com/desktop/v${PRL_MAJOR}/${PRL_VERSION}/ParallelsTools-${PRL_VERSION}-${PRL_BUILD}-boot2docker.tar.gz \
        | tar -xzC /prl_tools --strip-components 1 &&\
    cd /prl_tools &&\
    cp -Rv tools/* $ROOTFS &&\
    \
    KERNEL_DIR=/linux-kernel/ KVER=$KERNEL_VERSION SRC=/linux-kernel/ PRL_FREEZE_SKIP=1 \
    make -C kmods/ -f Makefile.kmods installme &&\
    \
    find kmods/ -name \*.ko -exec cp {} $ROOTFS/lib/modules/$KERNEL_VERSION-boot2docker/ \;

# Build XenServer Tools
ENV XEN_REPO https://github.com/xenserver/xe-guest-utilities
ENV XEN_BRANCH boot2docker
ENV XEN_COMMIT 4a9417fa61a5ca46676b7073fdb9181fe77ba56e

RUN git clone -b "$XEN_BRANCH" "$XEN_REPO" /xentools \
    && cd /xentools \
    && git checkout -q "$XEN_COMMIT" \
    && make \
    && tar xvf build/dist/*.tgz -C $ROOTFS/

# Make sure that all the modules we might have added are recognized (especially VBox guest additions)
RUN depmod -a -b $ROOTFS $KERNEL_VERSION-boot2docker

COPY VERSION $ROOTFS/etc/version
RUN cp -v $ROOTFS/etc/version /tmp/iso/version

# Get the Docker binaries with version that matches our boot2docker version.
RUN curl -fSL -o /tmp/dockerbin.tgz https://get.docker.com/builds/Linux/x86_64/docker-$(cat $ROOTFS/etc/version).tgz && \
    tar -zxvf /tmp/dockerbin.tgz -C "$ROOTFS/usr/local/bin" --strip-components=1 && \
    rm /tmp/dockerbin.tgz && \
    chroot "$ROOTFS" docker -v

# Install Tiny Core Linux rootfs
RUN cd $ROOTFS && zcat /tcl_rootfs.gz | cpio -f -i -H newc -d --no-absolute-filenames

# Copy our custom rootfs
COPY rootfs/rootfs $ROOTFS

# setup acpi config dir &
# tcl6's sshd is compiled without `/usr/local/sbin` in the path
# Boot2Docker and Docker Machine need `ip`, so I'm linking it in here
RUN cd $ROOTFS \
    && ln -s /usr/local/etc/acpi etc/ \
    && ln -s /usr/local/sbin/ip usr/sbin/

# Build the Hyper-V KVP Daemon
RUN cd /linux-kernel && \
    make INSTALL_HDR_PATH=/tmp/kheaders headers_install && \
    cd /linux-kernel/tools/hv && \
    sed -i 's!\(^CFLAGS = .*\)!\1 -I/tmp/kheaders/include!' Makefile && \
    make hv_kvp_daemon && \
    cp hv_kvp_daemon $ROOTFS/usr/sbin && \
    rm -rf /tmp/kheaders

# These steps can only be run once, so can't be in make_iso.sh (which can be run in chained Dockerfiles)
# see https://github.com/boot2docker/boot2docker/blob/master/doc/BUILD.md

# Make sure init scripts are executable
RUN find $ROOTFS/etc/rc.d/ $ROOTFS/usr/local/etc/init.d/ -exec chmod +x '{}' ';'

# move dhcp.sh out of init.d as we're triggering it manually so its ready a bit faster
RUN mv $ROOTFS/etc/init.d/dhcp.sh $ROOTFS/etc/rc.d/

# Change MOTD
RUN mv $ROOTFS/usr/local/etc/motd $ROOTFS/etc/motd

# Make sure we have the correct bootsync
RUN mv $ROOTFS/boot*.sh $ROOTFS/opt/ && \
	chmod +x $ROOTFS/opt/*.sh

# Make sure we have the correct shutdown
RUN mv $ROOTFS/shutdown.sh $ROOTFS/opt/shutdown.sh && \
	chmod +x $ROOTFS/opt/shutdown.sh

# Add serial console
RUN echo "#!/bin/sh" > $ROOTFS/usr/local/bin/autologin && \
	echo "/bin/login -f docker" >> $ROOTFS/usr/local/bin/autologin && \
	chmod 755 $ROOTFS/usr/local/bin/autologin && \
	echo 'ttyS0:2345:respawn:/sbin/getty -l /usr/local/bin/autologin 9600 ttyS0 vt100' >> $ROOTFS/etc/inittab && \
	echo 'ttyS1:2345:respawn:/sbin/getty -l /usr/local/bin/autologin 9600 ttyS1 vt100' >> $ROOTFS/etc/inittab

# fix "su -"
RUN echo root > $ROOTFS/etc/sysconfig/superuser

# add some timezone files so we're explicit about being UTC
RUN echo 'UTC' > $ROOTFS/etc/timezone \
	&& cp -L /usr/share/zoneinfo/UTC $ROOTFS/etc/localtime

# Get the git versioning info
RUN DATE=$(date) && \
    echo "boinc2docker : ${DATE}" > $ROOTFS/etc/boot2docker

# Copy boot params
COPY rootfs/isolinux /tmp/iso/boot/isolinux

# Get vboxmonitor
RUN zip=vboxmonitor_26086_x86_64-pc-linux-gnu.zip && \
    cd $ROOTFS/usr/local/bin && \
    curl -O http://boinc.berkeley.edu/dl/$zip && \
    file=$(unzip -j $zip | grep inflating | awk '{print $NF}') && \
    rm $zip &&\
    mv $file vboxmonitor

COPY rootfs/make_iso.sh /

RUN /make_iso.sh

CMD ["cat", "boot2docker.iso"]


text:
using System.ComponentModel.DataAnnotations;

namespace Wilson.Scheduler.Core.Enumerations
{
    public enum ScheduleOption
    {
        [Display(Name = "At Work")]
        AtWork = 0,

        [Display(Name = "Holiday")]
        Holiday = 1,

        [Display(Name = "Paid Day Off")]
        PaidDayOff = 2,

        [Display(Name = "Unpaid Day Off")]
        UnpaidDayOff = 3,

        [Display(Name = "Business Trip")]
        BusinessTrip = 4,

        [Display(Name = "Sick Day Off")]
        SickDayOff = 5

    }
}


text:
package jp.co.flect.excel2canvas.chart;

import java.util.List;

/**
 * Chart interface
 */
public interface Chart {

	public List<String> getCellNames();
	public boolean setCellValue(String name, Object value);
	public void clearRawData();
	public Chart cloneChart();
}


text:
package com.heaven7.java.mvcs.test.teamstate;

public class Team3Eat extends BaseTeamState{

}


text:
package org.inf325.ventarron;

import static org.inf325.ventarron.utils.Constants.*;

import java.util.List;

import org.inf325.ventarron.adapters.UserAdapter;
import org.inf325.ventarron.dao.Role;
import org.inf325.ventarron.dao.User;
import org.inf325.ventarron.services.UserService;
import org.inf325.ventarron.services.UserServiceImpl;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.ContextMenu;
import android.view.View;
import android.view.Window;
//import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;
import android.widget.AdapterView.AdapterContextMenuInfo;

public class UserListActivity extends CrudActivity {
	private final String LOG_TAG = getClass().getSimpleName();
	public final static String EXTRA_USER = "org.inf325.ventarron.EXTRA_USER";
	// private EditText txtKeyword;
	private ListView userListView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_user_list);

		super.role = Role.USERS_ROLE;

		loadViews();
		initializeData();
	}

	private void loadViews() {
		// txtKeyword = (EditText) findViewById(R.id.userlist_txtKeyword);
		userListView = (ListView) findViewById(R.id.userlist);
	}

	private void initializeData() {
		UserService service = UserServiceImpl.createService(getHelper());
		List<User> usersList = service.getUsers();
		setListViewAdapter(usersList);

		registerForContextMenu(userListView);
	}

	private void setListViewAdapter(List<User> userList) {
		UserAdapter userAdapter = new UserAdapter(this,
				R.layout.userlistview_item_row, userList);

		userListView.setAdapter(userAdapter);
	}

	public void searchUsers(View view) {
		// TODO: Add search feature here!!!
	}

	@Override
	protected void onCreate() {
		Intent intent = new Intent(this, EditUserActivity.class);
		intent.putExtra(EXTRA_MODE, CREATE_MODE);

		startActivityForResult(intent, 1);
	}

	@Override
	protected void onEdit(AdapterContextMenuInfo info) {
		User user;
		user = (User) userListView.getAdapter().getItem(info.position);

		Intent intent = new Intent(this, EditUserActivity.class);
		intent.putExtra(EXTRA_MODE, EDIT_MODE);
		intent.putExtra(EXTRA_USER, user.getId());

		startActivityForResult(intent, 1);
	}

	@Override
	protected void onDelete(AdapterContextMenuInfo info) {
		User user;
		UserService service = UserServiceImpl.createService(getHelper());
		String message = getString(R.string.changes_failed);

		user = (User) userListView.getAdapter().getItem(info.position);

		try {
			service.delete(user);
			initializeData();
			message = getString(R.string.changes_ok);
		} catch (Exception e) {
			Log.e(LOG_TAG, "Cannot delete record", e);
		}
		Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
	}

	@Override
	protected void onResult() {
		initializeData();
	}

	@Override
	protected void onCustomContextMenu(ContextMenu menu) {
		menu.add(1, SALE_REPORT_MENU_ID, 1, getString(R.string.sale_report));
	}

	@Override
	protected void onCustomContextItemSelected(AdapterContextMenuInfo info,
			int menuId) {

		User user = (User) userListView.getAdapter().getItem(info.position);

		switch (menuId) {
		case SALE_REPORT_MENU_ID:
			sellerReport(user);
		}
	}

	private void sellerReport(User user) {
		Intent intent = new Intent(this, SaleReportActivity.class);
		intent.putExtra(EXTRA_REPORT_MODE, SALE_REPORT_SELLER);
		intent.putExtra(EXTRA_REPORT_FILTER_ID, user.getId());

		startActivity(intent);
	}
}


text:
"""
    sphinx.util.jsonimpl
    ~~~~~~~~~~~~~~~~~~~~

    JSON serializer implementation wrapper.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
"""

import json
import warnings
from collections import UserString

from sphinx.deprecation import RemovedInSphinx40Warning

if False:
    # For type annotation
    from typing import Any, IO  # NOQA

warnings.warn('sphinx.util.jsonimpl is deprecated',
              RemovedInSphinx40Warning, stacklevel=2)

class SphinxJSONEncoder(json.JSONEncoder):
    """JSONEncoder subclass that forces translation proxies."""
    def default(self, obj):
        # type: (Any) -> str
        if isinstance(obj, UserString):
            return str(obj)
        return super().default(obj)

def dump(obj, fp, *args, **kwds):
    # type: (Any, IO, Any, Any) -> None
    kwds['cls'] = SphinxJSONEncoder
    json.dump(obj, fp, *args, **kwds)

def dumps(obj, *args, **kwds):
    # type: (Any, Any, Any) -> str
    kwds['cls'] = SphinxJSONEncoder
    return json.dumps(obj, *args, **kwds)

def load(*args, **kwds):
    # type: (Any, Any) -> Any
    return json.load(*args, **kwds)

def loads(*args, **kwds):
    # type: (Any, Any) -> Any
    return json.loads(*args, **kwds)


text:
<meta http-equiv="refresh" content="0; url=http://www.samyok.us/public/AMC8/leaderboard" />

Redirect


text:
package org.hamcrest.proboscis;

public interface Prober {
    /**
     * Apply the given probe, which might trigger a failure if it's not satisfied.
     * @param probe The probe to apply.
     */

    void check(Probe probe);
}


text:
<?php
// Check for empty fields
if(empty($_POST['name'])  		||
   empty($_POST['email']) 		||
   empty($_POST['phone']) 		||
   empty($_POST['message'])	||
   !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
   {
	echo "No arguments Provided!";
	return false;
   }

$name = $_POST['name'];
$email_address = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];

// Create the email and send the message
$to = 'msd88@drexel.edu'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
$email_subject = "Website Contact Form:  $name";
$email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
$headers = "From: robots@matthewdamore.com\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>


text:
/* jshint node: true */
"use strict";

var parse = require('csv-parse'),
  fs = require('fs'),
  path = require('path'),
  utils = require('./utils.js');

var parser = parse({ delimiter: '|', trim: true, quote: "" });

console.time('Elapsed');

var input = fs.createReadStream(path.join('dicts', 'unidrug.rc'));
var output = fs.createWriteStream(path.join('processed', 'unidrug.rc.js.dict.txt'));
output.on('finish', function(){
  console.timeEnd('Elapsed');
});

input.pipe(parser).pipe(utils.transformer).pipe(output);


text:
A swift class that provides the networking primitives needed to easily communicate with the AcceptOn API.

##Usage
First we need to create an api helper object bound to either your public or private key.  Certain API requests require a private key such as requesting a refund.

> **⚠ Do not place your secret key inside your app if it is public facing!**

```swift
import accepton

//Create an API with a public key (staging)
let api = AcceptOnAPI(publicKey: "pkey_0d4502a9bf8430ae", isProduction: false)

//Create an API with a secret key (staging)
let api = AcceptOnAPI(secretKey: "skey_07e7927212c701b9f25c6ef891ddcdf9", isProduction: false)

If you want to use this in production, you simply make `isProduction` true. If `isProduction` is true, the API will use the production endpoint intsead of the staging endpoint.
```

Now we can make requests with this API. You'll want to store the `api` object if you're using it throughout your application.

###Create a transaction token
Many API requests require a transaction token.  I.e. many api calls are for the middle of the transaction lifetime. To start a new transaction, you must create a transaction token via this request.

In this example, we're selling a *T-Shirt* for $20 USD. At the end of the code block; we receive an `AcceptOnAPITransactionToken` object containing the response of the token object as a *NSDictionary*. You will need to keep this around as many of the other methods need a transaction token id.  You may retrieve this my calling `tokenObject.id`.

```swift
api.createTransactionTokenWithDescription("T-Shirt", forAmountInCents: 2000) { token, error in
  //Did we succeed?
  if (let error = error) {
    print("Failed with error: \(error)")
    return;
  }

  //We now have a token we can use
  let tokenId = token.id
}
```

###Get available payment methods
Answer the questions of *can I accept credit cards?*, *can I accept paypal?*, etc. The first parameter is the transactional token id that you received as part of the response in `createTransactionToken`.

```swift
api.getAvailablePaymentMethodsForTransactionWithId(token.id) { paymentMethods, error in
  if (let error = error) {
    print("Failed with error: \(error)")
    return;
  }

  //We get back a AcceptOnAPIPaymentMethodsInfo struct that tells us what available
  //payment methods we can accept. The options are not necessarily mutually
  //exclusive and may have some overlap like stripe & credit cards
  let supportsCreditCard = paymentMethods.doesSupportCreditCards
  let supportsStripe = paymentMethods.doesSupportStripe
  let supportsPaypal = paymentMethods.doesSupportPaypal
  let supportsApplePay = paymentMethods.doesSupportApplePay

  //Additionally, you get the processor information which contains
  //payment processor specific configuration information.
  let processorInfo = paymentMethods.processorInfo
  //let paypalInfo = processorInfo?["paypal"] as? [String:AnyObject]

  let supportsStripe = paymentMethods.supportsStripe
  let stripePublishableKey = paymentMethods.stripePublishableKey
}
```

###Charge a transaction token
There are multiple ways of charging a token.  Each alternative way of creating a charge is done through variations of the `AcceptOnAPIChargeInfo` with the various constructors as demonstrated below.

Let's start with our first example of charging a credit card:

```swift
//Here we are creating a charge for a credit-card that has already been processed by a payment processor
//cardNum - The credit-card number
//expMonth / expYear - The expiration month and year as appears on the credit card
//securityCode - The 'security' code on the credit card, e.g. 3-digit AMEX
//email (optional) - The email to bind to the transaction
let charge = AcceptOnAPIChargeInfo(creditCardNum: "1234123412341234",
                                                 expMonth: "09",
                                                 expYear: "14",
                                                 securityCode: "123",
                                                 andEmail: nil)

api.chargeWithTransactionId(token.id, andChargeInfo: charge) { chargeRes, error in
  if (let error = error) {
    print("Failed with error: \(error)")
    return;
  }

  //We now have a chargeId we can use
  let chargeId = chargeRes["id"] as! String
  print("Charge id: ", chargeId)  //e.g. `Charge id: chg_5e140f6ca52cad46c10c45b9da670ddd`
}
```

Alternatively, let's create a charge for a transaction partially handled by a 3rd party payment processor:

```swift
//Here we are creating a charge for a credit-card that has already been processed by a payment processor.
//cardToken (optional) - The payment processor token
//email (optional) - The email to bind to the transaction
let charge = AcceptOnAPIChargeInfo(cardToken: "paypal_sszt2ga35rkea764kxwn07",
                                                  andEmail: nil)

//First parameter is the transaction id you would get in api.createTransactionTokenWithDescription
//Second parameter is the charge info object you created
api.chargeWithTransactionId("txn_5e140f6ca52cad46c10c45b9da670ddd", andChargeInfo: charge) { chargeRes, error in
  if (let error = error) {
    print("Failed with error: \(error)")
    return;
  }

  //We now have a chargeId we can use
  let chargeId = chargeRes["id"] as! String
  print("Charge id: ", chargeId)  //e.g. `Charge id: chg_5e140f6ca52cad46c10c45b9da670ddd`
}
```

###Issue a refund
In order to issue a refund, you must have created the api with the `secretKey` parameter.
> **⚠ Do not place your secret key inside your app if it is public facing!**

```swift
//First parameter is the transaction id you would get in api.createTransactionTokenWithDescription
//Second parameter is the ID of the original charge
//Third parameter is the amount to refund in cents from the original charge
api.refundChargeWithTransactionId("txn_5e140f6ca52cad46c10c45b9da670ddd", andChargeId: "chg_oydyquhp39", forAmountInCents: 99) { refundRes, error in
  if (let error = error) {
    print("Failed with error: \(error)")
    return;
  }

  //We now have a refundId we can use
  let refundId = refundRes["id"] as! String
  print("Refund id: ", refundId)  //e.g. `Refund id: ref_5e140f6ca52cad46c10c45b9da670ddd`
}
```

## Better Error Handling
Each *API* method has the potential of returning an `error` which is of type `NSError`.  You may compare this `error` object for it's code based on the following enumeration members for the `AcceptOnAPIError`.  All errors are part of the `com.accepton.api.error` Domain.

Possible Error Codes:

  * `AcceptOnAPIError.Code.BadRequest` - Your request is invalid.
  * `AcceptOnAPIError.Code.Unauthorized` - Your API key is wrong.
  * `AcceptOnAPIError.Code.NotFound` - The specified resource could not be found.
  * `AcceptOnAPIIError.Code.InternalServerError` - We had a problem with our server. Try again later.
  * `AcceptOnAPIError.Code.ServiceUnavailable` - We're temporarily offline for maintenance.  Please try again later.
  * `AcceptOnAPIError.Code.NetworkIssues` - The client is having issues connecting to the internet.
  * `AcceptOnAPIError.Code.UnknownCode` - An unknown code, e.g. not 401, 500, etc. was received from the api.
  * `AcceptOnAPIError.Code.MalformedOrNonExistantData` - No data, or malformed JSON, was received.

Let's do an example of better error handling for requesting the transaction token:

```swift
api.createTransactionTokenWithDescription("T-Shirt", forAmountInCents: 2000) { tokenRes, error in
  //Did we succeed?
  if let error = error {
    switch error {
      case AcceptOnAPIError.Code.InternalServerError.rawValue:
        print("Failed because AcceptOn is offline, \(error)")
      case AcceptOnAPIError.Code.NetworkIssues.rawValue:
        print("Failed because your network connection is not available, \(error)")
      default:
        print("Failed for an unknown error, \(error)")
    }
    return
  }

  //We now have a tokenId we can use
  let tokenId = tokenRes["id"] as! String
  print("Token id: \(tokenId)")  //e.g. `Token id: txn_5e140f6ca52cad46c10c45b9da670ddd`
}
```


text:
import sys

try:
    # Python 2
    str_cls = unicode
except (NameError):
    # Python 3
    str_cls = str

class NonCleanExitError(Exception):

    """
    When an subprocess does not exit cleanly

    :param returncode:
        The command line integer return code of the subprocess
    """

    def __init__(self, returncode):
        self.returncode = returncode

    def __unicode__(self):
        return str_cls(self.returncode)

    def __str__(self):
        if sys.version_info < (3,):
            return self.__bytes__()
        return self.__unicode__()

    def __bytes__(self):
        return self.__unicode__().encode('utf-8')


text:
package com.band.supporting;

import java.util.ArrayList;

import com.band.render.RawDot;

public class PerDotBook {

	ArrayList<RawDot> dotBook;
	String id;
	String section;

	public PerDotBook() {
		dotBook = new ArrayList<RawDot>();
	}

	public void init() {
		dotBook = new ArrayList<RawDot>();
	}

	public void addDot( RawDot dot ) {
		dotBook.add( dot );
	}

	public int getBpm( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getBPM();
	}

	public int getSetCount( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getSetCount();
	}

	public int getSide( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getSide();
	}

	public int getHorizontal( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getHorizontal();
	}

	public String getHorizontalDirection( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getHorizontalDirection();
	}

	public int getHorizontalStep( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getHorizontalStep();
	}

	public String getVertical( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getVertical();
	}

	public String getVerticalDirection( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getVerticalDirection();
	}

	public int getVerticalStep( int currDot ) {
		RawDot dot = new RawDot();
		dot = dotBook.get( currDot );
		return dot.getVerticalStep();
	}

	public void setId( String marcherId ) {
		id = marcherId;
	}

	public String getId() {
		return id;
	}

	public void setSection( String sectionId ) {
		section = sectionId;
	}

	public String getSection() {
		return section;
	}

	public int getSize() {
		return dotBook.size();
	}

}


text:
function Stack() {
	var items = [];
	this.isEmpty = function() {
		return items.length === 0;
	};

	this.push = function(element) {
		items.push(element);
	}

	this.size = function(){
		return items.length;
	}

	this.pop = function() {
		return items.pop();
	}

	this.peek = function() {
		return items[items.length-1];
	}
}

function Graph() {
	var vertices= [];
	var adjList = new Dictionary();
	this.addVertex = function(v){
		vertices.push(v);
		adjList.set(v, []);
	}

	this.addEdge = function(v, w){
		adjList.get(v).push(w);
		adjList.get(w).push(v);
	}
}

var quick = function(array, left, right){
	var index;

	if(array.length > 1){
		index = partition(array, left, right);
		if(left < index -1){
			quick(array, left, index);
		}
		if(index < right) {
			quick(array, index, right);
		}
	}
}

var swapQuickSort = function(array, index1, index2){
	var aux = array[index1];
	array[index1] = array[index2];
	array[index2] = aux;
}


text:
using System.Collections.Generic;
using Umbraco.Core.Services;

namespace Umbraco.Web.HealthCheck.Checks.Config
{
    [HealthCheck("3E2F7B14-4B41-452B-9A30-E67FBC8E1206", "Notification Email Settings",
        Description = "If notifications are used, the 'from' email address should be specified and changed from the default value.",
        Group = "Configuration")]
    public class NotificationEmailCheck : AbstractConfigCheck
    {
        private const string DefaultFromEmail = "your@email.here";

        public NotificationEmailCheck(ILocalizedTextService textService)
            : base(textService)
        { }

        public override string FilePath => "~/Config/umbracoSettings.config";

        public override string XPath => "/settings/content/notifications/email";

        public override ValueComparisonType ValueComparisonType => ValueComparisonType.ShouldNotEqual;

        public override IEnumerable<AcceptableConfiguration> Values => new List<AcceptableConfiguration>
        {
            new AcceptableConfiguration { IsRecommended = false, Value = DefaultFromEmail }
        };

        public override string CheckSuccessMessage => TextService.Localize("healthcheck/notificationEmailsCheckSuccessMessage", new [] { CurrentValue } );

        public override string CheckErrorMessage => TextService.Localize("healthcheck/notificationEmailsCheckErrorMessage", new[] { DefaultFromEmail });
    }
}


text:
/**
 * Client-side Netty-based message handler.
 */

package org.dsngroup.broke.client.handler;


text:
class AddSlugToIssues < ActiveRecord::Migration
  def change
    add_column :issues, :slug, :string
  end
end


text:
@interface ViewController ()<ZJImagePickerControllerDelegate>

/// 选中资源素材数组,用于定位已经选择的照片
@property (nonatomic) NSArray *selectedAssets;

@end

@implementation ViewController

- (IBAction)btnClick:(id)sender {

    // 点击按钮常见一个图片浏览器控制器
    ZJImagePickerController *picker = [[ZJImagePickerController alloc] initWithSelectedAssets:self.selectedAssets];
    picker.imagePickerdelegate = self;
    picker.maxPickerCount = 3;
    // 显示控制器
    [self presentViewController:picker animated:YES completion:nil];

}
// 浏览器的代理方法
- (void)imagePickerController:(ZJImagePickerController *)picker didFinishSelectedImages:(NSArray *)images selectedAssets:(NSArray *)selectedAssets{

    NSLog(@"--✅-%@",images);
}

- (void)viewDidLoad {
    [super viewDidLoad];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
@implementation UINibView

// modification of http://cocoanuts.mobi/2014/03/26/reusable/
- (id)awakeAfterUsingCoder:(NSCoder *)aDecoder
{
	if (![self.subviews count])
	{
		NSBundle *mainBundle = [NSBundle mainBundle];
		NSArray *loadedViews = [mainBundle loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil];
		UIView* loadedView = [loadedViews firstObject];

		[loadedView setFrame:self.frame];
		[loadedView setAutoresizingMask:self.autoresizingMask];
		loadedView.translatesAutoresizingMaskIntoConstraints =
		self.translatesAutoresizingMaskIntoConstraints;

		for (NSLayoutConstraint *constraint in self.constraints)
		{
			id firstItem = constraint.firstItem;
			if (firstItem == self)
				firstItem = loadedView;

			id secondItem = constraint.secondItem;
			if (secondItem == self)
				secondItem = loadedView;

			NSLayoutConstraint* c = [NSLayoutConstraint constraintWithItem:firstItem
																 attribute:constraint.firstAttribute
																 relatedBy:constraint.relation
																	toItem:secondItem
																 attribute:constraint.secondAttribute
																multiplier:constraint.multiplier
																  constant:constraint.constant];
			[loadedView addConstraint:c];
		}

		return loadedView;
	}
	return self;
}

@end


text:
import { h } from 'preact';

export default ({ errorMessage }) => {errorMessage};


text:
layout: default
title: OpenHack - Berchem, Antwerp, Belgium
---

## Berchem, Antwerp, Belgium

![Photo of your meetup or city!](/berchem/10to1.png)

### Info

First Openhack in Belgium!

You can hack on anything! Any language, framework, public/open-source, personal, etc.
Skill level doesn't matter. We don't care if you're working on Hello World or on increasing your wizarding level.
You don't have to have an idea to hack on! You're more than welcome to come just to pair with someone.

Meetings are held every 3rd thursday of the month from 6pm to 11pm.

Location and drinks provided by [10to1](http://10to1.be), foodwise we're mostly ordering [pizzas from here](http://www.just-eat.be/restaurants-pizza-apetito-antwerpen/menu) so @-mention [@bobvlanduyt](https://twitter.com/bobvlanduyt) or [@pjaspers](https://twitter.com/pjaspers) to order.

Hosted by [10to1](http://10to1.be).

### Next meetups

- [Thursday 21 May]()

See the [calendar](https://www.google.com/calendar/embed?src=74bgcbj8qtbqkcdj8iggp5grdc%40group.calendar.google.com&ctz=Europe/Brussels) for all the next meetups.

### Past meetups

- [Thursday 17 December]()

- [Thursday 15 May]()

- [Thursday 17 April 2014]()

- [Thursday 20 March 2014]()

- [Thursday 20 february 2014](https://plus.google.com/events/cl4v62prp56k22l70d660efrcvg?authkey=CIHq1fCFh6K4Rg)

- [Thursday 16 January 2014](https://plus.google.com/events/cl4v62prp56k22l70d660efrcvg?authkey=CIHq1fCFh6K4Rg)

- [Thursday 12 december 2013](https://plus.google.com/events/ckuuuh73g22rnn9li0eptb3ueg8) (One week early because of the holidays)

- [Thursday 21 november 2013](https://plus.google.com/events/cunj4ep8gskbj4ee3cof9ipuubg)

- [Thursday 20 june 2013](https://plus.google.com/events/cokhr0ks7a11te86kodgud9g9ho)

- [Thursday 16 may 2013](https://plus.google.com/events/c337t17sasffoo9j77buopsaua4)

- [Thursday 18 april 2013](https://plus.google.com/events/c3kg1ho23bvmr78k2td4eou1348)

- [Thursday 21 march 2013](https://plus.google.com/events/celpj2hjjgnpj8dpb49gbbbd2o0)

- [Thursday 21 februari 2013](https://plus.google.com/events/cpvqhk3n9pb7089au7h4euqdgd0)

- [Thursday 24 januari 2013](https://plus.google.com/events/c9a0i60j1o70as08fiq06v7qk40)

- [Thursday 20 december 2012](https://plus.google.com/events/cq1og1l7tr2u94u3vk2v6jf9v8c) (Fits better than during the Christmas holidays)

- [Thursday 22 november 2012](https://plus.google.com/events/canss1e1g916ov33rttg1btqrpc)


text:
extern NSString *const kIFlyAppID;
extern NSString *const kWeixinAppID;
extern NSString *const kAppName;
extern NSString *const kAppEngName;

extern CGFloat const kHorizontalMargin;
extern CGFloat const kVerticalMargin;

extern NSString *const kNotificationCreateFile;

extern NSString *const kEventAddNewNote;
extern NSString *const kEventShareToWeixin;
extern NSString *const kEventClickVoiceButton;


text:
namespace po = boost::program_options;

int main(int argc, char ** argv)
{
	po::options_description desc("Possible options");

	desc.add_options()
	    ("help", "produce help message")
	    ("input",     po::value<std::string>(), "set input file")
		("namespace", po::value<std::string>(), "set the namespace for the output")
		("output", 	  po::value<std::string>(), "output directory")
		("no-parser",    "generate no parser")
		("no-tokenizer", "generate no tokenizer")
		("no-listener",  "generate no listener")
		("language-name","override language name")
		("doxygen",  po::value<std::string>(), "generate doxygen documentation")
		("print-input-data", "Print the input data, depending on the format")
		("dfa-graphviz",  po::value<std::string>(), "produce a graphviz image for the dfa state machine")
		("lalr-graphviz", po::value<std::string>(), "produce a graphviz image for the lalr state machine")
		;

	po::variables_map vm;
	po::store(po::parse_command_line(argc, argv, desc), vm);
	po::notify(vm);

	if (vm.empty() || vm.count("help"))
	{
	    std::cout << desc << "\n";
	    return 1;
	}

	if (vm.count("input") == 0)
	{
		std::cerr << "No input file defined";
		return 1;
	}

	auto f = sparge::gold::read_raw_file(vm["input"].as<std::string>());

	if (vm.count("print-input-data"))
		std::cout << f << std::endl;

	auto d = sparge::gold::to_core(f);

	if (vm.count("dfa-graphviz"))
	{
		std::ofstream of(vm["dfa-graphviz"].as<std::string>());

		d.plot_dfa(of);
	}

	sparge::generator g;
	g.data = sparge::gold::to_core(f);

	if (vm.count("output"))
		g.set_path(vm["output"].as<std::string>());

	if (vm.count("namespace"))
		g.set_name_space(vm["namespace"].as<std::string>());

	g.write_symbols();
	g.write_dfa_states();
	g.write_char_set();
	g.write_groups();

	return 0;
}


text:
require 'validates_zipcode/railtie' if defined?(Rails)
require 'validates_zipcode/cldr_regex_collection'
require 'validates_zipcode/invalid_zipcode_error'
require 'validates_zipcode/validator'
require 'validates_zipcode/helper_methods'
require 'validates_zipcode/version'
require 'validates_zipcode/zipcode'
require 'validates_zipcode/formatter'

module ValidatesZipcode
  def self.valid?(*args)
    build_zipcode(*args).valid?
  end

  def self.format(*args)
    build_zipcode(*args).format
  end

  def self.build_zipcode(zipcode, country_alpha2, options = {})
    ValidatesZipcode::Zipcode.new(options.merge(zipcode: zipcode, country_alpha2: country_alpha2))
  end
end


text:
import {Schemas} from "./SchemasHelpers";
import {TimeSlotService} from "../../../both/service/TimeSlotService";
import "/both/collection/model/enum/EquipementTargetUsage.js";
import {Match} from "meteor/check";

SimpleSchema.extendOptions({
  jsonExport: Match.Optional(Boolean)
});

Schemas.references = {};
Schemas.references.options = {};

/**
 * @memberOf Route.collectionReference
 * @summary Teams option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.Teams = {
  PLURAL_REFERENCE_URL: "teams",
  REFERENCE_URL: "team",
  REFERENCE_COLLECTION_NAME: "Teams",
  REFERENCE_MONGO_COLLECTION_NAME: "teams",
  REFERENCE_LABEL: "Team"
};
Schemas.references.Teams = new SimpleSchema({
  name: {
    jsonExport: true,
    type: String,
    label: "Team Name",
    unique: true,
    max: 100
  },
  type: {
    type: String,
    label: "Teams type",
    autoValue: function () {
      return "Teams"
    }
  },
  baseUrl: {
    type: String,
    label: "Team base URL",
    autoValue: function () {
      return "team"
    }
  }
});
/**
 * @memberOf Collection
 * @summary Teams collection
 * @locus Anywhere
 * @instancename collection
 */
Teams = new Mongo.Collection("teams");
Teams.attachSchema(Schemas.references.Teams);

ASSIGNMENTREADYTEAM = "assignmentReadyTeam"; //team de tous les users et toutes les taches prets pour affectation

/**
 * @memberOf Route.collectionReference
 * @summary Places option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.Places = {
  PLURAL_REFERENCE_URL: "places",
  REFERENCE_URL: "place",
  REFERENCE_COLLECTION_NAME: "Places",
  REFERENCE_MONGO_COLLECTION_NAME: "places",
  REFERENCE_LABEL: "Place"
};
Schemas.references.Places = new SimpleSchema({
  name: {
    jsonExport: true,
    type: String,
    label: "Place Name",
    unique: true,
    max: 100
  },
  location: {
    jsonExport: true,
    type: String,
    autoform: {
      type: 'map',
      afFieldInput: {
        zoom: 16
      }
    }
  },
  type: {
    type: String,
    label: "Places type",
    autoValue: function () {
      return "Places"
    }
  },
  baseUrl: {
    type: String,
    label: "Places base URL",
    autoValue: function () {
      return "place"
    }
  }
});
/**
 * @memberOf Collection
 * @summary Places collection
 * @locus Anywhere
 * @instancename collection
 */
Places = new Mongo.Collection("places");
Places.attachSchema(Schemas.references.Places);

/**
 * @memberOf Route.collectionReference
 * @summary Skills option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.Skills = {
  PLURAL_REFERENCE_URL: "skills",
  REFERENCE_URL: "skill",
  REFERENCE_COLLECTION_NAME: "Skills",
  REFERENCE_MONGO_COLLECTION_NAME: "skills",
  REFERENCE_LABEL: "Skill",
  REACTIVE_TABLE_FIELDS: [
    {
      key: "label",
      label: "Skill label",
      cellClass: "-"
    },
    {
      key: "teams",
      label: "Teams accessing skill",
      fn: function (teams) {
        return teams.length + " teams"
      }
    }
  ]
};
Schemas.references.Skills = new SimpleSchema({
  key: {
    type: String,
    label: "Skill key",
    max: 38,
    unique: true

  },
  label: {
    type: String,
    label: "Skill Name",
    max: 100
  },
  teams: {
    label: "Teams that will access Skill",
    type: [SimpleSchema.RegEx.Id],
    optional: true,
    custom: function () {
      this.value = _.compact(this.value);
      if (Teams.find({_id: {$in: this.value}}).fetch().length !== this.value.length)
        return "unknownIdOrDuplicateId"
    },
  },
  'teams.$': {
    autoform: {
      afFieldInput: {
        options: Schemas.helpers.allTeamsOptions
      }
    }
  },
  type: {
    type: String,
    label: "Skills type",
    autoValue: function () {
      return "Skills"
    }
  },
  baseUrl: {
    type: String,
    label: "Skills base URL",
    autoValue: function () {
      return "skill"
    }
  }
});
/**
 * @memberOf Collection
 * @summary Skills collection
 * @locus Anywhere
 * @instancename collection
 */
Skills = new Mongo.Collection("skills");
Skills.attachSchema(Schemas.references.Skills);

/**
 * @memberOf Route.collectionReference
 * @summary AssignmentTerms option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.AssignmentTerms = {
  PLURAL_REFERENCE_URL: "assignment-terms",
  REFERENCE_URL: "assignment-term",
  REFERENCE_COLLECTION_NAME: "AssignmentTerms",
  REFERENCE_MONGO_COLLECTION_NAME: "assignment-terms",
  REFERENCE_LABEL: "Assignment Term",
  REACTIVE_TABLE_FIELDS: [
    {
      key: "name",
      label: "Name",
    },
    {
      key: "start",
      label: "Start",
      fn: function (date) {
        return new moment(date).format("ddd DD MMM HH[h]mm");
      }
    },
    {
      key: "end",
      label: "End",
      fn: function (date) {
        return new moment(date).format("ddd DD MMM HH[h]mm");
      }
    },
    {
      key: "addAvailabilitiesDeadline",
      label: "Deadlines to add availabilities",
      fn: function (date) {
        return new moment(date).format("ddd DD MMM HH[h]mm");
      }
    },
    {
      key: "teams",
      label: "Teams accessing skill",
      fn: function (teams) {
        return teams.length + " teams"
      }
    }
  ]
};
AssignmentTermPeriod = new SimpleSchema({
  start: {
    type: Date,
    label: "Assignment Term Period Start Date",
    custom: function () {
      var start, end, currentId, terms;

      terms = _.compact(this.field("assignmentTermPeriods").value);
      end = new moment(this.field(this.key.replace("start", "") + 'end').value);

      if (!currentId)
        currentId = this.field(this.key.replace("start", "") + '_id').value;

      start = new moment(this.value);
      var termStart = this.field("start").value;
      if (new moment(start).isBefore(termStart))
        return "periodStartBeforeTerm";

      if (start.isAfter(end)) {
        return "startAfterEnd";
      }

      if (!TimeSlotService.areTimeSlotOverlappingWithQuery(terms, start, end, currentId))
        return "assignmentTermPeriodsConflictDate";
    },
    autoform: {
      type: "datetime-local",
    }
  },
  end: {
    type: Date,
    label: "Assignment Term Period End Date",
    custom: function () {
      var start, end, currentId, terms;

      terms = _.compact(this.field("assignmentTermPeriods").value);
      start = new moment(this.field(this.key.replace("end", "") + 'start').value);

      if (!currentId)
        currentId = this.field(this.key.replace("end", "") + '_id').value;

      end = new moment(this.value);
      var termEnd = this.field("end").value;
      if (new moment(end).isAfter(termEnd))
        return "periodEndAfterTerm";

      if (end.isBefore(start)) {
        return "endBeforeStart";
      }

      if (!TimeSlotService.areTimeSlotOverlappingWithQuery(terms, start, end, currentId))
        return "assignmentTermPeriodsConflictDate";
    },
    autoform: {
      type: "datetime-local",
    }
  },
  charisma: {
    label: "Whole period charisma",
    type: Number,
    defaultValue: 0
  },
  _id: {
    type: SimpleSchema.RegEx.Id,
    label: "TimeSlot _id",
    autoValue: function () {
      if (!this.isSet)
        return new Meteor.Collection.ObjectID()._str;
    },
    autoform: {
      type: "hidden",
    }
    // denyUpdate: true
  }
});
Schemas.references.AssignmentTerms = new SimpleSchema({
  name: {
    type: String,
    label: "Assignment terms Name",
    max: 100
  },
  isStrictMode: {
    type: Boolean,
    defaultValue: true,
    label: "Assignment strict mode enabled (timeslots need to fit accuracy)",
  },
  start: {
    type: Date,
    label: "Assignment terms Start",
    custom: function () {
      var start, end, currentId, terms;

      terms = AssignmentTerms.find().fetch();
      end = new moment(this.field(this.key.replace("start", "") + 'end').value);

      currentId = this.docId;

      start = new moment(this.value);

      if (start.isAfter(end)) {
        return "startAfterEnd";
      }

      if (!TimeSlotService.areTimeSlotOverlappingWithQuery(terms, start, end, currentId))
        return "assignmentTermsConflictDate";
    },
    autoform: {
      type: "datetime-local"
    }
  },
  assignmentTermPeriods: {
    type: [AssignmentTermPeriod],
    label: "Assignment periods",
    defaultValue: [],
    optional: true
  },
  end: {
    type: Date,
    label: "Assignment terms  End (not include)",
    custom: function () {
      var start, end, currentId, terms;

      terms = AssignmentTerms.find().fetch();
      start = new moment(this.field(this.key.replace("end", "") + 'start').value);

      currentId = this.docId;

      end = new moment(this.value);

      if (end.isBefore(start)) {
        return "endBeforeStart";
      }

      if (!TimeSlotService.areTimeSlotOverlappingWithQuery(terms, start, end, currentId))
        return "assignmentTermsConflictDate";
    },
    autoform: {
      type: "datetime-local"
    }
  },
  addAvailabilitiesDeadline: {
    type: Date,
    label: "Assignment add availabilities deadline",
    autoform: {
      type: "datetime-local"
    }
  },
  calendarAccuracy: {
    type: Number,
    decimal: true,
    label: "Assignment calendar accuracy minimal duration for availabilities and timeslots (only is isStrictMode=false) (2 = 2 hours, 1 = 1 hour, 0.5 = 30 min, 0.25 = 15 min)",
    custom: function () {
      if (!CalendarAccuracyEnum[this.value])
        return "accuracyNotFound"
    }

  },
  teams: {
    label: "Teams that will access Assignment Term ",
    type: [SimpleSchema.RegEx.Id],
    optional: true,
    custom: function () {
      this.value = _.compact(this.value);
      if (Teams.find({_id: {$in: this.value}}).fetch().length !== this.value.length)
        return "unknownIdOrDuplicateId"
    },
  },
  'teams.$': {
    autoform: {
      afFieldInput: {
        options: Schemas.helpers.allTeamsOptions
      }
    }
  },
  charisma: {
    label: "Whole term charisma (0 get assignment term charisma)",
    type: Number,
    defaultValue: 0
  },
  type: {
    type: String,
    label: "Assignment terms type",
    autoValue: function () {
      return "AssignmentTerms"
    }
  },
  baseUrl: {
    type: String,
    label: "Assignment terms base URL",
    autoValue: function () {
      return "assignment-term";
    }
  }
});
/**
 * @memberOf Collection
 * @summary AssignmentTerms collection
 * @locus Anywhere
 * @instancename collection
 */
AssignmentTerms = new Mongo.Collection("assignment-terms");
AssignmentTerms.attachSchema(Schemas.references.AssignmentTerms);

/**
 * @memberOf Route.collectionReference
 * @summary GroupRoles option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.GroupRoles = {
  PLURAL_REFERENCE_URL: "group-roles",
  REFERENCE_URL: "group-role",
  REFERENCE_COLLECTION_NAME: "GroupRoles",
  REFERENCE_MONGO_COLLECTION_NAME: "group_roles",
  REFERENCE_LABEL: "Group Role",
  REACTIVE_TABLE_FIELDS: [
    {
      key: "name",
      label: "Group Role Name",
    },
    {
      key: "roles",
      label: "Roles in group",
      fn: function (roles) {
        var res = "";
        roles.forEach(role => {
          res += role;
          res += ", "
        });
        res.split(0, res.length - 4);
        return res;
      }
    }
  ]
};
Schemas.references.GroupRoles = new SimpleSchema({
  name: {
    type: String,
    label: "Group role Name",
    max: 100,
    unique: true
  },
  roles: {
    type: [String],
    label: "Group role roles",
    custom: function () {
      Roles.getAllRoles();
      this.value = _.compact(this.value);
      if (_.uniq(this.value).length !== this.value.length)
        return "duplicate"
    },
    autoValue: function () {
      return _.compact(this.value);
    }
  },
  'roles.$': {
    autoform: {
      afFieldInput: {
        options: Schemas.helpers.allRolesOptions
      }
    }
  },
  type: {
    type: String,
    label: "Roles type",
    autoValue: function () {
      return "Roles"
    }
  },
  baseUrl: {
    type: String,
    label: "Group roles base URL",
    autoValue: function () {
      return "group-role"
    }
  }
});
/**
 * @memberOf Collection
 * @summary Teams collection
 * @locus Anywhere
 * @instancename collection
 */
GroupRoles = new Mongo.Collection("group_roles");
GroupRoles.attachSchema(Schemas.references.GroupRoles);

/**
 * @memberOf Route.collectionReference
 * @summary EquipmentCategories option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.EquipmentCategory = {
  PLURAL_REFERENCE_URL: "equipment-categories",
  REFERENCE_URL: "equipment-category",
  REFERENCE_COLLECTION_NAME: "EquipmentCategories",
  REFERENCE_LABEL: "Equipment Category"
};
Schemas.references.EquipmentCategories = new SimpleSchema({
  name: {
    type: String,
    label: "Equipment Category Name",
    unique: true,
    max: 100
  },
  extraComputeRule: {
    type: String,
    label: "Equipment Category Extra rules (what to do with equipment.extra of this category. Valid values : SUM (extra * quantity)",
    optional: true
  },
  type: {
    type: String,
    label: "Equipment categories type",
    autoValue: function () {
      return "EquipmentCategories"
    }
  },
  baseUrl: {
    type: String,
    label: "Equipment Category base URL",
    autoValue: function () {
      return "equipment-category"
    }
  }
});
/**
 * @memberOf Collection
 * @summary EquipmentCategories collection
 * @locus Anywhere
 * @instancename collection
 */
EquipmentCategories = new Mongo.Collection("equipment_categories");
EquipmentCategories.attachSchema(Schemas.references.EquipmentCategories);

/**
 * @memberOf Route.collectionReference
 * @summary Equipments option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.Equipments = {
  PLURAL_REFERENCE_URL: "equipments",
  REFERENCE_URL: "equipment",
  REFERENCE_COLLECTION_NAME: "Equipments",
  REFERENCE_LABEL: "Equipment"
};
Schemas.references.Equipments = new SimpleSchema({
  name: {
    type: String,
    label: "Equipments Name",
    unique: true,
    max: 100
  },
  quantity: {
    type: Number,
    label: "Equipment available quantity",
    min: 0
  },
  targetUsage: {
    type: String,
    label: "Equipment target usage",
    autoform: {
      afFieldInput: {
        options: [
          {
            label: EquipementTargetUsage.TASK,
            value: EquipementTargetUsage.TASK
          },
          {
            label: EquipementTargetUsage.ACTIVITY,
            value: EquipementTargetUsage.ACTIVITY
          },
          {
            label: EquipementTargetUsage.BOTH,
            value: EquipementTargetUsage.BOTH
          }
        ]
      }
    }
  },
  EquipmentCategories_Id: {
    type: SimpleSchema.RegEx.Id,
    label: "Equipment Category",
    custom: function () {
      if (!EquipmentCategories.findOne(this.value))
        return "unknownId";
      return 1
    },
    autoform: {
      afFieldInput: {
        options: Schemas.helpers.allEquipmentCategoriesOptions
      }
    }
  },
  extra: {
    type: String,
    label: "Equipment specific extra (could be anything, leave empty if no idea)",
    optional: true
  },
  type: {
    type: String,
    label: "Equipments type",
    autoValue: function () {
      return "Equipments"
    }
  },
  baseUrl: {
    type: String,
    label: "Equipments base URL",
    autoValue: function () {
      return "equipment"
    }
  }
});
/**
 * @memberOf Collection
 * @summary Equipments collection
 * @locus Anywhere
 * @instancename collection
 */
Equipments = new Mongo.Collection("equipments");
Equipments.attachSchema(Schemas.references.Equipments);

/**
 * @memberOf Route.collectionReference
 * @summary WaterSupply option to automatically generate routes and forms
 * @description see code to get the value
 */
Schemas.references.options.WaterSupply = {
  PLURAL_REFERENCE_URL: "water-supplies",
  REFERENCE_URL: "water-supply",
  REFERENCE_COLLECTION_NAME: "WaterSupplies",
  REFERENCE_LABEL: "Water supply"
};
Schemas.references.WaterSupplies = new SimpleSchema({
  name: {
    type: String,
    label: "WaterSupply Name",
    unique: true,
    max: 100
  },
  type: {
    type: String,
    label: "WaterSupply type",
    autoValue: function () {
      return "WaterSupplies"
    }
  },
  baseUrl: {
    type: String,
    label: "WaterSupply base URL",
    autoValue: function () {
      return "water-supply"
    }
  }
});
/**
 * @memberOf Collection
 * @summary WaterSupplies collection
 * @locus Anywhere
 * @instancename collection
 */
WaterSupplies = new Mongo.Collection("water_supplies");
WaterSupplies.attachSchema(Schemas.references.WaterSupplies);

/**
 * @memberOf Route.collectionReference
 * @summary WaterDisposal option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.WaterDisposal = {
  PLURAL_REFERENCE_URL: "water-disposals",
  REFERENCE_URL: "water-disposal",
  REFERENCE_COLLECTION_NAME: "WaterDisposals",
  REFERENCE_LABEL: "Water disposal"
};
Schemas.references.WaterDisposals = new SimpleSchema({
  name: {
    type: String,
    label: "WaterDisposal Name",
    unique: true,
    max: 100
  },
  type: {
    type: String,
    label: "WaterDisposal type",
    autoValue: function () {
      return "WaterDisposals"
    }
  },
  baseUrl: {
    type: String,
    label: "WaterDisposal base URL",
    autoValue: function () {
      return "water-disposal"
    }
  }
});
/**
 * @memberOf Collection
 * @summary WaterDisposals collection
 * @locus Anywhere
 * @instancename collection
 */
WaterDisposals = new Mongo.Collection("water_disposals");
WaterDisposals.attachSchema(Schemas.references.WaterDisposals);

/**
 * @memberOf Route.collectionReference
 * @summary PowerSupplies option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.PowerSupplies = {
  PLURAL_REFERENCE_URL: "power-supplies",
  REFERENCE_URL: "power-supply",
  REFERENCE_COLLECTION_NAME: "PowerSupplies",
  REFERENCE_LABEL: "Power Supply"
};
Schemas.references.PowerSupplies = new SimpleSchema({
  name: {
    type: String,
    label: "PowerSupply Name",
    unique: true,
    max: 100
  },
  type: {
    type: String,
    label: "PowerSupply type",
    autoValue: function () {
      return "PowerSupplies"
    }
  },
  baseUrl: {
    type: String,
    label: "PowerSupply base URL",
    autoValue: function () {
      return "power-supply"
    }
  }
});
/**
 * @memberOf Collection
 * @summary PowerSupplies collection
 * @locus Anywhere
 * @instancename collection
 */
PowerSupplies = new Mongo.Collection("power_supplies");
PowerSupplies.attachSchema(Schemas.references.PowerSupplies);

/**
 * @memberOf Route.collectionReference
 * @summary EquipmentStorage option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.EquipmentStorage = {
  PLURAL_REFERENCE_URL: "equipment-storages",
  REFERENCE_URL: "equipment-storage",
  REFERENCE_COLLECTION_NAME: "EquipmentStorages",
  REFERENCE_LABEL: "Equipment Storage"
};
Schemas.references.EquipmentStorages = new SimpleSchema({
  name: {
    type: String,
    label: "EquipmentStorage Name",
    unique: true,
    max: 100
  },
  type: {
    type: String,
    label: "EquipmentStorage type",
    autoValue: function () {
      return "EquipmentStorages"
    }
  },
  baseUrl: {
    type: String,
    label: "EquipmentStorage base URL",
    autoValue: function () {
      return "equipment-storage"
    }
  }
});
/**
 * @memberOf Collection
 * @summary EquipmentStorages collection
 * @locus Anywhere
 * @instancename collection
 */
EquipmentStorages = new Mongo.Collection("equipment_storages");
EquipmentStorages.attachSchema(Schemas.references.EquipmentStorages);

/**
 * @memberOf Route.collectionReference
 * @summary Teams option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.AccessPoints = {
  PLURAL_REFERENCE_URL: "access-points",
  REFERENCE_URL: "access-point",
  REFERENCE_COLLECTION_NAME: "AccessPoints",
  REFERENCE_MONGO_COLLECTION_NAME: "AccessPoints",
  REFERENCE_LABEL: "Access Points"
};
Schemas.references.AccessPoints = new SimpleSchema({
  name: {
    type: String,
    label: "Access Point  Name",
    unique: true,
    max: 100
  },
  selectedImage: {
    type: String,
    label: "Access Point Selected image"
  },
  notSelectedImage: {
    type: String,
    label: "Access Point Not Selected image"
  },
  type: {
    type: String,
    label: "Access Point type",
    autoValue: function () {
      return "AccessPoints"
    }
  },
  baseUrl: {
    type: String,
    label: "Access Point base URL",
    autoValue: function () {
      return "access-point"
    }
  }
});
/**
 * @memberOf Collection
 * @summary AccessPoints collection
 * @locus Anywhere
 * @instancename collection
 */
AccessPoints = new Mongo.Collection("access_points");
AccessPoints.attachSchema(Schemas.references.AccessPoints);

/**
 * @memberOf Route.collectionReference
 * @summary Teams option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.WebCategories = {
  PLURAL_REFERENCE_URL: "web-categories",
  REFERENCE_URL: "web-category",
  REFERENCE_COLLECTION_NAME: "WebCategories",
  REFERENCE_MONGO_COLLECTION_NAME: "WebCategories",
  REFERENCE_LABEL: "Web Category"
};
Schemas.references.WebCategories = new SimpleSchema({
  name: {
    jsonExport: true,
    type: String,
    label: "Web Category Name",
    unique: true,
    max: 100
  },
  type: {
    type: String,
    label: "Web Categories type",
    autoValue: function () {
      return "WebCategories"
    }
  },
  baseUrl: {
    type: String,
    label: "Web Categories base URL",
    autoValue: function () {
      return "web-category"
    }
  }
});
/**
 * @memberOf Collection
 * @summary WebCategories collection
 * @locus Anywhere
 * @instancename collection
 */
WebCategories = new Mongo.Collection("web_categories");
WebCategories.attachSchema(Schemas.references.WebCategories);

/**
 * @memberOf Route.collectionReference
 * @summary Teams option to automatically generate routes and forms
 * @description see code to get the values
 */
Schemas.references.options.AndroidCategories = {
  PLURAL_REFERENCE_URL: "android-categories",
  REFERENCE_URL: "android-category",
  REFERENCE_COLLECTION_NAME: "AndroidCategories",
  REFERENCE_MONGO_COLLECTION_NAME: "AndroidCategories",
  REFERENCE_LABEL: "Android Category"
};
Schemas.references.AndroidCategories = new SimpleSchema({
  name: {
    jsonExport: true,
    type: String,
    label: "Android Category Name",
    unique: true,
    max: 100
  },
  iconName: {
    jsonExport: true,
    type: String,
    label: "Android Category icon file name used by the app to display the right icon, see https://github.com/24HeuresINSA/24h-android-app",
  },
  categoryName: {
    jsonExport: true,
    type: String,
    //unique: true,
    label: "Unique Android Category name used by the app to do filtering (only maj non special char, no white space), see https://github.com/24HeuresINSA/24h-android-app",
  },
  type: {
    type: String,
    label: "Android Categories type",
    autoValue: function () {
      return "AndroidCategories"
    }
  },
  baseUrl: {
    type: String,
    label: "Android Categories base URL",
    autoValue: function () {
      return "android-category"
    }
  }
});
/**
 * @memberOf Collection
 * @summary AndroidCategories collection
 * @locus Anywhere
 * @instancename collection
 */
AndroidCategories = new Mongo.Collection("android_categories");
AndroidCategories.attachSchema(Schemas.references.AndroidCategories);


text:
AccountSubdomain.reflections << "has_many :users, class_name: 'users', dependent: :destroy"

#This setting is used for redirect for invalid subdomain.
AccountSubdomain.redirect_path = '/'

#This setting is used for redirect after successfully creation of subdomain.
AccountSubdomain.after_creation_url = 'account_subdomain.accounts_url'

#This setting is for domain tld
# tdd for
#example.com => #1
#example.co.in => #2
#set it as per your domain name
AccountSubdomain.tld_length = 1

#Settings for filters
#use case :- You want the https authentication before the access the account subdomain
#AccountSubdomain.action_controller_filters[:before_filter] = [:validate_http_access_only]
#
# Add validate_http_access_only filter in your application.rb
AccountSubdomain.action_controller_filters[:before_filter] = []


text:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using RAIN.Action;
using RAIN.Core;

[RAINAction]
public class PickSopAction : RAINAction
{
	private GameObject footman;
	private FootmanControl control;

	public override void Start (RAIN.Core.AI ai)
	{
		footman = ai.Body;
		control = footman.GetComponent<FootmanControl> ();
		base.Start (ai);
	}

	public override ActionResult Execute (RAIN.Core.AI ai)
	{
		control.ActionHandler.PickSoP ();
		return ActionResult.SUCCESS;
	}

	public override void Stop (RAIN.Core.AI ai)
	{
		base.Stop (ai);
	}
}


text:
void PrintHelp() {
  fprintf(stderr,
    "Usage:\n"
    "  courgette -dis <executable_file> <binary_assembly_file>\n"
    "  courgette -asm <binary_assembly_file> <executable_file>\n"
    "  courgette -disadj <executable_file> <reference> <binary_assembly_file>\n"
    "  courgette -gen <v1> <v2> <patch>\n"
    "  courgette -apply <v1> <patch> <v2>\n"
    "\n");
}

void UsageProblem(const char* message) {
  fprintf(stderr, "%s", message);
  fprintf(stderr, "\n");
  PrintHelp();
  exit(1);
}

void Problem(const char* format, ...) {
  va_list args;
  va_start(args, format);
  vfprintf(stderr, format, args);
  fprintf(stderr, "\n");
  va_end(args);
  exit(1);
}

std::string ReadOrFail(const std::wstring& file_name, const char* kind) {
  FilePath file_path(file_name);
  std::string buffer;
  if (!file_util::ReadFileToString(file_path, &buffer))
    Problem("Can't read %s file.", kind);
  return buffer;
}

void WriteSinkToFile(const courgette::SinkStream *sink,
                     const std::wstring& output_file) {
  FilePath output_path(output_file);
  int count =
      file_util::WriteFile(output_path,
                           reinterpret_cast<const char*>(sink->Buffer()),
                           sink->Length());
  if (count == -1)
    Problem("Cant write output.");
  if (count != sink->Length())
    Problem("Incomplete write.");
}

void Disassemble(const std::wstring& input_file,
                 const std::wstring& output_file) {
  std::string buffer = ReadOrFail(input_file, "input");

  courgette::AssemblyProgram* program = NULL;
  const courgette::Status parse_status =
      courgette::ParseWin32X86PE(buffer.c_str(), buffer.length(), &program);

  if (parse_status != courgette::C_OK)
    Problem("Can't parse input.");

  courgette::EncodedProgram* encoded = NULL;
  const courgette::Status encode_status = Encode(program, &encoded);

  courgette::DeleteAssemblyProgram(program);

  if (encode_status != courgette::C_OK)
    Problem("Can't encode program.");

  courgette::SinkStreamSet sinks;

  const courgette::Status write_status =
    courgette::WriteEncodedProgram(encoded, &sinks);
  if (write_status != courgette::C_OK)
    Problem("Can't serialize encoded program.");

  courgette::DeleteEncodedProgram(encoded);

  courgette::SinkStream sink;
  sinks.CopyTo(&sink);

  WriteSinkToFile(&sink, output_file);
}

void DisassembleAndAdjust(const std::wstring& program_file,
                          const std::wstring& model_file,
                          const std::wstring& output_file) {
  std::string program_buffer = ReadOrFail(program_file, "program");
  std::string model_buffer = ReadOrFail(model_file, "reference");

  courgette::AssemblyProgram* program = NULL;
  const courgette::Status parse_program_status =
      courgette::ParseWin32X86PE(program_buffer.c_str(),
                                 program_buffer.length(),
                                 &program);
  if (parse_program_status != courgette::C_OK)
    Problem("Can't parse program input.");

  courgette::AssemblyProgram* model = NULL;
  const courgette::Status parse_model_status =
      courgette::ParseWin32X86PE(model_buffer.c_str(),
                                 model_buffer.length(),
                                 &model);
  if (parse_model_status != courgette::C_OK)
    Problem("Can't parse model input.");

  const courgette::Status adjust_status = Adjust(*model, program);
  if (adjust_status != courgette::C_OK)
    Problem("Can't adjust program.");

  courgette::EncodedProgram* encoded = NULL;
  const courgette::Status encode_status = Encode(program, &encoded);

  courgette::DeleteAssemblyProgram(program);

  if (encode_status != courgette::C_OK)
    Problem("Can't encode program.");

  courgette::SinkStreamSet sinks;

  const courgette::Status write_status =
    courgette::WriteEncodedProgram(encoded, &sinks);
  if (write_status != courgette::C_OK)
    Problem("Can't serialize encoded program.");

  courgette::DeleteEncodedProgram(encoded);

  courgette::SinkStream sink;
  sinks.CopyTo(&sink);

  WriteSinkToFile(&sink, output_file);
}

// Diffs two executable files, write a set of files for the diff, one file per
// stream of the EncodedProgram format.  Each file is the bsdiff between the
// original file's stream and the new file's stream.  This is completely
// uninteresting to users, but it is handy for seeing how much each which
// streams are contributing to the final file size.  Adjustment is optional.
void DisassembleAdjustDiff(const std::wstring& model_file,
                           const std::wstring& program_file,
                           const std::wstring& output_file_root,
                           bool adjust) {
  std::string model_buffer = ReadOrFail(model_file, "'old'");
  std::string program_buffer = ReadOrFail(program_file, "'new'");

  courgette::AssemblyProgram* model = NULL;
  const courgette::Status parse_model_status =
      courgette::ParseWin32X86PE(model_buffer.c_str(),
                                 model_buffer.length(),
                                 &model);
  if (parse_model_status != courgette::C_OK)
    Problem("Can't parse model input.");

  courgette::AssemblyProgram* program = NULL;
  const courgette::Status parse_program_status =
      courgette::ParseWin32X86PE(program_buffer.c_str(),
                                 program_buffer.length(),
                                 &program);
  if (parse_program_status != courgette::C_OK)
    Problem("Can't parse program input.");

  if (adjust) {
    const courgette::Status adjust_status = Adjust(*model, program);
    if (adjust_status != courgette::C_OK)
      Problem("Can't adjust program.");
  }

  courgette::EncodedProgram* encoded_program = NULL;
  const courgette::Status encode_program_status =
      Encode(program, &encoded_program);
  courgette::DeleteAssemblyProgram(program);
  if (encode_program_status != courgette::C_OK)
    Problem("Can't encode program.");

  courgette::EncodedProgram* encoded_model = NULL;
  const courgette::Status encode_model_status = Encode(model, &encoded_model);
  courgette::DeleteAssemblyProgram(model);
  if (encode_model_status != courgette::C_OK)
    Problem("Can't encode model.");

  courgette::SinkStreamSet program_sinks;
  const courgette::Status write_program_status =
    courgette::WriteEncodedProgram(encoded_program, &program_sinks);
  if (write_program_status != courgette::C_OK)
    Problem("Can't serialize encoded program.");
  courgette::DeleteEncodedProgram(encoded_program);

  courgette::SinkStreamSet model_sinks;
  const courgette::Status write_model_status =
    courgette::WriteEncodedProgram(encoded_model, &model_sinks);
  if (write_model_status != courgette::C_OK)
    Problem("Can't serialize encoded model.");
  courgette::DeleteEncodedProgram(encoded_model);

  for (int i = 0;  ; ++i) {
    courgette::SinkStream* old_stream = model_sinks.stream(i);
    courgette::SinkStream* new_stream = program_sinks.stream(i);
    if (old_stream == NULL  && new_stream == NULL)
      break;

    courgette::SourceStream old_source;
    courgette::SourceStream new_source;
    old_source.Init(*old_stream);
    new_source.Init(*new_stream);
    courgette::SinkStream patch_stream;
    courgette::BSDiffStatus status =
        courgette::CreateBinaryPatch(&old_source, &new_source, &patch_stream);
    if (status != courgette::OK) Problem("-xxx failed.");

    WriteSinkToFile(&patch_stream,
                    output_file_root + L"-" + IntToWString(i));
  }
}

void Assemble(const std::wstring& input_file,
              const std::wstring& output_file) {
  std::string buffer = ReadOrFail(input_file, "input");

  courgette::SourceStreamSet sources;
  if (!sources.Init(buffer.c_str(), buffer.length()))
    Problem("Bad input file.");

  courgette::EncodedProgram* encoded = NULL;
  const courgette::Status read_status = ReadEncodedProgram(&sources, &encoded);
  if (read_status != courgette::C_OK)
    Problem("Bad encoded program.");

  courgette::SinkStream sink;

  const courgette::Status assemble_status = courgette::Assemble(encoded, &sink);
  if (assemble_status != courgette::C_OK)
    Problem("Can't assemble.");

  WriteSinkToFile(&sink, output_file);
}

void GenerateEnsemblePatch(const std::wstring& old_file,
                           const std::wstring& new_file,
                           const std::wstring& patch_file) {
  std::string old_buffer = ReadOrFail(old_file, "'old' input");
  std::string new_buffer = ReadOrFail(new_file, "'new' input");

  courgette::SourceStream old_stream;
  courgette::SourceStream new_stream;
  old_stream.Init(old_buffer);
  new_stream.Init(new_buffer);

  courgette::SinkStream patch_stream;
  courgette::Status status =
      courgette::GenerateEnsemblePatch(&old_stream, &new_stream, &patch_stream);

  if (status != courgette::C_OK) Problem("-gen failed.");

  WriteSinkToFile(&patch_stream, patch_file);
}

void ApplyEnsemblePatch(const std::wstring& old_file,
                        const std::wstring& patch_file,
                        const std::wstring& new_file) {
  std::string old_buffer = ReadOrFail(old_file, "'old' input");
  std::string patch_buffer = ReadOrFail(patch_file, "'patch' input");

  courgette::SourceStream old_stream;
  courgette::SourceStream patch_stream;
  old_stream.Init(old_buffer);
  patch_stream.Init(patch_buffer);
  courgette::SinkStream new_stream;
  courgette::Status status =
      courgette::ApplyEnsemblePatch(&old_stream, &patch_stream, &new_stream);

  if (status != courgette::C_OK) Problem("-apply failed.");

  WriteSinkToFile(&new_stream, new_file);
}

void GenerateBSDiffPatch(const std::wstring& old_file,
                         const std::wstring& new_file,
                         const std::wstring& patch_file) {
  std::string old_buffer = ReadOrFail(old_file, "'old' input");
  std::string new_buffer = ReadOrFail(new_file, "'new' input");

  courgette::SourceStream old_stream;
  courgette::SourceStream new_stream;
  old_stream.Init(old_buffer);
  new_stream.Init(new_buffer);

  courgette::SinkStream patch_stream;
  courgette::BSDiffStatus status =
      courgette::CreateBinaryPatch(&old_stream, &new_stream, &patch_stream);

  if (status != courgette::OK) Problem("-genbsdiff failed.");

  WriteSinkToFile(&patch_stream, patch_file);
}

void ApplyBSDiffPatch(const std::wstring& old_file,
                      const std::wstring& patch_file,
                      const std::wstring& new_file) {
  std::string old_buffer = ReadOrFail(old_file, "'old' input");
  std::string patch_buffer = ReadOrFail(patch_file, "'patch' input");

  courgette::SourceStream old_stream;
  courgette::SourceStream patch_stream;
  old_stream.Init(old_buffer);
  patch_stream.Init(patch_buffer);

  courgette::SinkStream new_stream;
  courgette::BSDiffStatus status =
      courgette::ApplyBinaryPatch(&old_stream, &patch_stream, &new_stream);

  if (status != courgette::OK) Problem("-applybsdiff failed.");

  WriteSinkToFile(&new_stream, new_file);
}

int main(int argc, const char* argv[]) {
  base::AtExitManager at_exit_manager;
  CommandLine::Init(argc, argv);
  const CommandLine& command_line = *CommandLine::ForCurrentProcess();

  bool cmd_dis = command_line.HasSwitch(L"dis");
  bool cmd_asm = command_line.HasSwitch(L"asm");
  bool cmd_disadj = command_line.HasSwitch(L"disadj");
  bool cmd_make_patch = command_line.HasSwitch(L"gen");
  bool cmd_apply_patch = command_line.HasSwitch(L"apply");
  bool cmd_make_bsdiff_patch = command_line.HasSwitch(L"genbsdiff");
  bool cmd_apply_bsdiff_patch = command_line.HasSwitch(L"applybsdiff");
  bool cmd_spread_1_adjusted = command_line.HasSwitch(L"gen1a");
  bool cmd_spread_1_unadjusted = command_line.HasSwitch(L"gen1u");

  std::vector<std::wstring> values = command_line.GetLooseValues();

  // '-repeat=N' is for debugging.  Running many iterations can reveal leaks and
  // bugs in cleanup.
  int repeat_count = 1;
  std::wstring repeat_switch = command_line.GetSwitchValue(L"repeat");
  if (!repeat_switch.empty())
    if (!StringToInt(repeat_switch, &repeat_count))
      repeat_count = 1;

  if (cmd_dis + cmd_asm + cmd_disadj + cmd_make_patch + cmd_apply_patch +
      cmd_make_bsdiff_patch + cmd_apply_bsdiff_patch +
      cmd_spread_1_adjusted + cmd_spread_1_unadjusted
      != 1)
    UsageProblem(
        "Must have exactly one of:\n"
        "  -asm, -dis, -disadj, -gen or -apply, -genbsdiff or -applybsdiff.");

  while (repeat_count-- > 0) {
    if (cmd_dis) {
      if (values.size() != 2)
        UsageProblem("-dis <executable_file> <courgette_file>");
      Disassemble(values[0], values[1]);
    } else if (cmd_asm) {
      if (values.size() != 2)
        UsageProblem("-asm <courgette_file_input> <executable_file_output>");
      Assemble(values[0], values[1]);
    } else if (cmd_disadj) {
      if (values.size() != 3)
        UsageProblem("-disadj <executable_file> <model> <courgette_file>");
      DisassembleAndAdjust(values[0], values[1], values[2]);
    } else if (cmd_make_patch) {
      if (values.size() != 3)
        UsageProblem("-gen <old_file> <new_file> <patch_file>");
      GenerateEnsemblePatch(values[0], values[1], values[2]);
    } else if (cmd_apply_patch) {
      if (values.size() != 3)
        UsageProblem("-apply <old_file> <patch_file> <new_file>");
      ApplyEnsemblePatch(values[0], values[1], values[2]);
    } else if (cmd_make_bsdiff_patch) {
      if (values.size() != 3)
        UsageProblem("-genbsdiff <old_file> <new_file> <patch_file>");
      GenerateBSDiffPatch(values[0], values[1], values[2]);
    } else if (cmd_apply_bsdiff_patch) {
      if (values.size() != 3)
        UsageProblem("-applybsdiff <old_file> <patch_file> <new_file>");
      ApplyBSDiffPatch(values[0], values[1], values[2]);
    } else if (cmd_spread_1_adjusted || cmd_spread_1_unadjusted) {
      if (values.size() != 3)
        UsageProblem("-gen1[au] <old_file> <new_file> <patch_files_root>");
      DisassembleAdjustDiff(values[0], values[1], values[2],
                            cmd_spread_1_adjusted);
    } else {
      UsageProblem("No operation specified");
    }
  }
}


text:
package org.ebayopensource.twin.element;

public interface Text extends ControlType {
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CodePen - A Pen by  Mads Nyborg</title>

  HTML is the preffered language of the internet.
 This does not men that you cannot find other formats, but the bulk of webpages are in HTML-format. The basic components of the internet, as covered in this classs, are the following:
 Browser: Program that runs on your computer.

 Internet: A network of networks (hence the "inter"...)
 Servers: Computers optimized for storing files
 HTTP: The main protocol of the internet or the web
 It does not seem that hard to master yet. But I have a feeling the team behind Introduction to  Introduction to Programming Nanodegree
 have more challenging stuff in store for me!


text:
<project>
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.apache.maven.its.mng5003</groupId>
  <artifactId>mng-5003-plugin-realm-cache</artifactId>
  <version>1.0</version>

</project>


text:
require 'rails_helper'

RSpec.describe Activity, type: :model do
  it { should validate_presence_of :name }
  it { should validate_uniqueness_of  :name }

  it { should belong_to :project }
  it { should belong_to :branch }
  it { should belong_to(:location) }

  it { should have_many :activity_members }
  it { should have_many(:members).through(:activity_members) }

end


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

// load header
$this->load->view('layouts/header-forms');

$this->load->helper('currency_helper');

$attributes = array(
    'width'     =>  '1000',
    'height'    =>  '620',
    'screenx'   =>  '\'+((parseInt(screen.width) - 950)/2)+\'',
    'screeny'   =>  '\'+((parseInt(screen.height) - 700)/2)+\'',
);

?>

Entry Vessel Voyage

Form Entry

					<?php echo form_open(); ?>
						<?php if(validation_errors()) { ?>

                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
                            <?php echo validation_errors(); ?>

                        <?php } ?>

                        <?php if(isset($error_var) && $error_var == "error") { ?>

                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
                            <?php echo $error_msg; ?>

                        <?php } ?>

                        <?php if($this->session->flashdata('failed')) { ?>

                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
                            <?php echo $this->session->flashdata('failed'); ?>

                        <?php } ?>

                        <?php if($this->session->flashdata('success')) { ?>

                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
                            <?php echo $this->session->flashdata('success'); ?>

                        <?php } ?>

							Vessel
							<input type="text" name="vessel_name" value="<?php echo set_value('vessel_name'); ?>" class="form-control" id="vessel"> <?php echo anchor_popup('Order/entry_vessel/','Entry Vessel', $attributes); ?>
							<input type="hidden" name="vessel_id" class="form-control" value="<?php echo set_value('vessel_id'); ?>">

							Voyage Number
							<input type="text" name="voyage_number" class="form-control" value="<?php echo set_value('voyage_number'); ?>">

							Trade
							<select class="form-control" name="trade_id">
								<option></option>
								<?php
									foreach ($data_trade as $key => $value) {
										?>
											<option value="<?php echo $value->GENERAL_ID ?>"> <?php echo $value->GENERAL_DESCRIPTION; ?> </option>
										<?php
									}
								?>
							</select>

									ETA
									<input type="text" name="eta" class="form-control date" value="<?php echo set_value('eta'); ?>">

									ETD
									<input type="text" name="etd" class="form-control date" value="<?php echo set_value('etd'); ?>">

									POL
									<input type="text" name="pol_name" id="pol_name" class="form-control" value="<?php echo set_value('pol_name'); ?>">
									<?php echo anchor_popup('Order/entry_port/','Entry Port', $attributes); ?>
									<input type="hidden" value="<?php echo set_value('pol_id'); ?>" name="pol_id" class="form-control">

									POD
									<input type="text" name="pod_name" value="<?php echo set_value('pod_name'); ?>" id="pod_name" class="form-control">
									<input type="hidden" name="pod_id" class="form-control" value="<?php echo set_value('pod_id'); ?>">

						<button type="submit" class="btn btn-success">Save</button>
					</form>

<?php
    $this->load->view('layouts/js.php');
?>

<?php
    $this->load->view('layouts/footer.php');
?>


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

namespace FizzBuzzFizzBuzz
{
    class Program
    {
        static void Main(string[] args)
        {
            var listOfSays = new List<ISaySomething>();
            for (var i = 1; i < 100; i++)
            {
                listOfSays.Add(FizzBuzzFactory.Generate(i));
            }
            foreach (var say in listOfSays)
            {
                Console.WriteLine(say.Say());
            }
        }
    }
}


text:
package com.amazonaws.services.workmail.model.transform;

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.workmail.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * AccessControlRuleMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AccessControlRuleMarshaller {

    private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Name").build();
    private static final MarshallingInfo<String> EFFECT_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Effect").build();
    private static final MarshallingInfo<String> DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Description").build();
    private static final MarshallingInfo<List> IPRANGES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("IpRanges").build();
    private static final MarshallingInfo<List> NOTIPRANGES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("NotIpRanges").build();
    private static final MarshallingInfo<List> ACTIONS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Actions").build();
    private static final MarshallingInfo<List> NOTACTIONS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("NotActions").build();
    private static final MarshallingInfo<List> USERIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("UserIds").build();
    private static final MarshallingInfo<List> NOTUSERIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("NotUserIds").build();
    private static final MarshallingInfo<java.util.Date> DATECREATED_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DateCreated").timestampFormat("unixTimestamp").build();
    private static final MarshallingInfo<java.util.Date> DATEMODIFIED_BINDING = MarshallingInfo.builder(MarshallingType.DATE)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("DateModified").timestampFormat("unixTimestamp").build();
    private static final MarshallingInfo<List> IMPERSONATIONROLEIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ImpersonationRoleIds").build();
    private static final MarshallingInfo<List> NOTIMPERSONATIONROLEIDS_BINDING = MarshallingInfo.builder(MarshallingType.LIST)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("NotImpersonationRoleIds").build();

    private static final AccessControlRuleMarshaller instance = new AccessControlRuleMarshaller();

    public static AccessControlRuleMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(AccessControlRule accessControlRule, ProtocolMarshaller protocolMarshaller) {

        if (accessControlRule == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(accessControlRule.getName(), NAME_BINDING);
            protocolMarshaller.marshall(accessControlRule.getEffect(), EFFECT_BINDING);
            protocolMarshaller.marshall(accessControlRule.getDescription(), DESCRIPTION_BINDING);
            protocolMarshaller.marshall(accessControlRule.getIpRanges(), IPRANGES_BINDING);
            protocolMarshaller.marshall(accessControlRule.getNotIpRanges(), NOTIPRANGES_BINDING);
            protocolMarshaller.marshall(accessControlRule.getActions(), ACTIONS_BINDING);
            protocolMarshaller.marshall(accessControlRule.getNotActions(), NOTACTIONS_BINDING);
            protocolMarshaller.marshall(accessControlRule.getUserIds(), USERIDS_BINDING);
            protocolMarshaller.marshall(accessControlRule.getNotUserIds(), NOTUSERIDS_BINDING);
            protocolMarshaller.marshall(accessControlRule.getDateCreated(), DATECREATED_BINDING);
            protocolMarshaller.marshall(accessControlRule.getDateModified(), DATEMODIFIED_BINDING);
            protocolMarshaller.marshall(accessControlRule.getImpersonationRoleIds(), IMPERSONATIONROLEIDS_BINDING);
            protocolMarshaller.marshall(accessControlRule.getNotImpersonationRoleIds(), NOTIMPERSONATIONROLEIDS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
package client

// ErrorHandler is the handler which handles an error.
type ErrorHandler func(error)


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.signalr.models;

import com.azure.core.util.ExpandableStringEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.Collection;

/** The kind of the service, it can be SignalR or RawWebSockets. */
public final class ServiceKind extends ExpandableStringEnum<ServiceKind> {
    /** Static value SignalR for ServiceKind. */
    public static final ServiceKind SIGNALR = fromString("SignalR");

    /** Static value RawWebSockets for ServiceKind. */
    public static final ServiceKind RAW_WEB_SOCKETS = fromString("RawWebSockets");

    /**
     * Creates or finds a ServiceKind from its string representation.
     *
     * @param name a name to look for.
     * @return the corresponding ServiceKind.
     */
    @JsonCreator
    public static ServiceKind fromString(String name) {
        return fromString(name, ServiceKind.class);
    }

    /**
     * Gets known ServiceKind values.
     *
     * @return known ServiceKind values.
     */
    public static Collection<ServiceKind> values() {
        return values(ServiceKind.class);
    }
}