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

class Global_EE_Caf_Hooks {

	public function __construct() {
		$this->_do_hooks();
	}

	private function _do_hooks() {
		add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10 );
		add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10 );
		add_filter('FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array( $this, 'forums_lazy_loading'), 10 );
		add_action('AHEE__EE_Admin_Page__espresso_news_post_box__after_content', array( $this, 'extra_news_box_content' ), 10 );
	}

	public function extra_news_box_content( $content ) {
		echo '
' . __('From the Forums', 'event_espresso') . '
';
		echo '
';
		$url = 'http://eventespresso.com/forum/event-espresso-support/feed/';
		EE_Admin_Page::cached_rss_display( 'ee_forum_posts_content', $url);
		echo '
';
	}

	public function forums_lazy_loading( $ids ) {
		$ids[] = 'ee_forum_posts_content';
		return $ids;
	}

} //end class Global_EE_Caf_Hooks

redpajama_set_name: RedPajamaGithub


text:
const DrawCard = require('../../drawcard.js');

class LannisportGuard extends DrawCard {
    setupCardAbilities() {
        this.reaction({
            when: {
                onCardEntersPlay: event => event.card === this && event.playingType === 'marshal'
            },
            handler: () => {
                for(let player of this.game.getPlayers()) {
                    if(player.canDraw()) {
                        player.drawCardsToHand(1);
                    }
                }

                this.game.addMessage('{0} uses {1} to have each player draw a card', this.controller, this);
            }
        });
    }
}

LannisportGuard.code = '05016';

module.exports = LannisportGuard;


text:
macro_rules! ready {
    ($e:expr) => (
        match $e {
            ::std::task::Poll::Ready(v) => v,
            ::std::task::Poll::Pending => return ::std::task::Poll::Pending,
        }
    )
}

mod buf;
pub(crate) mod drain;
pub(crate) mod exec;
pub(crate) mod io;
mod lazy;
mod never;
pub(crate) mod task;

pub(crate) use self::buf::StaticBuf;
pub(crate) use self::exec::Exec;
pub(crate) use self::lazy::{lazy, Started as Lazy};
pub use self::never::Never;
pub(crate) use self::task::Poll;

// group up types normally needed for `Future`
pub(crate) use std::{
    future::Future,
    marker::Unpin,
    pin::Pin,
};


text:
package java.util.internal

@inline
private[java] class BooleanRef(var elem: Boolean) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object BooleanRef {
  def create(elem: Boolean): BooleanRef = new BooleanRef(elem)
  def zero(): BooleanRef = new BooleanRef(false)
}

@inline
private[java] class CharRef(var elem: Char) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object CharRef {
  def create(elem: Char): CharRef = new CharRef(elem)
  def zero(): CharRef = new CharRef(0.toChar)
}

@inline
private[java] class ByteRef(var elem: Byte) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object ByteRef {
  def create(elem: Byte): ByteRef = new ByteRef(elem)
  def zero(): ByteRef = new ByteRef(0)
}

@inline
private[java] class ShortRef(var elem: Short) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object ShortRef {
  def create(elem: Short): ShortRef = new ShortRef(elem)
  def zero(): ShortRef = new ShortRef(0)
}

@inline
private[java] class IntRef(var elem: Int) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object IntRef {
  def create(elem: Int): IntRef = new IntRef(elem)
  def zero(): IntRef = new IntRef(0)
}

@inline
private[java] class LongRef(var elem: Long) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object LongRef {
  def create(elem: Long): LongRef = new LongRef(elem)
  def zero(): LongRef = new LongRef(0)
}

@inline
private[java] class FloatRef(var elem: Float) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object FloatRef {
  def create(elem: Float): FloatRef = new FloatRef(elem)
  def zero(): FloatRef = new FloatRef(0)
}

@inline
private[java] class DoubleRef(var elem: Double) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object DoubleRef {
  def create(elem: Double): DoubleRef = new DoubleRef(elem)
  def zero(): DoubleRef = new DoubleRef(0)
}

@inline
private[java] class ObjectRef[A](var elem: A) extends Serializable {
  override def toString(): String = String.valueOf(elem)
}
private[java] object ObjectRef {
  def create[A](elem: A): ObjectRef[A] = new ObjectRef(elem)
  def zero(): ObjectRef[Object] = new ObjectRef(null)
}


text:
'use strict';
const common = require('../common');
const assert = require('assert');
const exec = require('child_process').exec;

let pwdcommand, dir;

if (common.isWindows) {
  pwdcommand = 'echo %cd%';
  dir = 'c:\\windows';
} else {
  pwdcommand = 'pwd';
  dir = '/dev';
}

exec(pwdcommand, {cwd: dir}, common.mustCall(function(err, stdout, stderr) {
  assert.ifError(err);
  assert(stdout.startsWith(dir));
}));


text:
import numpy

class Perceptron:
    def activate(self, inputs):
        '''Takes in @param inputs, a list of numbers.
        @return the output of a threshold perceptron with
        given weights, threshold, and inputs.
        '''

        # TODO: calculate the strength with which the perceptron fires
        perc = numpy.dot(inputs, self.weights)

        # TODO: return 0 or 1 based on the threshold
        if perc > self.threshold:
            return 1
        else:
            return 0

    def __init__(self, weights=None, threshold=None):
        if weights is not None:
            self.weights = weights
        if threshold is not None:
            self.threshold = threshold


text:
package com.xxl.job.core.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.regex.Pattern;

/**
 * get ip
 * @author xuxueli 2016-5-22 11:38:05
 */
public class IpUtil {
	private static final Logger logger = LoggerFactory.getLogger(IpUtil.class);

	private static final String ANYHOST = "0.0.0.0";
	private static final String LOCALHOST = "127.0.0.1";
	public static final Pattern IP_PATTERN = Pattern.compile("\\d{1,3}(\\.\\d{1,3}){3,5}$");

	private static volatile InetAddress LOCAL_ADDRESS = null;

	/**
	 * valid address
	 * @param address
	 * @return
	 */
	private static boolean isValidAddress(InetAddress address) {
		if (address == null || address.isLoopbackAddress())
			return false;
		String name = address.getHostAddress();
		return (name != null
				&& ! ANYHOST.equals(name)
				&& ! LOCALHOST.equals(name)
				&& IP_PATTERN.matcher(name).matches());
	}

	/**
	 * get first valid addredd
	 * @return
	 */
	private static InetAddress getFirstValidAddress() {
		InetAddress localAddress = null;
		try {
			localAddress = InetAddress.getLocalHost();
			if (isValidAddress(localAddress)) {
				return localAddress;
			}
		} catch (Throwable e) {
			logger.error("Failed to retriving ip address, " + e.getMessage(), e);
		}
		try {
			Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
			if (interfaces != null) {
				while (interfaces.hasMoreElements()) {
					try {
						NetworkInterface network = interfaces.nextElement();
						Enumeration<InetAddress> addresses = network.getInetAddresses();
						if (addresses != null) {
							while (addresses.hasMoreElements()) {
								try {
									InetAddress address = addresses.nextElement();
									if (isValidAddress(address)) {
										return address;
									}
								} catch (Throwable e) {
									logger.error("Failed to retriving ip address, " + e.getMessage(), e);
								}
							}
						}
					} catch (Throwable e) {
						logger.error("Failed to retriving ip address, " + e.getMessage(), e);
					}
				}
			}
		} catch (Throwable e) {
			logger.error("Failed to retriving ip address, " + e.getMessage(), e);
		}
		logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
		return localAddress;
	}

