text:
<SageTVPlugin>
	<Name>Custom Main Menu</Name>
	<Identifier>custommainmenu</Identifier>
	<Description>Allows you to enable/disable any of the Main Menu items in the default STV7.</Description>
	<Author>Wade</Author>
	<CreationDate>2010.06.06</CreationDate>
	<ModificationDate>2011.03.12</ModificationDate>
	<Version>1.2</Version>
	<Dependency>
		<STV>SageTV7</STV>
		<MinVersion>7.1</MinVersion>
	</Dependency>
	<PluginType>STVI</PluginType>
	<STVImport>STV7-CustomMainMenu-1.2.stvi</STVImport>
	<Package>
		<PackageType>STVI</PackageType>
		<Location>https://github.com/OpenSageTV/sagetv-plugin-repo/releases/download/1/STV7-CustomMainMenu-1.2.zip</Location>
		<MD5>790ED1428F0AEB78594975E2DFDBAE9A</MD5>
	</Package>
	<Screenshot>http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sagetv-custom-mainmenu/CustomMainMenu-1.jpg</Screenshot>
	<Screenshot>http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sagetv-custom-mainmenu/CustomMainMenu-2.jpg</Screenshot>
	<Screenshot>http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sagetv-custom-mainmenu/CustomMainMenu-3.jpg</Screenshot>
	<Screenshot>http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sagetv-custom-mainmenu/CustomMainMenu-4.jpg</Screenshot>
	<Screenshot>http://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sagetv-custom-mainmenu/CustomMainMenu-5.jpg</Screenshot>
	<ReleaseNotes>
	Version 1.2 - Updated to handle changes to the Main Menu in v7.1.
	Version 1.1.01 - Added MaxVersion.
	Version 1.1 - Ack!  The STVImported Hook runs each time, not just on the initial install.  Fixes settings.
	Version 1.0 - Initial release.
	</ReleaseNotes>
</SageTVPlugin>

redpajama_set_name: RedPajamaGithub


text:
package org.sociesc.util.connection;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class DbConnection {

	private Connection conn;
	private String url = "jdbc:mysql://localhost:3306";
	private String database = "tsi";
	private String login = "root";
	private String password = "";

	public DbConnection() {
		this.getConnection();
	}

	public Connection getConnection() {
		if (conn == null) {
			try {
				// Registering the mysql Driver
	            Class.forName("com.mysql.jdbc.Driver").newInstance();

	            try {
	            	// Criando a conexão
	            	conn = DriverManager.getConnection(getFullUrl(), getLogin(), getPassword());

	            } catch (Exception e) {
	                System.out.println("\nErro na criação de conexão!");
	                System.out.println(e.getMessage());
	            }
	        } catch (Exception e) {
	            System.out.println("\nDriver não pode ser carregado!");
                System.out.println(e.getMessage());
	        }
		}

		return conn;
	}

    public void executeUpdate(String sql) {

    	try {
            Statement stm = conn.createStatement();
            try {
                stm.executeUpdate(sql);
            } catch (Exception e) {
                System.out.println("\nErro no resultset!\n" + e);
            }
        } catch (Exception e) {
            System.out.println("\nErro no statement!");
        }

    }

    public ResultSet executeQuery(String sql) {
    	ResultSet rs = null;

        try {
            Statement stm = conn.createStatement();
            try {
                rs = stm.executeQuery(sql);
            } catch (Exception e) {
                System.out.println(e);
            }
        } catch (Exception e) {
            System.out.println("\nErro no statement!");
        }

        return rs;
    }

    private String getFullUrl() {
    	return this.url + "/" + this.database;
    }

    private String getLogin() {
    	return this.login;
    }

    private String getPassword() {
    	return this.password;
    }
}


text:
using System;

namespace Svetomech.Utilities.Extensions
{
    public static class StringExtensions
    {
        public static bool EqualsOrdinal(this string self, string value) =>
            self.Equals(value, StringComparison.Ordinal);
    }
}


text:
"""Low-level wrapper around zbar's interface
"""
from ctypes import (
    c_ubyte, c_char_p, c_int, c_uint, c_ulong, c_void_p, Structure,
    CFUNCTYPE, POINTER
)
from enum import IntEnum, unique

from . import zbar_library

__all__ = [
    'EXTERNAL_DEPENDENCIES', 'LIBZBAR', 'ZBarConfig', 'ZBarSymbol', 'ZBarOrientation',
    'zbar_image_create', 'zbar_image_destroy', 'zbar_image_first_symbol',
    'zbar_image_scanner_create', 'zbar_image_scanner_destroy',
    'zbar_image_scanner_set_config', 'zbar_image_set_data',
    'zbar_image_set_format', 'zbar_image_set_size', 'zbar_scan_image',
    'zbar_symbol_get_data_length', 'zbar_symbol_get_data',
    'zbar_symbol_get_loc_size', 'zbar_symbol_get_loc_x',
    'zbar_symbol_get_loc_y', 'zbar_symbol_next',
    'zbar_symbol_get_orientation', 'zbar_symbol_get_quality',
]

# Globals populated in load_libzbar
LIBZBAR = None
"""ctypes.CDLL
"""

EXTERNAL_DEPENDENCIES = []
"""List of instances of ctypes.CDLL. Helpful when freezing.
"""

# Types
c_ubyte_p = POINTER(c_ubyte)
c_uint_p = POINTER(c_uint)
c_ulong_p = POINTER(c_ulong)
"""unsigned char* type
"""

# Defines and enums
@unique
class ZBarSymbol(IntEnum):
    NONE = 0          # /**< no symbol decoded */
    PARTIAL = 1       # /**< intermediate status */
    EAN2 = 2          # /**< GS1 2-digit add-on */
    EAN5 = 5          # /**< GS1 5-digit add-on */
    EAN8 = 8          # /**< EAN-8 */
    UPCE = 9          # /**< UPC-E */
    ISBN10 = 10       # /**< ISBN-10 (from EAN-13). @since 0.4 */
    UPCA = 12         # /**< UPC-A */
    EAN13 = 13        # /**< EAN-13 */
    ISBN13 = 14       # /**< ISBN-13 (from EAN-13). @since 0.4 */
    COMPOSITE = 15    # /**< EAN/UPC composite */
    I25 = 25          # /**< Interleaved 2 of 5. @since 0.4 */
    DATABAR = 34      # /**< GS1 DataBar (RSS). @since 0.11 */
    DATABAR_EXP = 35  # /**< GS1 DataBar Expanded. @since 0.11 */
    CODABAR = 38      # /**< Codabar. @since 0.11 */
    CODE39 = 39       # /**< Code 39. @since 0.4 */
    PDF417 = 57       # /**< PDF417. @since 0.6 */
    QRCODE = 64       # /**< QR Code. @since 0.10 */
    SQCODE = 80       # /**< SQ Code. @since 0.20.1 */
    CODE93 = 93       # /**< Code 93. @since 0.11 */
    CODE128 = 128     # /**< Code 128 */

@unique
class ZBarConfig(IntEnum):
    CFG_ENABLE = 0          # /**< enable symbology/feature */
    CFG_ADD_CHECK = 1       # /**< enable check digit when optional */
    CFG_EMIT_CHECK = 2      # /**< return check digit when present */
    CFG_ASCII = 3           # /**< enable full ASCII character set */
    CFG_NUM = 4             # /**< number of boolean decoder configs */

    CFG_MIN_LEN = 0x20      # /**< minimum data length for valid decode */
    CFG_MAX_LEN = 0x21      # /**< maximum data length for valid decode */

    CFG_UNCERTAINTY = 0x40  # /**< required video consistency frames */

    CFG_POSITION = 0x80     # /**< enable scanner to collect position data */

    CFG_X_DENSITY = 0x100   # /**< image scanner vertical scan density */
    CFG_Y_DENSITY = 0x101   # /**< image scanner horizontal scan density */

@unique
class ZBarOrientation(IntEnum):
    UNKNOWN = -1   # /**< unable to determine orientation */
    UP = 0         # /**< upright, read left to right */
    RIGHT = 1      # /**< sideways, read top to bottom */
    DOWN = 2       # /**< upside-down, read right to left */
    LEFT = 3       # /**< sideways, read bottom to top */

# Structs
class zbar_image_scanner(Structure):
    """Opaque C++ class with private implementation
    """
    pass

class zbar_image(Structure):
    """Opaque C++ class with private implementation
    """
    pass

class zbar_symbol(Structure):
    """Opaque C++ class with private implementation

    The first item in the structure is an integeger value in the ZBarSymbol
    enumeration.
    """
    _fields_ = [
        ('type', c_int),
    ]

def load_libzbar():
    """Loads the zbar shared library and its dependencies.

    Populates the globals LIBZBAR and EXTERNAL_DEPENDENCIES.
    """
    global LIBZBAR
    global EXTERNAL_DEPENDENCIES
    if not LIBZBAR:
        libzbar, dependencies = zbar_library.load()
        LIBZBAR = libzbar
        EXTERNAL_DEPENDENCIES = [LIBZBAR] + dependencies

    return LIBZBAR

# Function signatures
def zbar_function(fname, restype, *args):
    """Returns a foreign function exported by `zbar`.

    Args:
        fname (:obj:`str`): Name of the exported function as string.
        restype (:obj:): Return type - one of the `ctypes` primitive C data
        types.
        *args: Arguments - a sequence of `ctypes` primitive C data types.

    Returns:
        cddl.CFunctionType: A wrapper around the function.
    """
    prototype = CFUNCTYPE(restype, *args)
    return prototype((fname, load_libzbar()))

zbar_version = zbar_function(
    'zbar_version',
    c_int,
    c_uint_p,    # major,
    c_uint_p,    # minor
)

zbar_set_verbosity = zbar_function(
    'zbar_set_verbosity',
    None,
    c_int
)

zbar_image_scanner_create = zbar_function(
    'zbar_image_scanner_create',
    POINTER(zbar_image_scanner)
)

zbar_image_scanner_destroy = zbar_function(
    'zbar_image_scanner_destroy',
    None,
    POINTER(zbar_image_scanner)
)

zbar_parse_config = zbar_function(
    'zbar_parse_config',
    c_int,
    c_char_p,          # config_string,
    POINTER(c_int),    # symbology - values in ZBarSymbol
    POINTER(c_int),    # config - values in ZBarConfig
    POINTER(c_int),    # value
)

zbar_image_scanner_set_config = zbar_function(
    'zbar_image_scanner_set_config',
    c_int,
    POINTER(zbar_image_scanner),  # scanner
    c_int,                        # symbology - values in ZBarSymbol
    c_int,                        # config - values in ZBarConfig
    c_int                         # value
)