	/**
	 * get address
	 * @return
	 */
	private static InetAddress getAddress() {
		if (LOCAL_ADDRESS != null)
			return LOCAL_ADDRESS;
		InetAddress localAddress = getFirstValidAddress();
		LOCAL_ADDRESS = localAddress;
		return localAddress;
	}

	/**
	 * get ip
	 * @return
	 */
	public static String getIp(){
		InetAddress address = getAddress();
		if (address==null) {
			return null;
		}
		return address.getHostAddress();
	}

	/**
	 * get ip:port
	 * @param port
	 * @return
	 */
	public static String getIpPort(int port){
		String ip = getIp();
		if (ip==null) {
			return null;
		}
		return ip.concat(":").concat(String.valueOf(port));
	}

	public static void main(String[] args) throws UnknownHostException {
		System.out.println(getIp());
		System.out.println(getIpPort(8080));
	}

}


text:
CosaTWImaster
=============

Demonstration of Cosa TWI interaction between two Arduino's. Please
see CosaTWIslave.

Circuit
-------
The Arduino analog pins 4 (SDA) and 5 (SCL) are used for I2C/TWI
connection. Pullup resistors are not needed in this example as the
internal pullup resistors are enabled.


text:
package com.littleinc.orm_benchmark.greendao;

import static com.littleinc.orm_benchmark.util.Util.getRandomString;

import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;

import android.content.Context;
import android.util.Log;

import com.littleinc.orm_benchmark.BenchmarkExecutable;
import com.littleinc.orm_benchmark.greendao.MessageDao.Properties;
import com.littleinc.orm_benchmark.util.Util;

public enum GreenDaoExecutor implements BenchmarkExecutable {

    INSTANCE;

    private static String DB_NAME = "greendao_db";

    private DataBaseHelper mHelper;

    private DaoMaster mDaoMaster;

    @Override
    public int getProfilerId() {
        return 3;
    }

    @Override
    public void init(Context context, boolean useInMemoryDb) {
        mHelper = new DataBaseHelper(context, (useInMemoryDb ? null : DB_NAME),
                null);
    }

    @Override
    public long createDbStructure() throws SQLException {
        long start = System.nanoTime();
        if (mDaoMaster == null) {
            mDaoMaster = new DaoMaster(mHelper.getWritableDatabase());
        } else {
            DaoMaster.createAllTables(mHelper.getWritableDatabase(), true);
        }
        return System.nanoTime() - start;
    }

    @Override
    public long writeWholeData() throws SQLException {
        final List<User> users = new LinkedList<User>();
        for (int i = 0; i < NUM_USER_INSERTS; i++) {
            User newUser = new User(getRandomString(10), getRandomString(10),
                    null);
            users.add(newUser);
        }

        final List<Message> messages = new LinkedList<Message>();
        for (long i = 0; i < NUM_MESSAGE_INSERTS; i++) {
            Message newMessage = new Message(null);
            newMessage.setCommand_id(i);
            newMessage.setSorted_by(Double.valueOf(System.nanoTime()));
            newMessage.setContent(Util.getRandomString(100));
            newMessage.setClient_id(System.currentTimeMillis());
            newMessage
                    .setSender_id(Math.round(Math.random() * NUM_USER_INSERTS));
            newMessage.setChannel_id(Math.round(Math.random()
                    * NUM_USER_INSERTS));
            newMessage
                    .setCreated_at((int) (System.currentTimeMillis() / 1000L));

            messages.add(newMessage);
        }

        long start = System.nanoTime();
        final DaoSession daoSession = mDaoMaster.newSession();
        daoSession.runInTx(new Runnable() {

            @Override
            public void run() {
                UserDao userDao = daoSession.getUserDao();
                for (User user : users) {
                    userDao.insertOrReplace(user);
                }
                Log.d(GreenDaoExecutor.class.getSimpleName(), "Done, wrote "
                        + NUM_USER_INSERTS + " users");

                MessageDao messageDao = daoSession.getMessageDao();
                for (Message message : messages) {
                    messageDao.insertOrReplace(message);
                }
                Log.d(GreenDaoExecutor.class.getSimpleName(), "Done, wrote "
                        + NUM_MESSAGE_INSERTS + " messages");
                daoSession.clear();
            }
        });
        return System.nanoTime() - start;
    }

    @Override
    public long readWholeData() throws SQLException {
        long start = System.nanoTime();
        DaoSession daoSession = mDaoMaster.newSession();
        MessageDao messageDao = daoSession.getMessageDao();
        Log.d(GreenDaoExecutor.class.getSimpleName(), "Read, "
                + messageDao.queryBuilder().list().size() + " rows");
        daoSession.clear();
        return System.nanoTime() - start;
    }

    @Override
    public long readIndexedField() throws SQLException {
        long start = System.nanoTime();
        DaoSession daoSession = mDaoMaster.newSession();
        MessageDao messageDao = daoSession.getMessageDao();
        Log.d(GreenDaoExecutor.class.getSimpleName(),
                "Read, "
                        + messageDao
                                .queryBuilder()
                                .where(Properties.Command_id
                                        .eq(LOOK_BY_INDEXED_FIELD)).list()
                                .size() + " rows");
        daoSession.clear();
        return System.nanoTime() - start;
    }

    @Override
    public long readSearch() throws SQLException {
        long start = System.nanoTime();
        DaoSession daoSession = mDaoMaster.newSession();
        MessageDao messageDao = daoSession.getMessageDao();
        Log.d(GreenDaoExecutor.class.getSimpleName(),
                "Read, "
                        + messageDao
                                .queryBuilder()
                                .limit((int) SEARCH_LIMIT)
                                .where(Properties.Content.like("%"
                                        + SEARCH_TERM + "%")).list().size()
                        + " rows");
        daoSession.clear();
        return System.nanoTime() - start;
    }

    @Override
    public long dropDb() throws SQLException {
        long start = System.nanoTime();
        DaoMaster.dropAllTables(mHelper.getWritableDatabase(), true);
        return System.nanoTime() - start;
    }

    @Override
    public String getOrmName() {
        return "GreenDAO";
    }

}


text:
class CreateUsers < ActiveRecord::Migration
  using(:foo)

  def change
    create_table :users do |t|
      t.name :string
      t.email :string

      t.timestamps null: false
    end
  end
end


text:
/* montserrat-regular - latin */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    src: local('Montserrat Regular'), local('Montserrat-Regular'),
         url('./montserrat-v12-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
         url('./montserrat-v12-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
  }


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Ocronet.Dynamic.ImgLib;
using Ocronet.Dynamic.Utils;

namespace Ocronet.Dynamic.Segmentation
{
    public class SegmRoutine
    {
        public static int cseg_pixel(int chr)
        {
            if (!(chr > 0 && chr < 4096))
                throw new Exception("ASSERT: chr > 0 && chr < 4096");
            return (1 << 12) | chr;
        }

        public static void combine_segmentations(ref Intarray dst, Intarray src)
        {
            dst.SameDims(src);
            int n = NarrayUtil.Max(dst) + 1;
            for(int i = 0; i < dst.Length1d(); i++)
                dst.Put1d(i, (dst.At1d(i) + src.At1d(i) * n));
            ImgLabels.renumber_labels(dst, 1);
        }

        public static void fix_diacritics(Intarray segmentation)
        {
            Narray<Rect> bboxes = new Narray<Rect>();
            ImgLabels.bounding_boxes(ref bboxes, segmentation);
            if (bboxes.Length() < 1) return;
            Intarray assignments = new Intarray(bboxes.Length());
            for (int i = 0; i < assignments.Length(); i++)
                assignments[i] = i;
            for (int j = 0; j < bboxes.Length(); j++)
            {
                float dist = 1e38f;
                int closest = -1;
                for (int i = 0; i < bboxes.Length(); i++)
                {
                    // j should overlap i in the x direction
                    if (bboxes.At1d(j).x1 < bboxes.At1d(i).x0) continue;
                    if (bboxes.At1d(j).x0 > bboxes.At1d(i).x1) continue;
                    // j should be above i
                    if (!(bboxes.At1d(j).y0 >= bboxes.At1d(i).y1)) continue;
#if false
                // j should be smaller than i
                if(!(bboxes.At1d(j).area()<bboxes.At1d(i).area())) continue;
#endif
                    float d = Math.Abs((bboxes[j].x0 + bboxes[j].x1) / 2 - (bboxes[i].x0 + bboxes[i].x1) / 2);
                    if (d >= dist) continue;
                    dist = d;
                    closest = i;
                }
                if (closest < 0) continue;
                assignments[j] = closest;
            }
            for (int i = 0; i < segmentation.Length(); i++)
                segmentation.Put1d(i, assignments[segmentation.At1d(i)]);
            ImgLabels.renumber_labels(segmentation, 1);
        }

        public static void local_min(ref Floatarray result, Floatarray data, int r)
        {
            int n = data.Length();
            result.Resize(n);
            for(int i=0; i<n; i++) {
                float lmin = data[i];
                for(int j=-r; j<=r; j++) {
                    int k = i+j;
                    unchecked
                    {
                        if ((uint)(k) >= (uint)(n)) continue;
                    }
                    if(data[k] >= lmin) continue;
                    lmin = data[k];
                }
                result[i] = lmin;
            }
        }

        public static void local_minima(ref Intarray result, Floatarray data, int r, float threshold)
        {
            int n = data.Length();
            result.Clear();
            Floatarray lmin = new Floatarray();
            local_min(ref lmin, data, r);
            for(int i=1; i<n-1; i++) {
                if(data[i] <= threshold && data[i] <= lmin[i] &&
                   data[i]<=data[i-1] && data[i]<data[i+1]) {
                    result.Push(i);
                }
            }
        }

        public static void line_segmentation_sort_x(Intarray segmentation)
        {
            if(NarrayUtil.Max(segmentation) > 100000)
                throw new Exception("line_segmentation_merge_small_components: to many segments");
            Narray<Rect> bboxes = new Narray<Rect>();
            ImgLabels.bounding_boxes(ref bboxes, segmentation);
            Floatarray x0s = new Floatarray();
            unchecked
            {
                x0s.Push((float)-999999);
            }
            for (int i = 1; i < bboxes.Length(); i++)
            {
                if (bboxes[i].Empty())
                {
                    x0s.Push(999999);
                }
                else
                {
                    x0s.Push(bboxes[i].x0);
                }
            }
            // dprint(x0s,1000); printf("\n");
            Narray<int> permutation = new Intarray();
            Narray<int> rpermutation = new Intarray();
            NarrayUtil.Quicksort(permutation, x0s);
            rpermutation.Resize(permutation.Length());
            for (int i = 0; i < permutation.Length(); i++)
                rpermutation[permutation[i]] = i;
            // dprint(rpermutation,1000); printf("\n");
            for (int i = 0; i < segmentation.Length1d(); i++)
            {
                if (segmentation.At1d(i) == 0) continue;
                segmentation.Put1d(i, rpermutation[segmentation.At1d(i)]);
            }
        }

        /// <summary>
        /// A valid line segmentation may contain 0 or 0xffffff as the
        /// background, and otherwise numbers components starting at 1.
        /// The segmentation consists of segmented background pixels
        /// (0x80xxxx) and segmented foreground pixels (0x00xxxx).  The
        /// segmented foreground pixels should constitute a usable
        /// binarization of the original image.
        /// </summary>
        public static void check_line_segmentation(Intarray cseg)
        {
            if (cseg.Length1d() == 0) return;
            if (cseg.Rank() != 2)
                throw new Exception("check_line_segmentation: rank must be 2");
            for (int i = 0; i < cseg.Length1d(); i++)
            {
                int value = cseg.At1d(i);
                if (value == 0) continue;
                if (value == 0xffffff) continue;
                if ((value & 0x800000) > 0)
                {
                    if((value & ~0x800000) > 100000)
                        throw new Exception("check_line_segmentation: (value & ~0x800000) > 100000");
                }
                else
                    if(value > 100000)
                        throw new Exception("check_line_segmentation: value > 100000");
            }
        }

        public static void make_line_segmentation_black(Intarray a)
        {
            check_line_segmentation(a);
            ImgMisc.replace_values(a, 0xFFFFFF, 0);
            for (int i = 0; i < a.Length1d(); i++)
                a.Put1d(i, a.At1d(i) & 0xFFF);
        }

        public static void make_line_segmentation_white(Intarray a)
        {
            ImgMisc.replace_values(a, 0, 0xFFFFFF);
            check_line_segmentation(a);
        }

        public static void check_page_segmentation(Intarray pseg)
        {
            bool allow_zero = true;
            Narray<bool> used = new Narray<bool>(5000);
            used.Fill(false);
            int nused = 0;
            int mused = 0;
            for (int i = 0; i < pseg.Length1d(); i++)
            {
                uint pixel = (uint)pseg.At1d(i);
                if (!(allow_zero || pixel != 0))
                    throw new Exception("CHECK_ARG: (allow_zero || pixel != 0)");
                if (pixel == 0 || pixel == 0xffffff) continue;
                int column = (int)(0xff & (pixel >> 16));
                int paragraph = (int)(0xff & (pixel >> 8));
                int line = (int)(0xff & pixel);
                if(!((column > 0 && column < 32) || column == 254 || column == 255))
                    throw new Exception("CHECK_ARG: ((column > 0 && column < 32) || column == 254 || column == 255)");
                if(!((paragraph >= 0 && paragraph < 64) || (paragraph >= 250 && paragraph <= 255)))
                    throw new Exception("CHECK_ARG: ((paragraph >= 0 && paragraph < 64) || (paragraph >= 250 && paragraph <= 255))");
                if (column < 32)
                {
                    if (!used[line])
                        nused++;
                    used[line] = true;
                    if (line > mused)
                        mused = line;
                }
            }
            // character segments need to be numbered sequentially (no gaps)
            // (gaps usually happen when someone passes a binary image instead of a segmentation)
            if (!(nused == mused || nused == mused + 1))
                Global.Debugf("warn", "check_page_segmentation found non-sequentially numbered segments");
        }

        public static void make_page_segmentation_black(Intarray a)
        {
            check_page_segmentation(a);
            ImgMisc.replace_values(a, 0xFFFFFF, 0);
        }

        public static void make_page_segmentation_white(Intarray a)
        {
            ImgMisc.replace_values(a, 0, 0xFFFFFF);
            check_page_segmentation(a);
        }

        public static void remove_small_components(Intarray segmentation, int r = 5)
        {
            remove_small_components(segmentation, r, r);
        }

        public static void remove_small_components(Intarray segmentation, int w = 5, int h = 4)
        {
            if (NarrayUtil.Max(segmentation) > 100000)
                throw new Exception("remove_small_components: to many segments");
            Narray<Rect> bboxes = new Narray<Rect>();
            ImgLabels.bounding_boxes(ref bboxes, segmentation);
            for (int i = 1; i < bboxes.Length(); i++)
            {
                Rect b = bboxes[i];
                if (b.Width() < w && b.Height() < h)
                {
                    for (int x = b.x0; x < b.x1; x++)
                        for (int y = b.y0; y < b.y1; y++)
                            if (segmentation[x, y] == i)
                                segmentation[x, y] = 0;
                }
            }
        }

        public static void remove_small_components<T>(Narray<T> bimage, int mw, int mh)
        {
            Intarray image = new Intarray();
            image.Copy(bimage);
            ImgLabels.label_components(ref image);
            Narray<Rect> rects = new Narray<Rect>();
            ImgLabels.bounding_boxes(ref rects, image);
            Bytearray good = new Bytearray(rects.Length());
            for(int i=0; i<good.Length(); i++)
                good[i] = 1;
            for (int i = 0; i < rects.Length(); i++)
            {
                if (rects[i].Width() < mw && rects[i].Height() < mh)
                {
                    // printf("*** %d %d %d\n",i,rects[i].width(),rects[i].height());
                    good[i] = 0;
                }
            }
            for (int i = 0; i < image.Length1d(); i++)
            {
                if (good[image.At1d(i)] == 0)
                    image.Put1d(i, 0);
            }
            for (int i = 0; i < image.Length1d(); i++)
                if (image.At1d(i) == 0) bimage.Put1d(i, default(T)); // default(T) - 0
        }

        public static void erase_small_components(Floatarray input, float mins=0.2f, float thresh=0.25f)
        {
            // compute a thresholded image for component labeling
            float threshold = thresh * NarrayUtil.Max(input);
            Intarray components = new Intarray();
            components.MakeLike(input);
            components.Fill(0);
            for (int i = 0; i < components.Length(); i++)
                components[i] = (input[i] > threshold ? 1 : 0);

            // compute the number of pixels in each component
            int n = ImgLabels.label_components(ref components);
            Intarray totals = new Intarray(n + 1);
            totals.Fill(0);
            for (int i = 0; i < components.Length(); i++)
                totals[components[i]] = totals[components[i]] + 1;
            totals[0] = 0;
            int biggest = NarrayUtil.ArgMax(totals);

            // erase small components
            float minsize = mins * totals[biggest];
            Bytearray keep = new Bytearray(n+1);
            float background = NarrayUtil.Min(input);
            for (int i = 0; i < keep.Length(); i++)
                keep[i] = (byte)(totals[i] > minsize ? 1 : 0);
            for (int i = 0; i < input.Length(); i++)
                if (keep[components[i]] == 0)
                    input[i] = background;
        }

        public static void extract_holes(ref Bytearray holes, Bytearray binarized)
        {
            Intarray temp = new Intarray();
            temp.Copy(binarized);
            NarrayUtil.Sub(255, temp);
            ImgLabels.label_components(ref temp);
            int background = -1;
            for (int i = 0; i < temp.Dim(0); i++)
            {
                if (temp[i, 0] != 0)
                {
                    background = temp[i, 0];
                    break;
                }
            }
            holes.MakeLike(temp);
            holes.Fill((byte)0);
            if(background <= 0)
                throw new Exception("extract_holes: background must be more 0");
            for (int i = 0; i < temp.Dim(0); i++)
            {
                for (int j = 0; j < temp.Dim(1); j++)
                {
                    if (temp[i, j] > 0 && temp[i, j] != background)
                        holes[i, j] = 255;
                }
            }
            /*fprintf(stderr, "segholes\n");
            dsection("segholes");
            dshow(holes, "y");*/
        }

        public static void line_segmentation_merge_small_components(ref Intarray segmentation, int r = 10)
        {
            if (NarrayUtil.Max(segmentation) > 100000)
                throw new Exception("line_segmentation_merge_small_components: to many segments");
            make_line_segmentation_black(segmentation);
            Narray<Rect> bboxes = new Narray<Rect>();
            ImgLabels.bounding_boxes(ref bboxes, segmentation);
            bboxes[0] = Rect.CreateEmpty();
            bool changed;
            do {
                changed = false;
                for(int i=1; i<bboxes.Length(); i++)
                {
                    Rect b = bboxes[i];
                    if(b.Empty()) continue;
                    if(b.Width()>=r || b.Height()>=r) continue;
                    // merge small components only with touching components
                    int closest = 0;
                    Rect b1 = b.Grow(1);
                    b1.Intersect(new Rect(0, 0, segmentation.Dim(0), segmentation.Dim(1)));
                    for(int x=b1.x0; x<b1.x1; x++)
                    {
                        for(int y=b1.y0; y<b1.y1; y++)
                        {
                            int value = segmentation[x,y];
                            if(value==0) continue;
                            if(value==i) continue;
                            closest = value;
                            break;
                        }
                    }
                    if(closest==0) continue;
                    for (int x = b.x0; x < b.x1; x++)
                        for (int y = b.y0; y < b.y1; y++)
                            if (segmentation[x, y] == i)
                                segmentation[x, y] = closest;
                    bboxes[i] = Rect.CreateEmpty();
                    changed = true;
                }
            } while (changed);
        }

        public static void rseg_to_cseg(Intarray cseg, Intarray rseg, Intarray ids)
        {
            Intarray map = new Intarray(NarrayUtil.Max(rseg) + 1);
            map.Fill(0);
            int color = 0;
            for (int i = 0; i < ids.Length(); i++)
            {
                if (ids[i] == 0) continue;
                color++;
                int start = ids[i] >> 16;
                int end = ids[i] & 0xFFFF;
                if (start > end)
                    throw new Exception("segmentation encoded in IDs looks seriously broken!");
                if (start >= map.Length() || end >= map.Length())
                    throw new Exception("segmentation encoded in IDs doesn't fit!");
                for (int j = start; j <= end; j++)
                    map[j] = color;
            }
            cseg.MakeLike(rseg);
            for (int i = 0; i < cseg.Length1d(); i++)
                cseg.Put1d(i, map[rseg.At1d(i)]);
        }

        /// <summary>
        /// Merge segments from start to end.
        /// </summary>
        /// <param name="cseg">Output</param>
        /// <param name="rseg">Input</param>
        /// <param name="start">start merge position</param>
        /// <param name="end">end merge position</param>
        public static void rseg_to_cseg(Intarray cseg, Intarray rseg, int start, int end)
        {
            int maxSegNum = NarrayUtil.Max(rseg);
            if (start > end)
                throw new Exception("segmentation encoded in IDs looks seriously broken!");
            if (start > maxSegNum || end > maxSegNum)
                throw new Exception("segmentation encoded in IDs doesn't fit!");
            Intarray map = new Intarray(maxSegNum + 1);
            map.Fill(0);

            int color = 1;
            for (int i = 1; i <= maxSegNum; i++)
            {
                map[i] = color;
                if (i < start || i >= end)
                    color++;
            }
            cseg.MakeLike(rseg);
            for (int i = 0; i < cseg.Length1d(); i++)
                cseg.Put1d(i, map[rseg.At1d(i)]);
        }

        /// <summary>
        /// Remove segments from start to end.
        /// </summary>
        /// <param name="cseg">Output</param>
        /// <param name="rseg">Input</param>
        /// <param name="start">start remove position</param>
        /// <param name="end">end remove position</param>
        public static void rseg_to_cseg_remove(Intarray cseg, Intarray rseg,
            Bytearray outimg, Bytearray img, int start, int end)
        {
            int maxSegNum = NarrayUtil.Max(rseg);
            if (start > end)
                throw new Exception("segmentation encoded in IDs looks seriously broken!");
            if (start > maxSegNum || end > maxSegNum)
                throw new Exception("segmentation encoded in IDs doesn't fit!");
            if (rseg.Length1d() != img.Length1d())
                throw new Exception("rseg and img must have same a dimension!");
            Intarray map = new Intarray(maxSegNum + 1);
            map.Fill(0);

            int color = 1;
            for (int i = 1; i <= maxSegNum; i++)
            {
                map[i] = color;
                if (i < start || i > end)
                    color++;
                else
                    map[i] = 0;
            }
            cseg.MakeLike(rseg);
            outimg.Copy(img);
            for (int i = 0; i < cseg.Length1d(); i++)
            {
                int val = rseg.At1d(i);
                cseg.Put1d(i, map[val]);
                if (val > 0 && map[val] == 0)
                    outimg.Put1d(i, 255);
            }
        }

    }
}


text:
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Net;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using System.Web.Security;
using Umbraco.Core;
using Umbraco.Web.Models.ContentEditing;

namespace Umbraco.Web.Editors
{
    /// <summary>
    /// This validates the submitted data in regards to the current membership provider
    /// </summary>
    internal class MembershipProviderValidationFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            base.OnActionExecuting(actionContext);

            //default provider!
            var membershipProvider = Core.Security.MembershipProviderExtensions.GetMembersMembershipProvider();

            var contentItem = (MemberSave) actionContext.ActionArguments["contentItem"];

            var validEmail = ValidateUniqueEmail(contentItem, membershipProvider, actionContext);
            if (validEmail == false)
            {
                actionContext.ModelState.AddPropertyError(
                    new ValidationResult("Email address is already in use", new[] {"value"}),
                    string.Format("{0}email", Constants.PropertyEditors.InternalGenericPropertiesPrefix));
            }

            var validLogin = ValidateUniqueLogin(contentItem, membershipProvider, actionContext);
            if (validLogin == false)
            {
                actionContext.ModelState.AddPropertyError(
                    new ValidationResult("Username is already in use", new[] { "value" }),
                    string.Format("{0}login", Constants.PropertyEditors.InternalGenericPropertiesPrefix));
            }
        }

        internal bool ValidateUniqueLogin(MemberSave contentItem, MembershipProvider membershipProvider, HttpActionContext actionContext)
        {
            if (contentItem == null) throw new ArgumentNullException("contentItem");
            if (membershipProvider == null) throw new ArgumentNullException("membershipProvider");

            int totalRecs;
            var existingByName = membershipProvider.FindUsersByName(contentItem.Username.Trim(), 0, int.MaxValue, out totalRecs);
            switch (contentItem.Action)
            {
                case ContentSaveAction.Save:

                    //ok, we're updating the member, we need to check if they are changing their login and if so, does it exist already ?
                    if (contentItem.PersistedContent.Username.InvariantEquals(contentItem.Username.Trim()) == false)
                    {
                        //they are changing their login name
                        if (existingByName.Cast<MembershipUser>().Select(x => x.UserName)
                            .Any(x => x == contentItem.Username.Trim()))
                        {
                            //the user cannot use this login
                            return false;
                        }
                    }
                    break;
                case ContentSaveAction.SaveNew:
                    //check if the user's login already exists
                    if (existingByName.Cast<MembershipUser>().Select(x => x.UserName)
                        .Any(x => x == contentItem.Username.Trim()))
                    {
                        //the user cannot use this login
                        return false;
                    }
                    break;
                default:
                    //we don't support this for members
                    throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return true;
        }

        internal bool ValidateUniqueEmail(MemberSave contentItem, MembershipProvider membershipProvider, HttpActionContext actionContext)
        {
            if (contentItem == null) throw new ArgumentNullException("contentItem");
            if (membershipProvider == null) throw new ArgumentNullException("membershipProvider");

            if (membershipProvider.RequiresUniqueEmail == false)
            {
                return true;
            }

            int totalRecs;
            var existingByEmail = membershipProvider.FindUsersByEmail(contentItem.Email.Trim(), 0, int.MaxValue, out totalRecs);
            switch (contentItem.Action)
            {
                case ContentSaveAction.Save:
                    //ok, we're updating the member, we need to check if they are changing their email and if so, does it exist already ?
                    if (contentItem.PersistedContent.Email.InvariantEquals(contentItem.Email.Trim()) == false)
                    {
                        //they are changing their email
                        if (existingByEmail.Cast<MembershipUser>().Select(x => x.Email)
                                           .Any(x => x.InvariantEquals(contentItem.Email.Trim())))
                        {
                            //the user cannot use this email
                            return false;
                        }
                    }
                    break;
                case ContentSaveAction.SaveNew:
                    //check if the user's email already exists
                    if (existingByEmail.Cast<MembershipUser>().Select(x => x.Email)
                                       .Any(x => x.InvariantEquals(contentItem.Email.Trim())))
                    {
                        //the user cannot use this email
                        return false;
                    }
                    break;
                default:
                    //we don't support this for members
                    throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return true;
        }
    }
}


text:
#ifndef	_GLOB_H
#define	_GLOB_H	1

#ifdef	__cplusplus
extern "C" {
#endif

#undef	__ptr_t
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# if !defined __GLIBC__ || !defined __P
#  undef __P
#  undef __PMT
#  define __P(protos)	protos
#  define __PMT(protos)	protos
#  if !defined __GNUC__ || __GNUC__ < 2
#   undef __const
#   define __const const
#  endif
# endif
# define __ptr_t	void *
#else /* Not C++ or ANSI C.  */
# undef	__P
# undef __PMT
# define __P(protos)	()
# define __PMT(protos)	()
# undef	__const
# define __const
# define __ptr_t	char *
#endif /* C++ or ANSI C.  */

/* We need `size_t' for the following definitions.  */
#ifndef __size_t
# if defined __GNUC__ && __GNUC__ >= 2
typedef __SIZE_TYPE__ __size_t;
#  ifdef _XOPEN_SOURCE
typedef __SIZE_TYPE__ size_t;
#  endif
# else
/* This is a guess.  */
typedef unsigned long int __size_t;
# endif
#else
/* The GNU CC stddef.h version defines __size_t as empty.  We need a real
   definition.  */
# undef __size_t
# define __size_t size_t
#endif

/* Bits set in the FLAGS argument to `glob'.  */
#define	GLOB_ERR	(1 << 0)/* Return on read errors.  */
#define	GLOB_MARK	(1 << 1)/* Append a slash to each name.  */
#define	GLOB_NOSORT	(1 << 2)/* Don't sort the names.  */
#define	GLOB_DOOFFS	(1 << 3)/* Insert PGLOB->gl_offs NULLs.  */
#define	GLOB_NOCHECK	(1 << 4)/* If nothing matches, return the pattern.  */
#define	GLOB_APPEND	(1 << 5)/* Append to results of a previous call.  */
#define	GLOB_NOESCAPE	(1 << 6)/* Backslashes don't quote metacharacters.  */
#define	GLOB_PERIOD	(1 << 7)/* Leading `.' can be matched by metachars.  */

#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
     || defined _GNU_SOURCE)
# define GLOB_MAGCHAR	 (1 << 8)/* Set in gl_flags if any metachars seen.  */
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions.  */
# define GLOB_BRACE	 (1 << 10)/* Expand "{a,b}" to "a" "b".  */
# define GLOB_NOMAGIC	 (1 << 11)/* If no magic chars, return the pattern.  */
# define GLOB_TILDE	 (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR	 (1 << 13)/* Match only directories.  */
# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
				      if the user name is not available.  */
# define __GLOB_FLAGS	(GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
			 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|     \
			 GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE|     \
			 GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else
# define __GLOB_FLAGS	(GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
			 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|     \
			 GLOB_PERIOD)