zbar_image_create = zbar_function(
    'zbar_image_create',
    POINTER(zbar_image)
)

zbar_image_destroy = zbar_function(
    'zbar_image_destroy',
    None,
    POINTER(zbar_image)
)

zbar_image_set_format = zbar_function(
    'zbar_image_set_format',
    None,
    POINTER(zbar_image),
    c_uint
)

zbar_image_set_size = zbar_function(
    'zbar_image_set_size',
    None,
    POINTER(zbar_image),
    c_uint,     # width
    c_uint      # height
)

zbar_image_set_data = zbar_function(
    'zbar_image_set_data',
    None,
    POINTER(zbar_image),
    c_void_p,   # data
    c_ulong,    # raw_image_data_length
    c_void_p    # A function pointer(!)
)

zbar_scan_image = zbar_function(
    'zbar_scan_image',
    c_int,
    POINTER(zbar_image_scanner),
    POINTER(zbar_image)
)

zbar_image_first_symbol = zbar_function(
    'zbar_image_first_symbol',
    POINTER(zbar_symbol),
    POINTER(zbar_image)
)

zbar_symbol_get_data_length = zbar_function(
    'zbar_symbol_get_data_length',
    c_uint,
    POINTER(zbar_symbol)
)

zbar_symbol_get_data = zbar_function(
    'zbar_symbol_get_data',
    c_ubyte_p,
    POINTER(zbar_symbol)
)

zbar_symbol_get_loc_size = zbar_function(
    'zbar_symbol_get_loc_size',
    c_uint,
    POINTER(zbar_symbol)
)

zbar_symbol_get_loc_x = zbar_function(
    'zbar_symbol_get_loc_x',
    c_int,
    POINTER(zbar_symbol),
    c_uint
)

zbar_symbol_get_loc_y = zbar_function(
    'zbar_symbol_get_loc_y',
    c_int,
    POINTER(zbar_symbol),
    c_uint
)

try:
    zbar_symbol_get_orientation = zbar_function(
        'zbar_symbol_get_orientation',
        c_uint,
        POINTER(zbar_symbol)
    )
except AttributeError:
    # This function not present in the original pre-20
    zbar_symbol_get_orientation = None

zbar_symbol_next = zbar_function(
    'zbar_symbol_next',
    POINTER(zbar_symbol),
    POINTER(zbar_symbol)
)

zbar_symbol_get_quality = zbar_function(
    'zbar_symbol_get_quality',
    c_int,
    POINTER(zbar_symbol)
)


text:
<!-- select:start -->
<!-- select-menu-labels: Version -->

### --AcMailer v8.x--

[filename](embedded/v8/configuring-services.md ':include')

### --AcMailer v7.x--

[remoteMarkdownUrl](https://raw.githubusercontent.com/acmailer/acmailer/7.x/docs/configuring-services.md)

<!-- select:end -->


text:
A selection of Multilayer Perceptron implementations in Python

mlperceptron.py is designed to understand the algorithm.

mlperceptron_nmpy.py is a more effecient design, but a little more difficult to understand.  It has more functionality such as the ability to dynamically grow individual layers and to normalize inputs to support a range of input values.  It can also automatically scale the output values to a defined range of integers or floats.

# References
- http://www.toptal.com/machine-learning/an-introduction-to-deep-learning-from-perceptrons-to-deep-networks
- http://home.agh.edu.pl/~vlsi/AI/backp_t_en/backprop.html
- http://natureofcode.com/book/chapter-10-neural-networks/
- http://neuralnetworksanddeeplearning.com/chap1.html


text:
@class CGCounter;

@interface CGEditCounterViewController : UITableViewController

- (IBAction)counterDataChanged:(id)sender;

@property (strong, nonatomic) IBOutlet UITextField *descField;

@property (strong, nonatomic) IBOutlet UITextField *dateField;

@property (strong, nonatomic) IBOutlet UITextField *timeField;

@property (strong, nonatomic) IBOutlet UISwitch *interestedSwitch;

@property (nonatomic, strong) CGCounter *counter;

@end


text:
import graphene

from ...core.permissions import PluginsPermissions
from ...core.tracing import traced_resolver
from ..core.connection import create_connection_slice
from ..core.fields import ConnectionField, PermissionsField
from .dataloaders import load_plugin_manager
from .filters import PluginFilterInput
from .mutations import PluginUpdate
from .resolvers import resolve_plugin, resolve_plugins
from .sorters import PluginSortingInput
from .types import Plugin, PluginCountableConnection

class PluginsQueries(graphene.ObjectType):
    plugin = PermissionsField(
        Plugin,
        id=graphene.Argument(
            graphene.ID, description="ID of the plugin.", required=True
        ),
        description="Look up a plugin by ID.",
        permissions=[
            PluginsPermissions.MANAGE_PLUGINS,
        ],
    )

    plugins = ConnectionField(
        PluginCountableConnection,
        filter=PluginFilterInput(description="Filtering options for plugins."),
        sort_by=PluginSortingInput(description="Sort plugins."),
        description="List of plugins.",
        permissions=[
            PluginsPermissions.MANAGE_PLUGINS,
        ],
    )

    @staticmethod
    @traced_resolver
    def resolve_plugin(_root, info, **data):
        manager = load_plugin_manager(info.context)
        return resolve_plugin(data.get("id"), manager)

    @staticmethod
    @traced_resolver
    def resolve_plugins(_root, info, **kwargs):
        manager = load_plugin_manager(info.context)
        qs = resolve_plugins(manager, **kwargs)
        return create_connection_slice(qs, info, kwargs, PluginCountableConnection)

class PluginsMutations(graphene.ObjectType):
    plugin_update = PluginUpdate.Field()


text:
package org.apache.wicket.markup.html.border;

import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.markup.WicketTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup;
import org.apache.wicket.markup.html.internal.HtmlHeaderContainer;
import org.apache.wicket.markup.parser.XmlTag;
import org.apache.wicket.markup.parser.filter.WicketTagIdentifier;
import org.apache.wicket.markup.resolver.BorderBodyResolver;
import org.apache.wicket.markup.resolver.IComponentResolver;
import org.apache.wicket.model.IModel;

/**
 * A border component has associated markup which is drawn and determines placement of any markup
 * and/or components nested within the border component.
 *

 * The portion of the border's associated markup file which is to be used in rendering the border is
 * denoted by a <wicket:border> tag. The children of the border component instance are then
 * inserted into this markup, replacing the first <wicket:body> tag in the border's associated
 * markup.
 *

 * For example, if a border's associated markup looked like this:
 *
 *

 *   <html>
 *   <body>
 *     <wicket:border>
 *       First <wicket:body/> Last
 *     </wicket:border>
 *   </body>
 *   </html>
 *

 *
 * And the border was used on a page like this:
 *
 *

 *   <html>
 *   <body>
 *     <span wicket:id = "myBorder">
 *       Middle
 *     </span>
 *   </body>
 *   </html>
 *

 *
 * Then the resulting HTML would look like this:
 *
 *

 *   <html>
 *   <body>
 *     First Middle Last
 *   </body>
 *   </html>
 *

 *
 * In other words, the body of the myBorder component is substituted into the border's associated
 * markup at the position indicated by the <wicket:body> tag.
 *

 * Regarding <wicket:body/> you have two options. Either use <wicket:body/> (open-close
 * tag) which will automatically be expanded to <wicket:body>body content</wicket:body>
 * or use <wicket:body>preview region</wicket:body> in your border's markup. The preview
 * region (everything in between the open and close tag) will automatically be removed.
 *

 * Note that if body is not an immediate child of border (example see below), than you must use code
 * like the following someContainer.add(getBodyContainer()) to add the body component
 * to the correct container.
 *
 *

 *   <html>
 *   <body>
 *     <wicket:border>
 *       <span wicket:id="someContainer">
 *         <wicket:body/>
 *       </span>
 *     </wicket:border>
 *   </body>
 *   </html>
 *

 *
 * @see BorderBodyResolver
 * @see BorderBodyContainer
 *
 * @author Jonathan Locke
 * @author Juergen Donnerstag
 *
 */
public abstract class Border extends WebMarkupContainerWithAssociatedMarkup
	implements
		IComponentResolver
{
	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	static final String BODY = "body";
	static final String BORDER = "border";

	static
	{
		// register "wicket:body" and "wicket:border"
		WicketTagIdentifier.registerWellKnownTagName(BORDER);
		WicketTagIdentifier.registerWellKnownTagName(BODY);
	}

	/** Should be true for bordered pages */
	private boolean transparentResolver = false;

	/** Must be the same as the id automatically assigned to <wicket:body> */
	private static final String BODY_ID = "_body";

	/** The body component associated with <wicket:body> */
	private BorderBodyContainer body;

	/**
	 * only required during render phase. The markup stream associated with <span
	 * wicket:id="myBorder"
	 */
	private transient MarkupStream originalMarkupStream;

	/** only required during render phase. The  tag */
	private transient ComponentTag openTag;
	private int beginOfBodyIndex;

	/**
	 * @see org.apache.wicket.Component#Component(String)
	 */
	public Border(final String id)
	{
		super(id);

		body = new BorderBodyContainer(BODY_ID);
		add(body);
	}

	/**
	 * @see org.apache.wicket.Component#Component(String, IModel)
	 */
	public Border(final String id, final IModel<?> model)
	{
		super(id, model);

		body = new BorderBodyContainer(BODY_ID);
		add(body);
	}

	/**
	 * Gets the container associated with <wicket:body>
	 *
	 * @return The border body container
	 */
	public final BorderBodyContainer getBodyContainer()
	{
		if (body == null)
		{
			body = (BorderBodyContainer)get(BODY_ID);
		}
		return body;
	}

	/**
	 * When this method is called with a false value the components and raw markup that this border
	 * wraps will not be rendered.
	 *
	 * @param bodyVisible
	 * @return this for chaining
	 * @deprecated 1.3 please use #getBodyContainer().setVisible(false) instead
	 */
	@Deprecated
	public Border setBorderBodyVisible(boolean bodyVisible)
	{
		body.setVisible(false);
		return this;
	}

	/**
	 * Borders used for bordered pages should set it to "true". Default is "false". If enabled, than
	 * requests to find a component are passed to the parent container as well. Thus the child may
	 * not be added to the Border, but might be added to the parent of the Border as well.
	 *
	 * @param enable
	 *            true, to enable transparent resolving
	 * @return this for chaining
	 */
	public final Border setTransparentResolver(final boolean enable)
	{
		transparentResolver = enable;
		return this;
	}

	/**
	 * @see #setTransparentResolver(boolean)
	 * @see org.apache.wicket.MarkupContainer#isTransparentResolver()
	 */
	@Override
	public boolean isTransparentResolver()
	{
		return transparentResolver;
	}

	/**
	 * @see org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer,
	 *      org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)
	 */
	public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
		final ComponentTag tag)
	{
		// In case of nested Borders, the outer border is no longer able to find
		// its body container easily. Thus we need to help resolve it.

		// The container is the body component. Get the Border component.
		MarkupContainer border = container.getParent();
		while ((border != null) && !(border instanceof Border))
		{
			border = border.getParent();
		}

		// Avoid recursions. It is the outer border which needs help to resolve
		// it. Not the inner border (this == border).
		if ((border == null) || (this == border))
		{
			return false;
		}

		// Ignore everything else except Border
		if (!(border instanceof Border))
		{
			return false;
		}

		// Determine if tag is a <wicket:body> tag
		if (!(tag instanceof WicketTag))
		{
			return false;
		}

		// And it must be <wicket:body>
		final WicketTag wtag = (WicketTag)tag;
		if (!wtag.isBodyTag())
		{
			return false;
		}

		body.render(markupStream);
		return true;
	}

	/**
	 * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
	 */
	@Override
	protected void onComponentTag(final ComponentTag tag)
	{
		if (tag.isOpen() == false)
		{
			throw new WicketRuntimeException(
				"The border tag must be an open tag. Open-close is not allowed: " + tag.toString());
		}

		super.onComponentTag(tag);
	}

	/**
	 * @see org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
	 *      org.apache.wicket.markup.ComponentTag)
	 */
	@Override
	protected final void onComponentTagBody(final MarkupStream markupStream,
		final ComponentTag openTag)
	{
		// Remember the data for easy access by the Body component
		this.openTag = openTag;
		originalMarkupStream = getMarkupStream();

		// Remember the current position (start of border-body) of the markupstream
		beginOfBodyIndex = originalMarkupStream.getCurrentIndex();

		// body.isVisible(false) needs a little extra work. We must skip the
		// markup between  and
		if (isBodyVisible() == false)
		{
			originalMarkupStream.skipToMatchingCloseTag(openTag);
		}
		// Render the associated markup
		renderAssociatedMarkup("border",
			"Markup for a border component must begin a tag like '<wicket:border>'");
	}

	/**
	 * @see org.apache.wicket.Component#renderHead(org.apache.wicket.markup.html.internal.HtmlHeaderContainer)
	 */
	@Override
	public void renderHead(HtmlHeaderContainer container)
	{
		renderHeadFromAssociatedMarkupFile(container);
		super.renderHead(container);
	}

	/**
	 * The container to be associated with the <wicket:body> tag
	 */
	public class BorderBodyContainer extends WebMarkupContainer implements IComponentResolver
	{
		private static final long serialVersionUID = 1L;

		/** remember the original status of the wicket:body tag */
		private transient boolean wasOpenCloseTag = false;

		/**
		 * Constructor
		 *
		 * @param id
		 */
		public BorderBodyContainer(final String id)
		{
			super(id);
		}

		/**
		 * @see org.apache.wicket.Component#onComponentTag(org.apache.wicket.markup.ComponentTag)
		 */
		@Override
		protected void onComponentTag(final ComponentTag tag)
		{
			// Convert open-close to open-body-close
			if (tag.getType() == XmlTag.OPEN_CLOSE)
			{
				tag.setType(XmlTag.OPEN);
				tag.setModified(true);
				wasOpenCloseTag = true;
			}

			super.onComponentTag(tag);
		}

		/**
		 * @see org.apache.wicket.MarkupContainer#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
		 *      org.apache.wicket.markup.ComponentTag)
		 */
		@Override
		protected void onComponentTagBody(final MarkupStream markupStream,
			final ComponentTag openTag)
		{
			if (wasOpenCloseTag == false)
			{
				// It is open-preview-close. Only RawMarkup is allowed within
				// the preview region, which gets stripped from output
				markupStream.skipRawMarkup();
			}

			// this check always results in false for normal requests.
			// in case of ajax requests, the markupstream is not reset after the first render, thus
			// the current index of the markup stream points to the element after the body.
			// as a result, no elements are detected and always omitted.
			if (beginOfBodyIndex != originalMarkupStream.getCurrentIndex())
			{
				originalMarkupStream.setCurrentIndex(beginOfBodyIndex);
			}

			super.onComponentTagBody(originalMarkupStream, Border.this.openTag);
		}

		/**
		 * @see org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer,
		 *      org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)
		 */
		public boolean resolve(final MarkupContainer container, final MarkupStream markupStream,
			final ComponentTag tag)
		{
			// Usually you add child components to Border instead of Body. Hence
			// we need to help Body to properly resolve the children.
			String id = tag.getId();
			if (!id.equals(BODY_ID))
			{
				Component component = Border.this.get(id);
				if (component != null)
				{
					component.render(markupStream);
					return true;
				}
			}

			return false;
		}
	}

	/**
	 * Determines whether or not the border body is visible.
	 *
	 * @return true if body of the border is visible, false otherwise
	 */
	private boolean isBodyVisible()
	{
		// in order to determine this we have to visit all components between the border and the
		// body because border body can be embedded inside other containers.

		boolean bodyVisible = true;
		Component cursor = body;
		while (cursor != this && bodyVisible)
		{
			bodyVisible = cursor.determineVisibility();
			cursor = cursor.getParent();
		}
		return bodyVisible;
	}
}