#endif

/* Error returns from `glob'.  */
#define	GLOB_NOSPACE	1	/* Ran out of memory.  */
#define	GLOB_ABORTED	2	/* Read error.  */
#define	GLOB_NOMATCH	3	/* No matches found.  */
#define GLOB_NOSYS	4	/* Not implemented.  */
#ifdef _GNU_SOURCE
/* Previous versions of this file defined GLOB_ABEND instead of
   GLOB_ABORTED.  Provide a compatibility definition here.  */
# define GLOB_ABEND GLOB_ABORTED
#endif

/* Structure describing a globbing run.  */
#if !defined _AMIGA && !defined VMS /* Buggy compiler.   */
# ifdef _GNU_SOURCE
struct stat;
# endif
#endif
typedef struct
  {
    __size_t gl_pathc;		/* Count of paths matched by the pattern.  */
    char **gl_pathv;		/* List of matched pathnames.  */
    __size_t gl_offs;		/* Slots to reserve in `gl_pathv'.  */
    int gl_flags;		/* Set to FLAGS, maybe | GLOB_MAGCHAR.  */

    /* If the GLOB_ALTDIRFUNC flag is set, the following functions
       are used instead of the normal file access functions.  */
    void (*gl_closedir) __PMT ((void *));
#ifdef _GNU_SOURCE
    struct dirent *(*gl_readdir) __PMT ((void *));
#else
    void *(*gl_readdir) __PMT ((void *));
#endif
    __ptr_t (*gl_opendir) __PMT ((__const char *));
#ifdef _GNU_SOURCE
    int (*gl_lstat) __PMT ((__const char *__restrict,
			    struct stat *__restrict));
    int (*gl_stat) __PMT ((__const char *__restrict, struct stat *__restrict));
#else
    int (*gl_lstat) __PMT ((__const char *__restrict, void *__restrict));
    int (*gl_stat) __PMT ((__const char *__restrict, void *__restrict));
#endif
  } glob_t;

#ifdef _LARGEFILE64_SOURCE
# ifdef _GNU_SOURCE
struct stat64;
# endif
typedef struct
  {
    __size_t gl_pathc;
    char **gl_pathv;
    __size_t gl_offs;
    int gl_flags;

    /* If the GLOB_ALTDIRFUNC flag is set, the following functions
       are used instead of the normal file access functions.  */
    void (*gl_closedir) __PMT ((void *));
# ifdef _GNU_SOURCE
    struct dirent64 *(*gl_readdir) __PMT ((void *));
# else
    void *(*gl_readdir) __PMT ((void *));
# endif
    __ptr_t (*gl_opendir) __PMT ((__const char *));
# ifdef _GNU_SOURCE
    int (*gl_lstat) __PMT ((__const char *__restrict,
			    struct stat64 *__restrict));
    int (*gl_stat) __PMT ((__const char *__restrict,
			   struct stat64 *__restrict));
# else
    int (*gl_lstat) __PMT ((__const char *__restrict, void *__restrict));
    int (*gl_stat) __PMT ((__const char *__restrict, void *__restrict));
# endif
  } glob64_t;
#endif

#if _FILE_OFFSET_BITS == 64 && __GNUC__ < 2
# define glob glob64
# define globfree globfree64
#endif

/* Do glob searching for PATTERN, placing results in PGLOB.
   The bits defined above may be set in FLAGS.
   If a directory cannot be opened or read and ERRFUNC is not nil,
   it is called with the pathname that caused the error, and the
   `errno' value from the failing call; if it returns non-zero
   `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
   If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
   Otherwise, `glob' returns zero.  */