text:
package com.google.jenkins.plugins.dsl;

import java.io.InputStream;
import java.io.InputStreamReader;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.mockito.MockitoAnnotations;

import com.google.common.io.CharStreams;

import hudson.model.FreeStyleProject;
import hudson.model.ParametersDefinitionProperty;
import hudson.model.StringParameterDefinition;

/**
 * Tests for {@link YamlDecorator}.
 */
public class YamlDecoratorTest {
  @Rule
  public JenkinsRule jenkins = new JenkinsRule();

  @Rule
  public Retry retry = new Retry(3);

  private FreeStyleProject project;

  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);

    project = jenkins.createFreeStyleProject("test");

    project.getBuildersList().add(new hudson.tasks.Shell("echo $foo"));
    // Make sure we don't clobber pre-existing properties when we workaround the
    // missing null check.
    project.addProperty(new ParametersDefinitionProperty(
        new StringParameterDefinition("foo", "bar")));
  }

  @Test
  public void testProjectCreation() throws Exception {
    // Submit the form and check that the values match our original construction
    jenkins.configRoundtrip(project);

    // Verify that a YamlAction was attached by our decorator through a method
    // that doesn't attach one if absent.
    YamlAction action = project.getAction(YamlAction.class);
    assertNotNull(action);

    assertSame(YamlAction.of(project), action);

    final InputStream inputStream =
        getClass().getClassLoader().getResourceAsStream(
            "com/google/jenkins/plugins/dsl/param.yaml");
    final String text = CharStreams.toString(
        new InputStreamReader(inputStream));

    assertEquals(text, action.getYaml());
  }
}


text:
package edu.berkeley.cs.succinct;

public class DeserializationException extends Exception {

  public DeserializationException(String message) {
    super(message);
  }

  public DeserializationException(Throwable cause) {
    super(cause);
  }
}


text:
<?php

class reservations_modele extends CI_Model {

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

    public function get_reservation($numclient = 0)
{
        if ($numclient === 0)
        {
                $query = $this->db->get('reservation');
                return $query->result_array();
        }

        $query = $this->db->get_where('reservation', array('idClient' => $numclient));
        return $query->result_array();
}

public function get_all_reservation()
{

                $query = $this->db->get('reservation');
                return $query->result_array();
}

}


text:
/*! normalize.css 2012-02-07T12:37 UTC - https://github.com/necolas/normalize.css */
/* ============================================================================= HTML5 display definitions ========================================================================== */
/* Corrects block display not defined in IE6/7/8/9 & FF3 */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section, summary { display: block; }

/* Corrects inline-block display not defined in IE6/7/8/9 & FF3 */
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }

/* Prevents modern browsers from displaying 'audio' without controls */
audio:not([controls]) { display: none; }

/* Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 Known issue: no IE6 support */
[hidden] { display: none; }

/* ============================================================================= Base ========================================================================== */
/* 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units http://clagnut.com/blog/348/#c790 2. Prevents iOS text size adjust after orientation change, without disabling user zoom www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ */
html { font-size: 100%; /* 1 */ -webkit-text-size-adjust: 100%; /* 2 */ -ms-text-size-adjust: 100%; /* 2 */ }

/* Addresses font-family inconsistency between 'textarea' and other form elements. */
html, button, input, select, textarea { font-family: sans-serif; }

/* Addresses margins handled incorrectly in IE6/7 */
body { margin: 0; }

/* ============================================================================= Links ========================================================================== */
/* Addresses outline displayed oddly in Chrome */
a:focus { outline: thin dotted; }

/* Improves readability when focused and also mouse hovered in all browsers people.opera.com/patrickl/experiments/keyboard/test */
a:hover, a:active { outline: 0; }

/* ============================================================================= Typography ========================================================================== */
/* Addresses font sizes and margins set differently in IE6/7 Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 */
h1 { font-size: 2em; margin: 0.67em 0; }

h2 { font-size: 1.5em; margin: 0.83em 0; }

h3 { font-size: 1.17em; margin: 1em 0; }

h4 { font-size: 1em; margin: 1.33em 0; }

h5 { font-size: 0.83em; margin: 1.67em 0; }

h6 { font-size: 0.75em; margin: 2.33em 0; }

/* Addresses styling not present in IE7/8/9, S5, Chrome */
abbr[title] { border-bottom: 1px dotted; }

/* Addresses style set to 'bolder' in FF3+, S4/5, Chrome
*/
b, strong { font-weight: bold; }

blockquote { margin: 1em 40px; }

/* Addresses styling not present in S5, Chrome */
dfn { font-style: italic; }

/* Addresses styling not present in IE6/7/8/9 */
mark { background: #ff0; color: #000; }

/* Addresses margins set differently in IE6/7 */
p, pre { margin: 1em 0; }

/* Corrects font family set oddly in IE6, S4/5, Chrome en.wikipedia.org/wiki/User:Davidgothberg/Test59 */
pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; }

/* 1. Addresses CSS quotes not supported in IE6/7 2. Addresses quote property not supported in S4 */
/* 1 */
q { quotes: none; }

/* 2 */
q:before, q:after { content: ''; content: none; }

small { font-size: 75%; }

/* Prevents sub and sup affecting line-height in all browsers gist.github.com/413930 */
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }

sup { top: -0.5em; }

sub { bottom: -0.25em; }

/* ============================================================================= Lists ========================================================================== */
/* Addresses margins set differently in IE6/7 */
dl, menu, ol, ul { margin: 1em 0; }