#if _FILE_OFFSET_BITS != 64 || __GNUC__ < 2
extern int glob __P ((__const char *__restrict __pattern, int __flags,
		      int (*__errfunc) (__const char *, int),
		      glob_t *__restrict __pglob));

/* Free storage allocated in PGLOB by a previous `glob' call.  */
extern void globfree __P ((glob_t *__pglob));
#else
extern int glob __P ((__const char *__restrict __pattern, int __flags,
		      int (*__errfunc) (__const char *, int),
		      glob_t *__restrict __pglob)) __asm__ ("glob64");

extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
#endif

#ifdef _LARGEFILE64_SOURCE
extern int glob64 __P ((__const char *__restrict __pattern, int __flags,
			int (*__errfunc) (__const char *, int),
			glob64_t *__restrict __pglob));

extern void globfree64 __P ((glob64_t *__pglob));
#endif

#ifdef _GNU_SOURCE
/* Return nonzero if PATTERN contains any metacharacters.
   Metacharacters can be quoted with backslashes if QUOTE is nonzero.

   This function is not part of the interface specified by POSIX.2
   but several programs want to use it.  */
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
#endif

#ifdef	__cplusplus
}
#endif

#endif /* glob.h  */


text:
var namespaceIocgns =
[
    [ "DatabaseIO", "classIocgns_1_1DatabaseIO.html", "classIocgns_1_1DatabaseIO" ],
    [ "DecompositionData", "classIocgns_1_1DecompositionData.html", "classIocgns_1_1DecompositionData" ],
    [ "DecompositionDataBase", "classIocgns_1_1DecompositionDataBase.html", "classIocgns_1_1DecompositionDataBase" ],
    [ "Initializer", "classIocgns_1_1Initializer.html", "classIocgns_1_1Initializer" ],
    [ "IOFactory", "classIocgns_1_1IOFactory.html", "classIocgns_1_1IOFactory" ],
    [ "ParallelDatabaseIO", "classIocgns_1_1ParallelDatabaseIO.html", "classIocgns_1_1ParallelDatabaseIO" ],
    [ "StructuredZoneData", "classIocgns_1_1StructuredZoneData.html", "classIocgns_1_1StructuredZoneData" ],
    [ "Utils", "classIocgns_1_1Utils.html", "classIocgns_1_1Utils" ],
    [ "ZoneData", "classIocgns_1_1ZoneData.html", "classIocgns_1_1ZoneData" ]
];


text:
const NodeCache = require('node-cache')

const cache = new NodeCache()

module.exports = cache


text:
/* eslint react/jsx-key: off */
import React from 'react';
import {
    Create,
    Datagrid,
    DisabledInput,
    Edit,
    EditButton,
    Filter,
    FormTab,
    List,
    Responsive,
    SaveButton,
    Show,
    ShowButton,
    SimpleForm,
    SimpleList,
    Tab,
    TabbedForm,
    TabbedShowLayout,
    TextField,
    TextInput,
    Toolbar,
    required,
    translate,
} from 'admin-on-rest'; // eslint-disable-line import/no-unresolved

import PeopleIcon from 'material-ui/svg-icons/social/people';
export const UserIcon = PeopleIcon;

const UserFilter = props => (
    <Filter {...props}>
        {permissions => [
            <TextInput key="q" label="user.list.search" source="q" alwaysOn />,
            <TextInput key="name" source="name" />,
            permissions === 'admin' ? (
                <TextInput key="role" source="role" />
            ) : null,
        ]}
    </Filter>
);

const titleFieldStyle = {
    maxWidth: '20em',
    overflow: 'hidden',
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap',
};
export const UserList = props => (
    <List
        {...props}
        filters={<UserFilter />}
        sort={{ field: 'name', order: 'ASC' }}
    >
        {permissions => (
            <Responsive
                key="userList"
                small={
                    <SimpleList
                        primaryText={record => record.name}
                        secondaryText={record =>
                            permissions === 'admin' ? record.role : ''}
                    />
                }
                medium={
                    <Datagrid>
                        <TextField source="id" />
                        <TextField source="name" style={titleFieldStyle} />
                        {permissions === 'admin' && <TextField source="role" />}
                        <EditButton />
                        <ShowButton />
                    </Datagrid>
                }
            />
        )}
    </List>
);

const UserTitle = translate(({ record, translate }) => (
    <span>
        {record ? translate('user.edit.title', { title: record.name }) : ''}
    </span>
));

const UserCreateToolbar = ({ permissions, ...props }) => (
    <Toolbar {...props}>
        <SaveButton
            label="user.action.save_and_show"
            redirect="show"
            submitOnEnter={true}
        />
        {permissions === 'admin' && (
            <SaveButton
                label="user.action.save_and_add"
                redirect={false}
                submitOnEnter={false}
                raised={false}
            />
        )}
    </Toolbar>
);

export const UserCreate = props => (
    <Create {...props}>
        {permissions => (
            <SimpleForm
                toolbar={<UserCreateToolbar permissions={permissions} />}
                defaultValue={{ role: 'user' }}
            >
                <TextInput source="name" validate={[required]} />
                {permissions === 'admin' && (
                    <TextInput source="role" validate={[required]} />
                )}
            </SimpleForm>
        )}
    </Create>
);

export const UserEdit = props => (
    <Edit title={<UserTitle />} {...props}>
        {permissions => (
            <TabbedForm defaultValue={{ role: 'user' }}>
                <FormTab label="user.form.summary">
                    {permissions === 'admin' && <DisabledInput source="id" />}
                    <TextInput source="name" validate={required} />
                </FormTab>
                {permissions === 'admin' && (
                    <FormTab label="user.form.security">
                        <TextInput source="role" validate={required} />
                    </FormTab>
                )}
            </TabbedForm>
        )}
    </Edit>
);

export const UserShow = props => (
    <Show title={<UserTitle />} {...props}>
        {permissions => (
            <TabbedShowLayout>
                <Tab label="user.form.summary">
                    <TextField source="id" />
                    <TextField source="name" />
                </Tab>
                {permissions === 'admin' && (
                    <Tab label="user.form.security">
                        <TextField source="role" />
                    </Tab>
                )}
            </TabbedShowLayout>
        )}
    </Show>
);


text:
<?php
namespace WE\Example\Domain\Model;

/*                                                                        *
 * This script belongs to the TYPO3 Flow package "WE.Example".            *
 *                                                                        *
 *                                                                        */

use TYPO3\Flow\Annotations as Flow;
use Doctrine\ORM\Mapping as ORM;

/**
 * @Flow\Entity
 */
class News {

	/**
	 * @var string
	 */
	protected $title;

	/**
	 * @var string
	 */
	protected $teaser;

	/**
	 * @var string
	 */
	protected $description;

	/**
	 * @return string
	 */
	public function getTitle() {
		return $this->title;
	}

	/**
	 * @param string $title
	 * @return void
	 */
	public function setTitle($title) {
		$this->title = $title;
	}

	/**
	 * @return string
	 */
	public function getTeaser() {
		return $this->teaser;
	}

	/**
	 * @param string $teaser
	 * @return void
	 */
	public function setTeaser($teaser) {
		$this->teaser = $teaser;
	}

	/**
	 * @return string
	 */
	public function getDescription() {
		return $this->description;
	}