dd { margin: 0 0 0 40px; }

/* Addresses paddings set differently in IE6/7 */
menu, ol, ul { padding: 0 0 0 40px; }

/* Corrects list images handled incorrectly in IE7 */
nav ul, nav ol { list-style: none; list-style-image: none; }

/* ============================================================================= Embedded content ========================================================================== */
/* 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 2. Improves image quality when scaled in IE7 code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
img { border: 0; /* 1 */ -ms-interpolation-mode: bicubic; /* 2 */ }

/* Corrects overflow displayed oddly in IE9 */
svg:not(:root) { overflow: hidden; }

/* ============================================================================= Figures ========================================================================== */
/* Addresses margin not present in IE6/7/8/9, S5, O11 */
figure { margin: 0; }

/* ============================================================================= Forms ========================================================================== */
/* Corrects margin displayed oddly in IE6/7 */
form { margin: 0; }

/* Define consistent border, margin, and padding */
fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; }

/* 1. Corrects color not being inherited in IE6/7/8/9 2. Corrects text not wrapping in FF3  3. Corrects alignment displayed oddly in IE6/7 */
legend { border: 0; /* 1 */ padding: 0; white-space: normal; /* 2 */ *margin-left: -7px; /* 3 */ }

/* 1. Corrects font size not being inherited in all browsers 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome 3. Improves appearance and consistency in all browsers */
button, input, select, textarea { font-size: 100%; /* 1 */ margin: 0; /* 2 */ vertical-align: baseline; /* 3 */ *vertical-align: middle; /* 3 */ }

/* Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet */
button, input { line-height: normal; /* 1 */ }

/* 1. Improves usability and consistency of cursor style between image-type 'input' and others 2. Corrects inability to style clickable 'input' types in iOS 3. Removes inner spacing in IE7 without affecting normal text inputs Known issue: inner spacing remains in IE6 */
button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; /* 1 */ -webkit-appearance: button; /* 2 */ *overflow: visible; /* 3 */ }

/* Re-set default cursor for disabled elements */
button[disabled], input[disabled] { cursor: default; }

/* 1. Addresses box sizing set to content-box in IE8/9 2. Removes excess padding in IE8/9 3. Removes excess padding in IE7 Known issue: excess padding remains in IE6 */
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ *height: 13px; /* 3 */ *width: 13px; /* 3 */ }

/* 1. Addresses appearance set to searchfield in S5, Chrome 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) */
input[type="search"] { -webkit-appearance: textfield; /* 1 */ -moz-box-sizing: content-box; -webkit-box-sizing: content-box; /* 2 */ box-sizing: content-box; }

/* Removes inner padding and search cancel button in S5, Chrome on OS X */
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Removes inner padding and border in FF3+ www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ */
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }

/* 1. Removes default vertical scrollbar in IE6/7/8/9 2. Improves readability and alignment in all browsers */
textarea { overflow: auto; /* 1 */ vertical-align: top; /* 2 */ }

/* ============================================================================= Tables ========================================================================== */
/* Remove most spacing between table cells */
table { border-collapse: collapse; border-spacing: 0; }

@font-face { font-family: 'OpenSansLight'; src: url("../fonts/OpenSans-Light-webfont.eot"); src: url("../fonts/OpenSans-Light-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Light-webfont.woff") format("woff"), url("../fonts/OpenSans-Light-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Light-webfont.svg#OpenSansLight") format("svg"); font-weight: normal; font-style: normal; }
@font-face { font-family: 'OpenSansLightItalic'; src: url("../fonts/OpenSans-LightItalic-webfont.eot"); src: url("../fonts/OpenSans-LightItalic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-LightItalic-webfont.woff") format("woff"), url("../fonts/OpenSans-LightItalic-webfont.ttf") format("truetype"), url("../fonts/OpenSans-LightItalic-webfont.svg#OpenSansLightItalic") format("svg"); font-weight: normal; font-style: normal; }
@font-face { font-family: 'OpenSansRegular'; src: url("../fonts/OpenSans-Regular-webfont.eot"); src: url("../fonts/OpenSans-Regular-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Regular-webfont.woff") format("woff"), url("../fonts/OpenSans-Regular-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Regular-webfont.svg#OpenSansRegular") format("svg"); font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; }
@font-face { font-family: 'OpenSansItalic'; src: url("../fonts/OpenSans-Italic-webfont.eot"); src: url("../fonts/OpenSans-Italic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Italic-webfont.woff") format("woff"), url("../fonts/OpenSans-Italic-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Italic-webfont.svg#OpenSansItalic") format("svg"); font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; }
@font-face { font-family: 'OpenSansSemibold'; src: url("../fonts/OpenSans-Semibold-webfont.eot"); src: url("../fonts/OpenSans-Semibold-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Semibold-webfont.woff") format("woff"), url("../fonts/OpenSans-Semibold-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Semibold-webfont.svg#OpenSansSemibold") format("svg"); font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; }
@font-face { font-family: 'OpenSansSemiboldItalic'; src: url("../fonts/OpenSans-SemiboldItalic-webfont.eot"); src: url("../fonts/OpenSans-SemiboldItalic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-SemiboldItalic-webfont.woff") format("woff"), url("../fonts/OpenSans-SemiboldItalic-webfont.ttf") format("truetype"), url("../fonts/OpenSans-SemiboldItalic-webfont.svg#OpenSansSemiboldItalic") format("svg"); font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; }
@font-face { font-family: 'OpenSansBold'; src: url("../fonts/OpenSans-Bold-webfont.eot"); src: url("../fonts/OpenSans-Bold-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-Bold-webfont.woff") format("woff"), url("../fonts/OpenSans-Bold-webfont.ttf") format("truetype"), url("../fonts/OpenSans-Bold-webfont.svg#OpenSansBold") format("svg"); font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; }
@font-face { font-family: 'OpenSansBoldItalic'; src: url("../fonts/OpenSans-BoldItalic-webfont.eot"); src: url("../fonts/OpenSans-BoldItalic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/OpenSans-BoldItalic-webfont.woff") format("woff"), url("../fonts/OpenSans-BoldItalic-webfont.ttf") format("truetype"), url("../fonts/OpenSans-BoldItalic-webfont.svg#OpenSansBoldItalic") format("svg"); font-weight: normal; font-style: normal; -webkit-font-smoothing: antialiased; }
/* generated by rouge http://rouge.jneen.net/ original base16 by Chris Kempson (https://github.com/chriskempson/base16)
*/
.highlight table td { padding: 5px; }

.highlight table pre { margin: 0; }

.highlight, .highlight .w { color: #d0d0d0; }

.highlight .err { color: #151515; background-color: #ac4142; }

.highlight .c, .highlight .cd, .highlight .cm, .highlight .c1, .highlight .cs { color: #888; }

.highlight .cp { color: #f4bf75; }

.highlight .nt { color: #f4bf75; }

.highlight .o, .highlight .ow { color: #d0d0d0; }

.highlight .p, .highlight .pi { color: #d0d0d0; }

.highlight .gi { color: #90a959; }

.highlight .gd { color: #ac4142; }

.highlight .gh { color: #6a9fb5; font-weight: bold; }

.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv { color: #aa759f; }

.highlight .kc { color: #d28445; }

.highlight .kt { color: #d28445; }

.highlight .kd { color: #d28445; }

.highlight .s, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 { color: #90a959; }

.highlight .sr { color: #75b5aa; }

.highlight .si { color: #8f5536; }

.highlight .se { color: #8f5536; }

.highlight .nn { color: #f4bf75; }

.highlight .nc { color: #f4bf75; }

.highlight .no { color: #f4bf75; }

.highlight .na { color: #6a9fb5; }

.highlight .m, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mb, .highlight .mx { color: #90a959; }

.highlight .ss { color: #90a959; }

body { padding: 0px 0 20px 0px; margin: 0px; font: 14px/1.5 "OpenSansRegular", "Helvetica Neue", Helvetica, Arial, sans-serif; color: #f0e7d5; font-weight: normal; background: #252525; background-attachment: fixed !important; background: linear_gradient(#2a2a29, #1c1c1c); }

h1, h2, h3, h4, h5, h6 { color: #e8e8e8; margin: 0 0 10px; font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; }

p, ul, ol, table, pre, dl { margin: 0 0 20px; }

h1, h2, h3 { line-height: 1.1; }

h1 { font-size: 28px; }

h2 { font-size: 24px; }

h4, h5, h6 { color: #e8e8e8; }

h3 { font-size: 18px; line-height: 24px; font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif !important; font-weight: normal; color: #b6b6b6; }

a { color: #ffcc00; font-weight: 400; text-decoration: none; }
a:hover { color: #ffeb9b; }

a small { font-size: 11px; color: #666; margin-top: -0.6em; display: block; }

ul { list-style-image: url("../images/bullet.png"); }

strong { font-family: 'OpenSansBold', "Helvetica Neue", Helvetica, Arial, sans-serif !important; font-weight: normal; }

.wrapper { max-width: 650px; margin: 0 auto; position: relative; padding: 0 20px; }

section img { max-width: 100%; }

blockquote { border-left: 3px solid #ffcc00; margin: 0; padding: 0 0 0 20px; font-style: italic; }

code { font-family: 'Lucida Sans', Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, monospace; color: #efefef; font-size: 13px; margin: 0 4px; padding: 4px 6px; border-radius: 2px; }

pre { padding: 8px 15px; background: #191919; border-radius: 2px; border: 1px solid #121212; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3); overflow: auto; overflow-y: hidden; }
pre code { color: #efefef; text-shadow: 0px 1px 0px #000; margin: 0; padding: 0; }

table { width: 100%; border-collapse: collapse; }

th { text-align: left; padding: 5px 10px; border-bottom: 1px solid #434343; color: #b6b6b6; font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif !important; font-weight: normal; }

td { text-align: left; padding: 5px 10px; border-bottom: 1px solid #434343; }

hr { border: 0; outline: none; height: 3px; background: transparent url("../images/hr.gif") center center repeat-x; margin: 0 0 20px; }

dt { color: #F0E7D5; font-family: 'OpenSansSemibold', "Helvetica Neue", Helvetica, Arial, sans-serif !important; font-weight: normal; }

#header { z-index: 100; left: 0; top: 0px; height: 60px; width: 100%; position: fixed; background: url(../images/nav-bg.gif) #353535; border-bottom: 4px solid #434343; box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25); }
#header nav { max-width: 650px; margin: 0 auto; padding: 0 10px; background: blue; margin: 6px auto; }
#header nav li { font-family: 'OpenSansLight', "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; list-style: none; display: inline; color: white; line-height: 50px; text-shadow: 0px 1px 0px rgba(0, 0, 0, 0.2); font-size: 14px; }
#header nav li a { color: white; border: 1px solid #5d910b; background: linear_gradient(#93bd20, #659e10); border-radius: 2px; box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.3), 0px 3px 7px rgba(0, 0, 0, 0.7); background-color: #93bd20; padding: 10px 12px; margin-top: 6px; line-height: 14px; font-size: 14px; display: inline-block; text-align: center; }
#header nav li a:hover { background: linear_gradient(#749619, #527f0e); background-color: #659e10; border: 1px solid #527f0e; box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 1px 0px transparent; }
#header nav li.fork { float: left; margin-left: 0px; }
#header nav li.downloads { float: right; margin-left: 6px; }
#header nav li.title { float: right; margin-right: 10px; font-size: 11px; }

section { max-width: 650px; padding: 30px 0px 50px 0px; margin: 20px 0; margin-top: 70px; }
section #title { border: 0; outline: none; margin: 0 0 50px 0; padding: 0 0 5px 0; }
section #title h1 { font-family: 'OpenSansLight', "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; font-size: 40px; text-align: center; line-height: 36px; }
section #title p { color: #d7cfbe; font-family: 'OpenSansLight', "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; font-size: 18px; text-align: center; }
section #title .credits { font-size: 11px; font-family: 'OpenSansRegular', "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; color: #696969; margin-top: -10px; }
section #title .credits.left { float: left; }
section #title .credits.right { float: right; }

@media print, screen and (max-width: 720px) { #title .credits { display: block; width: 100%; line-height: 30px; text-align: center; }
  #title .credits .left { float: none; display: block; }
  #title .credits .right { float: none; display: block; } }
@media print, screen and (max-width: 480px) { #header { margin-top: -20px; }
  section { margin-top: 40px; }
  nav { display: none; } }


text:
package jp.go.aist.six.vuln.core;

import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import jp.go.aist.six.util.IoUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author  Akihito Nakamura, AIST
 * @version $Id: TestUtil.java 594 2013-06-11 09:41:25Z nakamura5akihito@gmail.com $
 */
public class TestUtil
{
  /**
   * Logger.
   */
    private static final Logger  _LOG_ = LoggerFactory.getLogger( TestUtil.class );

    /**
     * Creates a file list from directory path and/or file path.
     */
    public static File[] listXmlFiles(
                    final String dir_path
                    )
    throws Exception
    {
        return listXmlFiles( new File( dir_path ) );
    }

    public static File[] listXmlFiles(
                    final File dir
                    )
    throws Exception
    {
        File[]  list = dir.listFiles( new XmlFilenameFilter() );

        return list;
    }

    public static File[] listZipXmlFiles(
                    final String dir_path
                    )
    throws Exception
    {
        return listZipXmlFiles( new File( dir_path ) );
    }

    public static File[] listZipXmlFiles(
                    final File dir
                    )
    throws Exception
    {
        File[]  list = dir.listFiles( new ZipXmlFilenameFilter() );

        return list;
    }

    /**
     */
    public static class XmlFilenameFilter
    implements FilenameFilter
    {

        public XmlFilenameFilter()
        {
        }

        @Override
        public boolean accept(
                        final File dir,
                        final String name
                        )
        {
            return name.endsWith( ".xml" );
        }

    }
    //XmlFilenameFilter

    /**
     */
    public static class ZipXmlFilenameFilter
    implements FilenameFilter
    {

        public ZipXmlFilenameFilter()
        {
        }

        @Override
        public boolean accept(
                        final File dir,
                        final String name
                        )
        {
            return (name.endsWith( ".xml.jar" )  ||  name.endsWith( ".xml.zip" ));
        }

    }
    //

    ////////////////////////////////////////////////////////////////////////////
    //  prepare source XML files
    ////////////////////////////////////////////////////////////////////////////

    public static Collection<File> prepareSourceXmlFiles(
                    final File dest_dir,
                    final File source_dir
                    )
    throws Exception
    {
        _LOG_.debug( "source dir=" + source_dir + ", dest dir=" + dest_dir );
        Collection<File>  all_xml_files = new ArrayList<File>();

        File[]  xml_file_list = listXmlFiles( source_dir );
        all_xml_files.addAll( Arrays.asList( xml_file_list ) );

        File[]  zip_file_list = TestUtil.listZipXmlFiles( source_dir );
        for (File  zip_file : zip_file_list) {
            Collection<File>  xml_files = unzipXml( dest_dir, zip_file );
            all_xml_files.addAll( xml_files );
        }

        return all_xml_files;
    }

    // e.g. a.xml.zip
    public static Collection<File> unzipXml(
                    final File dest_dir,
                    final File source_zip_file
                    )
                    throws Exception
    {
        _LOG_.debug( "zip file: " + source_zip_file );
        ZipFile  zip_file = new ZipFile( source_zip_file );
        Collection<File>  xml_files = new ArrayList<File>();

        try {
            // (working_dir)/a.xml.zip/
            String  zip_file_name = zip_file.getName();
            File  unzip_dir = new File( dest_dir, zip_file_name );
            unzip_dir.mkdirs();

            Enumeration<? extends ZipEntry>  zip_entries = zip_file.entries();
            while (zip_entries.hasMoreElements()) {
                ZipEntry  zip_entry = zip_entries.nextElement();
                String  zip_entry_name = zip_entry.getName();
                _LOG_.debug( "zip entry: " + zip_entry_name );
                if (zip_entry_name.endsWith( "/" )) {
                    File  unzip_subdir = new File( unzip_dir, zip_entry_name );
                    unzip_subdir.mkdirs();
                    // (working_dir)/a.xml.zip/x/y/z/
                } else if (zip_entry_name.endsWith( ".xml" )) {
                    File  output_file = new File( unzip_dir, zip_entry_name );
                    InputStream  zip_entry_is = zip_file.getInputStream( zip_entry );
                    IoUtil.copy( zip_entry_is, output_file );
                    xml_files.add( output_file );
                    // (working_dir)/a.xml.zip/x/y/z/p.xml
                }
            }
        } finally {
            try {
                zip_file.close();
            } catch (IOException ex) {
                //negligible
            }
        }

        return xml_files;
    }

    ////////////////////////////////////////////////////////////////////////////
    //  tmp working dir
    ////////////////////////////////////////////////////////////////////////////

    private static String  _TMP_DIRPATH_ = null;

    public static File newWokingDir(
                    final String subdir
                    )
    {
        if (_TMP_DIRPATH_ == null) {
            _TMP_DIRPATH_ = System.getProperty( "java.io.tmpdir" );
        }
        File  dir = new File( _TMP_DIRPATH_, subdir );
        dir.mkdirs();

        return dir;
    }

}
//


text:
extern void *malloc(__SIZE_TYPE__);
typedef struct T T;
struct T {
    void (*destroy)(void *);
};
void destroy(union { void *this; } __attribute__((transparent_union)));
static const typeof(destroy) *_destroy  = (const typeof(destroy)*)destroy;
void destroy(void *this);
static T *create_empty(void)
{
  T *this = malloc(sizeof(*this));
  *this = (typeof(*this)){ _destroy };
  return this;
}
void openssl_crl_load(void)
{
  T *this = create_empty();
  destroy(this);
}


text:
<!DOCTYPE html>

  <title>c1-reflection-blog</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link href="../css/stylesheet.css" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Arvo|Dosis|Roboto+Mono" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css">
  <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet">

      Home

Reflection

        It's my first week at EDA and so far I'm finding it pretty awesome! Initially I thought that we were mainly going to be filling our brains up with technical skills without a pile of context, like you do on Free Code Camp or Code Academy. I was a little intimidated. It's really cool to see that the focus of EDA is building great engineers, so your empathy, interpersonal skills and design knowledge all come into it. I want to eventually build a startup (after I get a job and earn some money!) so it's cool to see that this course is gonna give me more knowledge than straight up coding.

        I like the whole 'no grades' element, cos I used to be a person who would do the minimum amount of work for the best grade. I wasn't so interested in pushing myself or helping other people, and I think that will change in an environment like EDA

        I also like the focus on team work. I'm a bit introverted and a bit competitive, so I thought this would be a challenge for me, but so far I've been loving all the check ins and accountability groups. I like looking at the waffle board with everyone's cards in it, so even if I'm having a bad day I can see someone else move a card and be like 'GO TEAM GO!'

        I've done a bit of theatre work and I'm finding EDA quite similar to putting on a production. Doesn't matter if you're a great actor, if the other actors don't know their lines, or the script is flabby then the show is gonna be crap. You've got to be kind to each other and work together to build the best possible show. This was a surprise to me, cos I thought coding would be a lot less creative and team work based.

        So basically I'm really excited for the course and looking forward to building relationships and hacking on some cool shit with you all!


text:
layout: post
title: GitRoom Manager
category: code
tag: packages
lang: python
github_links:
    repo: https://github.com/btskinner/grm
    zip: https://github.com/btskinner/grm/archive/main.zip
    manual: https://www.btskinner.io/grm
---

{% linkmarkdown https://raw.githubusercontent.com/btskinner/grm/main/README.md %}


text:
package org.camunda.bpm.swagger.maven.interpreter;

import com.vladsch.flexmark.ast.Node;

import java.util.Arrays;
import java.util.Collections;
import java.util.Stack;

public class AbstractDocumentInterpreter {
  <T> T resolveNode(Stack<Class> classes, Node node, Class<T> _className) {
    if (node == null)
      return null;
    Class type = classes.pop();
    return (T) resolveNode(classes, node.getNextAny(type));
  }

  Node resolveNode(Stack<Class> classes, Node node) {
    if (node == null)
      return null;
    if (classes.isEmpty())
      return node;
    Class type = classes.pop();
    return resolveNode(classes, node.getFirstChildAny(type));
  }

  Stack<Class> createPath(Class... classes) {
    Stack<Class> result = new Stack<>();
    result.addAll(Arrays.asList(classes));
    Collections.reverse(result);
    return result;
  }
}


text:
Be willing to let the work take you somewhere, and have the courage to follow it all the way there.

## 2. Start messy. Clean it up little by little.

Try stuff out. Eyeball things. Cut before you  measure. Knock all your ideas together.

Now put it down for awhile.

When you come back, start looking for connections and relationships. Start consolidating ideas and working out rules for the relationships you've established. Find ways to simplify. Get it a little cleaner.

Repeat.

## 3. Get the design to a place you really like. Then break it.

Don't get trapped by what you see right now. You've spent 20 hours getting that headline to feel just right over the photo. It's looking really good.

But sometimes a really great idea is hiding right behind the one you have now. To find it, you have to be willing to push aside your current idea.

Take a deep breath, save/commit a version, then break it. Do something unthinkable to it. Make that headline absurdly huge. Now make it really tiny. Make the R pink. Add a different photo.

The new idea is hidden under the current one. Keep moving things around until you can see it underneath. It'll be worth it.

## 4. Fork your teammates.

As they say, an idea is what happens when you look at one thing but see something else. We move forward by building on what we  have. Nobody owns the design, there's no turf to protect. "Originality" is often just an idea that needs more iteration. Instead, think of the design as a big conversation: statements & replies, each leading the other to new places.

Take your teammates' work and build on it: improve it, evolve it, bend it to your own purposes. Fork and iterate.

But always....

## 5. Give credit, don't take it.

We design in the open. Everyone can watch the design evolve, everyone can contribute if they have an idea. The design doesn't belong to anybody. It's a long climb produced by countless small steps.

And it only works with mutual respect, and generosity. Never miss a chance to give props to your teammates. Better yet, do it publicly. Credit is like a [trail name](http://www.appalachiantrail.org/about-the-trail): it must be earned, not claimed, and given by a fellow hiker.

## 6. Before you criticize somebody's work, borrow their glasses.

Really hate what your teammate just showed you? Great! You now have what we call "cold" feedback.

Cold feedback is your immediate reaction to work you've never seen before and know nothing about - what you're seeing "cold." This is often the kind of feedback we get from clients and viewers, and it's really important.

However, cold feedback is limited by its nature. You can only say so much about something you don't know. And **there are good ideas in every failure**. As a design shop, our goal is to harvest good ideas anywhere we can find them: success, failure, wherever.

So how do you get to those ideas hidden in a comp you just don't get? Through _empathic_ feedback.

You have your cold feedback. Remember your first reaction, but file it away for a little while. Now, start asking questions. Try to see where the designer is coming from and where they're trying to go. How did they frame the problem? How do they see the solution? You need to understand their point of view and their goals. Try to see the work the way they see it, through their glasses.

Once you have a better handle on that, go back to your cold reaction. How does your own "outside" perception of the work differ from the designer's "inside" perceptions (or assumptions or hypotheses)? Try to get to the root of that disconnect, and find a path for the designer to meet their own goals.

As a designer, the more you can frame your feedback with empathy, the more opportunities you'll find to free ideas from a specific execution, and to help other designers grow on their _own terms_, not yours.

## 7. Design requires emotional intelligence, not just problem solving.

An engineer solves problems. A designer uses the engineer's solution to make people _feel_ something. That "something" doesn't have to be "pleasant" or "satisfied" or any of those other words you see on a customer survey. Sometimes a great design hits you in the stomach. Sometimes it makes you question things you'd rather not. In these cases, it's successful because the design created a connection – a relationship, a conversation – between poeple.

Your prototype might have all the right fonts, perfect kerning, and a color scheme in the Kuler hall of fame. But if it doesn't make people feel something when they use it, you're not done. Giving your work a bit of soul is the hardest thing to learn to do, the hardest to explain, and also what will make it worth doing in the end. Never forget that what you're making will be used by a human just like you. Otherwise, the robots win.

## 8. Try to avoid imposing [minimalist Bauhaus-esque fascist snoozefests](http://www.mcsweeneys.net/articles/im-comic-sans-asshole) all the time.

It's rude to be fascist.


text:
package org.jetbrains.plugins.scala
package lang
package psi
package stubs
package elements

import _root_.org.jetbrains.plugins.scala.lang.psi.impl.statements.ScPatternDefinitionImpl
import api.statements.ScValue
import com.intellij.lang.ASTNode
import com.intellij.psi.PsiElement

/**
 * User: Alexander Podkhalyuzin
 * Date: 17.10.2008
 */

class ScValueDefinitionElementType extends ScValueElementType[ScValue]("value definition"){
  def createElement(node: ASTNode): PsiElement = new ScPatternDefinitionImpl(node)

  def createPsi(stub: ScValueStub) = new ScPatternDefinitionImpl(stub)
}


text:
A series of processing sketches that allow you to stream video your PC to a Raspberry Pi and display the video on LED's connected to your Raspberry Pi

![alt tag](http://i.imgur.com/tQobUVb.jpg)

!!! VIDEO !!!
https://vimeo.com/173333338

# Spout Reciever Fade Candy
- Mostly for testing directly from PC to FadeCandy
Recieves images from any Spout-able application, samples pixels from it and sends those to a FadeCandy

#Spout Reciever OSC
- Running on PC connected to Rasp with ethernet
Recieves images from any Spout-able application and sends them over OSC to any client which will then hopefully have some LEDs and a FadeCandy to display these images.
By pressing the right mouse button you can specify which Spout source to use. This source has to be created first, this seems to be a Spout issue.
Using the positions.txt file you can specify the points it has to analyse. These have to range from 0.0 to 1.0 and seperated with a ','. These number specify the relative position of the points based on the size of the current window.
You can adjust the size of the analysis by clicking and dragging the mouse. To move the analysis use the arrow buttons. Use m to mirror the whole analysis and press r to reset the positions.

#OSC Reciever FadeCandy
- Auto runs on Raspberry Pi connected to FadeCandy
Recieves OSC messages from "Spout Reciever OSC" application and transforms them into FadeCandy language


text:
package com.nobigsoftware.dfalex;

import java.util.List;

/**
 * Base class for serializable placeholders that construct final-form DFA states and
 * temporarily assume their places in the DFA.
 *

 * In serialized placeholders, target states are identified by their state number in a
 * SerializableDfa.
 */
abstract class DfaStatePlaceholder<MATCH> extends DfaStateImpl<MATCH> implements java.io.Serializable
{
	private static final long serialVersionUID = 1L;

	protected transient DfaStateImpl<MATCH> m_delegate = null;

	/**
	 * Create a new DfaStatePlaceholder
	 *

	 * The initially constructed state will accept no strings
	 */
	public DfaStatePlaceholder()
	{
	}

	/**
	 * Creates the final form delegate state, implementing all the required
	 * transitions and matches.
	 *

	 * This is called on all DFA state placeholders after they are constructed
	 */
	abstract void createDelegate(int statenum, List<DfaStatePlaceholder<MATCH>> allStates);

	@Override
	final void fixPlaceholderReferences()
	{
		m_delegate.fixPlaceholderReferences();
	}

	@Override
	final DfaStateImpl<MATCH> resolvePlaceholder()
	{
		return m_delegate.resolvePlaceholder();
	}

	@Override
	final public DfaState<MATCH> getNextState(char c)
	{
		return m_delegate.getNextState(c);
	}
	@Override
	final public MATCH getMatch()
	{
		return m_delegate.getMatch();
	}
    @Override
    final public void enumerateTransitions(DfaTransitionConsumer<MATCH> consumer)
    {
        m_delegate.enumerateTransitions(consumer);
    }

    @Override
    final public int getStateNumber()
    {
        return m_delegate.getStateNumber();
    }

    @Override
    public Iterable<DfaState<MATCH>> getSuccessorStates()
    {
        return m_delegate.getSuccessorStates();
    }

    @Override
    public boolean hasSuccessorStates()
    {
        return m_delegate.hasSuccessorStates();
    }
}


text:
[![Build Status](https://travis-ci.org/igorkislyuk/bacteria.svg)](https://travis-ci.org/igorkislyuk/bacteria)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Bacteria.svg)](https://img.shields.io/cocoapods/v/Bacteria.svg)
[![Platform](https://img.shields.io/cocoapods/p/Bacteria.svg?style=flat)](http://cocoadocs.org/docsets/Bacteria)

**Framework is for basic modal viewcontroller transitions with human syntax. Special developed for ObjC users**

This done with following example
```objective-c
    yourViewController.
    presentTransition(BCTTransitionFlip).
    fromDirection(BCTDirectionTop).
    dismissTransition(BCTTransitionPopRadial).
    popTo(self.testButton).
    withDuration(0.45f);
```

## Feature list

* human syntax for transitions for ObjC
* swift version is not added now. Use drop-in file - [BacteriaSwift](BacteriaSwift.swift)
* support segues, not only for modal code presentation
* support different transition types (flat, flip, pop, safari)
* support all side modal controller presentation (note: flat extended)
* support scaling for present and dismiss controller views (note: just for flat)
* support auto-reverse functionality(means you can specify only one type for presental/dismissal and the other will be inferred automatically)

## Installation with CocoaPods

[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like Bacteria in your projects. You can install it with the following command:

```bash
$ gem install cocoapods
```

#### Podfile

To integrate Bacteria into your Xcode project using CocoaPods, specify it in your `Podfile`:

```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'Bacteria'
end
```

Then, run the following command:

```bash
$ pod install
```

## How to

Any instruction should be applied to presented controller. You can get it two ways:

1. Create it manually and present
```objective-c
	//get controller
	BCTPresentedViewController *presented = [self.storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([BCTPresentedViewController class])];

  	//bacteria configuration
    presented.
    presentTransition(BCTTransitionSafari).
    dismissTransition(BCTTransitionFlatParallel).
    toDirection(BCTDirectionTop).
    withDuration(1.45f);

    [self presentViewController:presented animated:YES completion:nil];
```
2. Using segue tracker
```objective-c
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    //get presented controller
    BCTPresentedViewController *presented = segue.destinationViewController;

    //bacteria configuration
    presented.
    presentTransition(BCTTransitionFlip).
    fromDirection(BCTDirectionTop).
    dismissTransition(BCTTransitionPopRadial).
    popTo(self.testButton).
    withDuration(0.45f);
}
```

## Functionality overview

   There is only one required method to call. It's `withDuration`, because of assigning factory as transition delegate under cover. To help figure out, for which controller you will apply your settings, library use several basic keywords, like: **present** is used for controller that will be shown, **dismiss** is used for controller which that be hidden, **from** is used for controller settings that will be shown, **to** is used for controller settings that will be hidden

* `withDuration(XXX)` - use this to specify duration for transition. XXX - float value in seconds. Applied both for present and dismiss transition

* `presentTransition(XXX)` - use this to specify transition type for presented controller. XXX is one of BCTTransitionType values.
* `dismissTransition(XXX)` - use this to specify transition for controller, when it will be dismissing. XXX is one of BCTTransitionType values.

* `fromDirection(XXX)` - use this to specify transition direction for presented controller.
* `toDirection(XXX)` - use this to specify transition direction, when it will be dismissing.
..* Both for 4 & 5: It works only with BCTTransitionFlatParallel, BCTTransitionFlatCover, BCTTransitionFlip (restricted to first 4 types). XXX is one of BCTDirectionType.

* `popFrom(XXX)` & `popTo(XXX)` - use this to pass view which will be anchor for pop animation. (NOTE: ONLY pop transitions)

* `fromScale(XXX, YYY)` & `toScale(XXX, YYY)` - use this to determine initial or final scale for controller. XXX & YYY measure in units. Range from 0 to 1. (NOTE: ONLY flat transitions)

* `fromPoint(XXX)` & `toPoint(XXX)` - use this to specify direct point from controller starts presentation / dismissal. Possibly unused, and should be discussed for removal in future versions. XXX is point.

#### Enum types

Bacteria declares several enum types for configuration.

* `BCTTransitionType` - main enum which declares different transition types. There are:
  * `BCTTransitionFlatParallel` - default one. If you need move your controllers simultaneously, use it.
  * `BCTTransitionFlatCover` - similar to previous, but original controller 'stands still'.
  * `BCTTransitionFlip` - basic flip transition like default one, extended for all 4 sides.
  * `BCTTransitionSafari` - transition's similar to safari-tab with no-customisation.
  * `BCTTransitionPopRadial` - pop, when controller appears/disappears from dot in center of view.
  * `BCTTransitionPopLinear` - similar to previous, but uses rect with rounded corners instead of center dot.
* `BCTDirectionType` - enum for determine direction for transitions.(NOTE: ONLY for Flat, FlatCover; for Flip transitions you can use only first 4 sides. Others will be converted to first 4)
  * `BCTDirectionTop` - top sied.
  * `BCTDirectionLeft` - left side.
  * `BCTDirectionBottom` - bottom side.
  * `BCTDirectionRight` - right side.
  * `BCTDirectionTopLeft` - top-left corner.
  * `BCTDirectionBottomLeft` - bottom-left corner.
  * `BCTDirectionBottomRight` - bottom-right corner.
  * `BCTDirectionTopRight` - top-right corner.

## Examples

 * Do this one:

```objective-c
    //bacteria configuration
    presented.
    presentTransition(BCTTransitionFlatCover).
    fromDirection(BCTDirectionBottomLeft).
    fromScale(0.5, 0.5).
    dismissTransition(BCTTransitionFlip).
    toDirection(BCTDirectionBottom).
    withDuration(0.45f);
```
   to receive:

 * Do this one:

```objective-c
    //bacteria configuration
    presented.
    presentTransition(BCTTransitionSafari).
    withDuration(0.45f);
```
   to receive:

  * Do this one:

```objective-c
    //bacteria configuration
    presented.
    presentTransition(BCTTransitionPopLinear).
    popFrom(self.view1).
    dismissTransition(BCTTransitionPopRadial).
    popTo(self.view2).
    withDuration(0.45f);
```
   to receive:

## TODO Section

#### Version 0.6
- [ ] Add Swift cover file for convenient syntax. Initially it is designated for ObjC users
- [ ] Add functionality to retain view within container view. Tip: use snapshot, not `addSubview:`
- [ ] Add separate duration for present / dismiss
- [ ] Add transitions for viewControllers in navigation stack

#### Version 0.7
- [ ] Add interactivity. Users should easily embed transitions in gestures
- [ ] Add support for pop initial point depending on user finger location
- [ ] Add spring values for all kind of transitions

#### Version 0.8
- [ ] Add support for background color of container for transitions
- [ ] Add blur for background container for transitions
- [ ] Add transitions for collections

#### Version 0.9
- [ ] Review whole library for refactor process

## Historical notes

Bacteria initially stands for **B**eautiful **A**nimation **C**ontroller **T**ransition. After some time it was renamed to Bacteria, for short and convenience. In other meaning, it can stands for **Ba**sic **C**ontroller **T**ransitions.

## Contributors

- [Igor Kislyuk](https://github.com/igorkislyuk)

## Bug section

- [ ] Not working with unwind segues. Figure it out

## License

MIT License. See LICENSE file for details.


text:
echo "==> Installing git"
sudo apt-get install -y git


text:
import {Aoi} from 'app/home/body/process/recipe/aoi'
import {Map} from 'app/home/map/map'
import {compose} from 'compose'
import {defaultModel} from './radarMosaicRecipe'
import {getAvailableBands} from './bands'
import {getPreSetVisualizations} from './visualizations'
import {initializeLayers} from 'app/home/body/process/recipe/recipeImageLayerSource'
import {msg} from 'translate'
import {recipe} from 'app/home/body/process/recipeContext'
import {selectFrom} from 'stateUtils'
import RadarMosaicToolbar from './panels/radarMosaicToolbar'
import React from 'react'
import moment from 'moment'

const mapRecipeToProps = recipe => ({
    aoi: selectFrom(recipe, 'model.aoi'),
    savedLayers: selectFrom(recipe, 'layers')
})

class _RadarMosaic extends React.Component {
    constructor(props) {
        super(props)
        const {savedLayers, recipeId} = props
        initializeLayers({recipeId, savedLayers})
    }

    render() {
        const {aoi} = this.props
        return (
            <Map>
                <RadarMosaicToolbar/>
                <Aoi value={aoi}/>
            </Map>
        )
    }
}

const RadarMosaic = compose(
    _RadarMosaic,
    recipe({defaultModel, mapRecipeToProps})
)

const getDateRange = recipe => {
    const {fromDate, toDate, targetDate} = recipe.model.dates
    const startDate = fromDate || targetDate
    const endDate = toDate || targetDate
    return [moment.utc(startDate, 'YYYY-MM-DD'), moment.utc(endDate, 'YYYY-MM-DD')]
}

export default () => ({
    id: 'RADAR_MOSAIC',
    labels: {
        name: msg('process.radarMosaic.create'),
        creationDescription: msg('process.radarMosaic.description'),
        tabPlaceholder: msg('process.radarMosaic.tabPlaceholder'),
    },
    components: {
        recipe: RadarMosaic
    },
    getDependentRecipeIds: _recipe => [],
    getDateRange,
    getAvailableBands,
    getPreSetVisualizations
})


text:
class Person {
    constructor(name) {
        this.name = name;

        this.btn = document.getElementById('btn');

        this.btn.addEventListener('click', () => {
            alert('My name is ' + this.name);
        }, false);
    }
}

let person = new Person('John');


text:
#ifndef DISABLE_CONSTRAINTS

#include "FixedConstraint.h"
#include "RigidBody.h"

FixedConstraint::FixedConstraint(RigidBody^ rigidBodyA, RigidBody^ rigidBodyB, Matrix frameInA,
	Matrix frameInB)
	: Generic6DofSpring2Constraint(0)
{
	TRANSFORM_CONV(frameInA);
	TRANSFORM_CONV(frameInB);
	UnmanagedPointer = new btFixedConstraint(*(btRigidBody*)rigidBodyA->_native, *(btRigidBody*)rigidBodyB->_native,
		TRANSFORM_USE(frameInA), TRANSFORM_USE(frameInB));
	TRANSFORM_DEL(frameInA);
	TRANSFORM_DEL(frameInB);

	_rigidBodyA = rigidBodyA;
	_rigidBodyB = rigidBodyB;
}

#endif


text:
using System;
using System.Collections.Generic;
using System.Data.Sql;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;

namespace RunQueries
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private readonly Dictionary<string, string> _sqlServers = new Dictionary<string, string>
        {
            ["TEST"] = "Server=(local);Database=TEST;User Id=sa;Password=sa;",
            ["TESTAfter"] = "Server=(local);Database=TESTAfter;User Id=sa;Password=sa;",
        };

        private Dictionary<string, string> _files;
        private Dictionary<string, bool> _filesStatus;
        private Dictionary<string, string> _outputFiles;

        private string _currentCommandOutput;

        private bool _hasErrors;

        public MainWindow()
        {
            InitializeComponent();

            cbServer.ItemsSource = _sqlServers.Select(x => x.Key);
        }

        private void btnRunQueries_Click(object sender, RoutedEventArgs e)
        {
            if (_files == null || !_files.Any())
            {
                System.Windows.MessageBox.Show("Select a folder with SQL scripts before proceeding.");
                return;
            }

            if (cbServer.SelectedValue == null)
            {
                System.Windows.MessageBox.Show("Select a server before proceeding.");
                return;
            }

            _hasErrors = false;
            lblStatus.Content = "Running queries";

            string connectionString = _sqlServers[cbServer.SelectedValue.ToString()];

            using (var sqlConnection = new SqlConnection(connectionString))
            {
                sqlConnection.Open();
                sqlConnection.InfoMessage += SqlConnection_InfoMessage;

                _files.Keys.ToList().ForEach(fileName => ExecuteQuery(fileName, sqlConnection));
            }

            if(_filesStatus.Any(x => x.Value))
            {
                lblStatus.Content = "Finished with errors";
                lblStatus.Foreground = new SolidColorBrush(Colors.Red);
                var filesWithErrors = _filesStatus.Where(x => x.Value).Select(x => x.Key);
                foreach (var listBoxItem in lbFiles.Items)
                {
                    if (filesWithErrors.Contains(listBoxItem.ToString()))
                    {
                        var item = lbFiles.ItemContainerGenerator.ContainerFromItem(listBoxItem) as ListBoxItem;
                        item.Foreground = new SolidColorBrush(Colors.Red);
                    }
                }
            }
            else
            {
                lblStatus.Content = "Finished successfully";
                lblStatus.Foreground = new SolidColorBrush(Colors.Green);
            }
        }

        private void ExecuteQuery(string fileName, SqlConnection sqlConnection)
        {
            _hasErrors = false;

            var queryString = File.ReadAllText(_files[fileName]);

            _currentCommandOutput = string.Empty;

            using (var command = new SqlCommand(queryString, sqlConnection))
            {
                command.StatementCompleted += Command_StatementCompleted;
                try
                {
                    command.ExecuteNonQuery();
                }
                catch (SqlException ex)
                {
                    foreach (SqlError err in ex.Errors)
                    {
                        _currentCommandOutput += $"Msg {err.Number}, Level {err.Class}, State {err.State}, Line {err.LineNumber}{Environment.NewLine}";
                        _currentCommandOutput += $"{err.Message}{Environment.NewLine}";
                    }

                    _hasErrors = true;
                }
                catch (Exception ex)
                {
                    _currentCommandOutput += $"{ex.Message}{Environment.NewLine}";

                    _hasErrors = true;
                }
            }

            var outputFile = _files[fileName].Replace(fileName, $"{cbServer.SelectedValue}\\{fileName.Replace(".sql", ".txt")}");

            if (_outputFiles == null)
                _outputFiles = new Dictionary<string, string>();

            if (!_outputFiles.ContainsKey(fileName))
                _outputFiles.Add(fileName, outputFile);

            var destinationDirectory = Path.GetDirectoryName(outputFile);
            if (!Directory.Exists(destinationDirectory))
                Directory.CreateDirectory(destinationDirectory);

            File.WriteAllText(outputFile, _currentCommandOutput);

            if (_hasErrors)
                _filesStatus[fileName] = true;
        }

        private void SqlConnection_InfoMessage(object sender, SqlInfoMessageEventArgs args)
        {
            foreach (SqlError err in args.Errors)
            {
                Console.WriteLine("Msg {0}, Level {1}, State {2}, Line {3}",
                    err.Number, err.Class, err.State, err.LineNumber);
                Console.WriteLine("{0}", err.Message);
            }
        }

        private void Command_StatementCompleted(object sender, System.Data.StatementCompletedEventArgs e)
        {
            _currentCommandOutput += $"({e.RecordCount} row(s) affected){Environment.NewLine}";
        }

        private void btnBrowse_Click(object sender, RoutedEventArgs e)
        {
            using (var dialog = new FolderBrowserDialog())
            {
                var result = dialog.ShowDialog();
                lblFolder.Content = dialog.SelectedPath;

                _files = Directory.EnumerateFiles(dialog.SelectedPath)
                                    .Where(x => x.ToLower().EndsWith(".sql"))
                                    .Select(x => new { FileName = x.Substring(x.LastIndexOf("\\") + 1), Path = x })
                                    .OrderBy(x => x.FileName)
                                    .ToDictionary(x => x.FileName, x => x.Path);
                _filesStatus = _files.ToDictionary(x => x.Key, x => false);

                lbFiles.ItemsSource = _files.Keys;
                txtOutput.Text = null;
                lblStatus.Content = null;
            }
        }

        private void cbServer_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            lblConnectionString.Content = _sqlServers[cbServer.SelectedValue.ToString()];
        }

        private void btnQuit_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void lbFiles_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (_outputFiles == null || !_outputFiles.Any())
                return;

            txtOutput.Text = File.ReadAllText(_outputFiles[lbFiles.SelectedItem.ToString()]);
        }

        private void lbFiles_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            System.Diagnostics.Process.Start(_files[lbFiles.SelectedItem.ToString()]);
        }

        private void lbFiles_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            if (lbFiles.Items.Count == 0)
                return;

            lbFiles.ToolTip = "Double click to open script in MSSM";
        }

        private void lbFiles_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            lbFiles.ToolTip = null;
        }
    }
}


text:
package Question11_2;

import java.util.Arrays;
import java.util.Comparator;

public class AnagramComparator implements Comparator<String> {
	public String sortChars(String s) {
		char[] content = s.toCharArray();
		Arrays.sort(content);
		return new String(content);
	}

    public int compare(String s1, String s2) {
    	return sortChars(s1).compareTo(sortChars(s2));
    }
}


text:
//========= Copyright � 1996-2008, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include <stdio.h>
#include <stdarg.h>

#define MAX(a,b)  (((a) > (b)) ? (a) : (b))
#define MIN(a,b)  (((a) < (b)) ? (a) : (b))

#ifdef WIN32

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER				// Allow use of features specific to Windows 2k or later.
#define WINVER 0x0500		// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows 2k or later.
#define _WIN32_WINNT 0x0500	// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE			// Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600	// Change this to the appropriate value to target other versions of IE.
#endif

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers

#pragma comment( lib, "d3d9.lib" )
#pragma comment( lib, "d3dx9.lib" )
#pragma comment( lib, "dxguid.lib" )

// Windows Header Files:
#include <windows.h>
#include <tchar.h>

// Winsock
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib" )

// d3d header files
#include "d3d9.h"
#include "d3dx9.h"

// XAudio2 header files
#include <xaudio2.h>

typedef __int16 int16;
typedef unsigned __int16 uint16;
typedef __int32 int32;
typedef unsigned __int32 uint32;
typedef __int64 int64;
typedef unsigned __int64 uint64;

#include "steam/steam_api.h"
#include "steam/isteamuserstats.h"
#include "steam/isteamremotestorage.h"
#include "steam/isteammatchmaking.h"
#include "steam/steam_gameserver.h"

#elif defined(POSIX)

#include <limits.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sys/socket.h>
#include <netinet/in.h>

	#if defined(_PS3)

	#include "stdafx_ps3.h"

	#elif defined(OSX)

	#include <OpenGL/OpenGL.h>

	#endif

#define ARRAYSIZE(A) ( sizeof(A)/sizeof(A[0]) )
// Need to define some types on POSIX
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
typedef long long int64;
typedef unsigned long long uint64;
typedef uint32 DWORD;
typedef DWORD HWND;
typedef DWORD HINSTANCE;
typedef short SHORT;
typedef long LONG;
typedef unsigned char byte;
typedef unsigned char uint8;

/* Font Weights */
#define FW_DONTCARE         0
#define FW_THIN             100
#define FW_EXTRALIGHT       200
#define FW_LIGHT            300
#define FW_NORMAL           400
#define FW_MEDIUM           500
#define FW_SEMIBOLD         600
#define FW_BOLD             700
#define FW_EXTRABOLD        800
#define FW_HEAVY            900

/* Some VK_ defines from windows, we'll map these for posix */
#define VK_BACK           0x08
#define VK_TAB            0x09
#define VK_RETURN         0x0D
#define VK_SHIFT          0x10
#define VK_CONTROL        0x11
#define VK_ESCAPE         0x1B
#define VK_SPACE          0x20
#define VK_LEFT           0x25
#define VK_UP             0x26
#define VK_RIGHT          0x27
#define VK_DOWN           0x28
#define VK_SELECT         0x29
#define VK_F5			  0x74

#ifndef VALVE_RECT_DEFINED
#define VALVE_RECT_DEFINED

	typedef struct tagRECT
	{
		LONG    left;
		LONG    top;
		LONG    right;
		LONG    bottom;
	} RECT;

	#define _RECT tagRECT
#endif

#define D3DCOLOR_ARGB(a,r,g,b) \
	((DWORD)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))

// Macros for converting ARGB DWORD color representation into opengl formats...
#define COLOR_RED( color ) \
	(GLubyte)(((color)>>16)&0xff)

#define COLOR_GREEN( color ) \
	(GLubyte)(((color)>>8)&0xff)

#define COLOR_BLUE( color ) \
	(GLubyte)((color)&0xff)

#define COLOR_ALPHA( color ) \
	(GLubyte)(((color)>>24)&0xff)

#define DWARGB_TO_DWRGBA(color) \
	((DWORD)(( (((((color)>>16)&0xff))<<24)|(((((color)>>8)&0xff))<<16)|((color&0xff)<<8)|((color)>>24)&0xff)))

#define DWARGB_TO_DWABGR(color) \
	((DWORD)(( (((((color)>>24)&0xff))<<24)|(((((color))&0xff))<<16)|(((color>>8)&0xff)<<8)|((color)>>16)&0xff)))

#define DWRGBA_TO_DWARGB(color) \
	((DWORD)(( (((((color))&0xff))<<24)|(((((color>>24))&0xff))<<16)|(((color>>16)&0xff)<<8)|((color)>>8)&0xff)))

// steam api header file
#include "steam/steam_api.h"
#include "steam/isteamuserstats.h"
#include "steam/isteamremotestorage.h"
#include "steam/isteammatchmaking.h"
#include "steam/steam_gameserver.h"

extern void OutputDebugString( const char *pchMsg );
extern int Alert( const char *lpCaption, const char *lpText );
extern const char *GetUserSaveDataPath();

#define V_ARRAYSIZE(a) sizeof(a)/sizeof(a[0])

#endif	// POSIX

// OUT_Z_ARRAY indicates an output array that will be null-terminated.
#if _MSC_VER >= 1600
       // Include the annotation header file.
       #include <sal.h>
       #if _MSC_VER >= 1700
              // VS 2012+
              #define OUT_Z_ARRAY _Post_z_
       #else
              // VS 2010
              #define OUT_Z_ARRAY _Deref_post_z_
       #endif
#else
       // gcc, clang, old versions of VS
       #define OUT_Z_ARRAY
#endif

template <size_t maxLenInChars> void sprintf_safe(OUT_Z_ARRAY char (&pDest)[maxLenInChars], const char *pFormat, ... )
{
	va_list params;
	va_start( params, pFormat );
#ifdef POSIX
	vsnprintf( pDest, maxLenInChars, pFormat, params );
#else
	_vsnprintf( pDest, maxLenInChars, pFormat, params );
#endif
	pDest[maxLenInChars - 1] = '\0';
	va_end( params );
}

inline void strncpy_safe( char *pDest, char const *pSrc, size_t maxLen )
{
	size_t nCount = maxLen;
	char *pstrDest = pDest;
	const char *pstrSource = pSrc;

	while ( 0 < nCount && 0 != ( *pstrDest++ = *pstrSource++ ) )
		nCount--;

	if ( maxLen > 0 )
		pstrDest[-1] = 0;
}

#ifdef STEAM_CEG
// Steam DRM header file
#include "cegclient.h"
#else
#define Steamworks_InitCEGLibrary() (true)
#define Steamworks_TermCEGLibrary()
#define Steamworks_TestSecret()
#define Steamworks_SelfCheck()
#endif


text:
layout: post
title: On the altar of money
comments: True
published: True
---
### work in progress...
What is money? On it's meaning, source of value, nature and morality...

Money to me is ultimately an expression of my faith in my fellow humans.

Traditionally the bonds of kinship extend to close members of our family.
Families, tribes, castes, guilds for instance are social constructs
that strive to increases our spheres of concern beyond the immediate through
economic or blood ties. Religeons and Nations can be thought of as most ambitious
of these constructs that attempt to concoct a sense of unite over large spatial and
temporal and spatial scale. Recently, supra-national entities like the UN or the EU
have also been attempted. All these directly aim at the cognitive faculties that have
inspired human social aggregation at evolutionary time-scale- namely safety and procreation.

Money I posit - circumvents the need of these desirables - and directly addresses the
underlying requirement of any social grouping --- that of trust among the participants, and thus
makes possible the largest social construct of them all - the global economy!

There are three guys on an island -  Tom, Dick and Harry. Tom can fish, Dick
can climb and fetch coconuts and Harry knows how to make and repair shelters. We
can certainly come to a system where Harry can repairing all the shelters as and
when the need arises, and Tom and Dick shall be willing to produce excess produce
from of their crafts to each other and to harry to satisfy all their nutritional
needs. However, what about times of excess needs or times of deficit production.
Given a certain amount of production, how should it be divided among the
three parties.

Of course, eventually we come to the idea of risk, i.e. how to account for future contingencies,
as well as the issues of fraud or failure among current participants.

In a  moneyless society:
* How do you account for risk/ future uncertanity?
* How do you account for eventual reduction in productivity of all individuals?