	/**
	 * @param string $description
	 * @return void
	 */
	public function setDescription($description) {
		$this->description = $description;
	}

}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.apache.fop.render.pcl.extensions (Apache FOP 1.0 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.fop.render.pcl.extensions package">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

fop 1.0

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.apache.fop.render.pcl.extensions

Class Summary

PCLElementMapping
PCL-specific extensions for Apache FOP.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

fop 1.0

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.


text:
namespace Google.Cloud.CloudBuild.V1.Snippets
{
    // [START cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async]
    using Google.Api.Gax.ResourceNames;
    using Google.Cloud.CloudBuild.V1;
    using System.Threading.Tasks;

    public sealed partial class GeneratedCloudBuildClientSnippets
    {
        /// <summary>Snippet for CreateBuildTriggerAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public async Task CreateBuildTriggerRequestObjectAsync()
        {
            // Create client
            CloudBuildClient cloudBuildClient = await CloudBuildClient.CreateAsync();
            // Initialize request argument(s)
            CreateBuildTriggerRequest request = new CreateBuildTriggerRequest
            {
                ProjectId = "",
                Trigger = new BuildTrigger(),
                ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
            };
            // Make the request
            BuildTrigger response = await cloudBuildClient.CreateBuildTriggerAsync(request);
        }
    }
    // [END cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async]
}


text:
<img src="https://github.com/Citrus-CAF/packages_apps_Margarita/raw/n7x/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png">

# Margarita

``
A Open-Source Substratum theme made with ❤ by #TEAMCARDINAL
``

[![Build Status](https://travis-ci.org/Citrus-CAF/packages_apps_Margarita.svg?branch=o8x-exp)](https://travis-ci.org/Citrus-CAF/packages_apps_Margarita)

## Contributors
- **[@Adarsh-MR](https://github.com/Adarsh-MR)**
- **[@rohitporoli](https://github.com/rohitporoli)**
- **[@PhenomX1998](https://github.com/PhenomX1998)**

## Credits

``
Firstly i'd like to thank all the wonderful themers out there, without their help, patience, and support, this theme would have been impossible.
``

- `Gurpreet` - For guiding us on theming and helping at anytime, its really wasn't possible without him :), checkout his wonderful theme: [Streamlined Night & Day on Playstore](https://play.google.com/store/apps/details?id=snn.streamlined.night).

- `David Wilson @daveyannihilation` - for Open-Sourcing  his great theme: [Domination Github](https://github.com/daveyannihilation/Domination), its really a tresure chest for newbie themers,
  checkout [Domination on Playstore](https://play.google.com/store/apps/details?id=com.annihilation.dominationdonate).

- `Simao Gomes Viana @xdevs23` - for his open-source theme: [Blue Emerald](https://github.com/xdevs23/BluEmerald), its really helped me lot, checkout his theme: [Blue Emerald on Playstore](https://play.google.com/store/apps/details?id=io.xdevs23.theme.bluemerald.cm).

- `Savio Perera` - for helping us anytime/anyday.

- `Harsh Shandilya @MSF-Jarvis` - for answering/helping us to fix weird errors and issue we stumbleupon.

- `Gaurav` - for 24/7 frequent testing.

- `[Projekt.]` - for such a great theming engine, template and guide.


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>pendingCallback</title>
</head>
<body>
<script>
  console.log('start');

  const promise = new Promise(function (resolve, reject) {
    setTimeout(function () {
      console.log('setTimeout-start');

      Promise.resolve().then(function () {
        console.log('microTask-then');
      });

      promise.then(function (value) {
        console.log('fulfilledCallback-' + value);
      });

      console.log('setTimeout-end');

      resolve('then');
    }, 0);
  });

  promise.then(function (value) {
    console.log('pendingCallback-' + value);
  });

  console.log('end');
</script>
</body>
</html>


text:
class StrategyBag

  def initialize(*args)
    interface, *param_values = args
    if param_values.size != self.class.param_names.size
      raise ArgumentError, "expected params: interface, #{self.class.param_names.map(&:to_s).join(', ')}, but only #{args.size} params given"
    end
    @evaluator = Evaluator.new
    @evaluator.interface = interface
    self.class.param_names.each_with_index do |name, index|
      @evaluator.define_value name, param_values[index]
    end
  end

  def run
    self.class.derived_attributes.each do |name, block|
      @evaluator.define_func name, block
    end
    self.class.conditions.each do |positive_name, negative_name, p|
      @evaluator.define_func positive_name, p
      @evaluator.define_negative negative_name, positive_name
    end
    satisfied_strategies = self.class.strategies.select { |strategy|
      @evaluator.conditions_met?(strategy.conditions)
    }
    selected_strategy = satisfied_strategies.first
    if selected_strategy
      @evaluator.instance_eval(&selected_strategy.action)
    else
      @evaluator.instance_eval(&(self.class.default_strategy))
    end
  end

  private

  class Evaluator
    attr_accessor :interface

    def initialize
      @table = {}
    end

    def define_value(name, value)
      #puts "E: #{name}: #{value.inspect}"
      @table[name.to_sym] = value
    end

    def define_func(name, p)
      v = instance_eval(&p)
      define_value(name, v)
    end

    def define_negative(name, positive_name)
      define_value(name, ! send(positive_name))
    end

    def conditions_met?(a)
      a.all? { |c| send(c) }
    end

    def method_missing(m, *args, &block)
      #puts "missing: #{m}"
      if @table.has_key?(m.to_sym) && args.empty?
        @table[m.to_sym]
      elsif interface.respond_to?(m)
        interface.public_send(m, *args, &block)
      else
        super
      end
    end
  end

  module ClassDSL
    attr_accessor :param_names, :conditions, :strategies, :default_strategy, :derived_attributes

    def params(*param_names)
      self.param_names = param_names
    end

    def condition(positive_name, negative_name, &p)
      #puts "DSL: condition: #{positive_name}"
      self.conditions ||= []
      self.conditions << [positive_name, negative_name, p]
    end

    def strategy(title = nil, &block)
      self.strategies ||= []
      strategy = Strategy.new
      strategy.instance_eval(&block)
      self.strategies << strategy
    end

    def default(&block)
      self.default_strategy = block
    end

    def derive(name, &block)
      self.derived_attributes ||= []
      self.derived_attributes << [name, block]
    end

  end

  extend ClassDSL

  class Strategy
    attr_accessor :conditions, :action

    def initialize
      @conditions = []
    end

    def condition(name)
      @conditions << name
    end

    def action(&block)
      if block_given?
        @action = block
      else
        @action
      end
    end
  end
end


text:
import os
from enum import Enum
from typing import Optional

__all__ = [
    "ColorDepth",
]

class ColorDepth(str, Enum):
    """
    Possible color depth values for the output.
    """

    value: str

    #: One color only.
    DEPTH_1_BIT = "DEPTH_1_BIT"

    #: ANSI Colors.
    DEPTH_4_BIT = "DEPTH_4_BIT"

    #: The default.
    DEPTH_8_BIT = "DEPTH_8_BIT"

    #: 24 bit True color.
    DEPTH_24_BIT = "DEPTH_24_BIT"

    # Aliases.
    MONOCHROME = DEPTH_1_BIT
    ANSI_COLORS_ONLY = DEPTH_4_BIT
    DEFAULT = DEPTH_8_BIT
    TRUE_COLOR = DEPTH_24_BIT

    @classmethod
    def from_env(cls) -> Optional["ColorDepth"]:
        """
        Return the color depth if the $PROMPT_TOOLKIT_COLOR_DEPTH environment
        variable has been set.

        This is a way to enforce a certain color depth in all prompt_toolkit
        applications.
        """
        # Check the `PROMPT_TOOLKIT_COLOR_DEPTH` environment variable.
        all_values = [i.value for i in ColorDepth]
        if os.environ.get("PROMPT_TOOLKIT_COLOR_DEPTH") in all_values:
            return cls(os.environ["PROMPT_TOOLKIT_COLOR_DEPTH"])

        return None

    @classmethod
    def default(cls) -> "ColorDepth":
        """
        Return the default color depth for the default output.
        """
        from .defaults import create_output

        return create_output().get_default_color_depth()


text:
namespace BPMNET.Core.Variable
{
    public class ByteVariable : AbstractVariable<byte>
    {
        public override EStoreType StoreType
        {
            get { return "byte"; }
        }

        public override bool CheckForStore(object value)
        {
            if (value == null) return false;
            if (typeof(byte).IsAssignableFrom(value.GetType()))
            {
                _value = (byte)value;
            }
            else return false;
            return true;
        }
    }
}