text:
package com.yuzhouwan.hacker.snmp.acl;

import org.apache.log4j.BasicConfigurator;
import org.snmp4j.*;
import org.snmp4j.asn1.BER;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.log.Log4jLogFactory;
import org.snmp4j.log.LogFactory;
import org.snmp4j.mp.*;
import org.snmp4j.security.*;
import org.snmp4j.smi.*;
import org.snmp4j.transport.AbstractTransportMapping;
import org.snmp4j.transport.DefaultTcpTransportMapping;
import org.snmp4j.transport.DefaultUdpTransportMapping;
import org.snmp4j.util.MultiThreadedMessageDispatcher;
import org.snmp4j.util.PDUFactory;
import org.snmp4j.util.ThreadPool;

import java.io.IOException;
import java.util.Vector;

public class SnmpUtil extends Thread implements PDUFactory, CommandResponder {

    public static final int DEFAULT = 0;
    public static final int WALK = 1;
    private static Snmp snmp = null;

    static {
        if (System.getProperty("log4j.configuration") == null) {
            BasicConfigurator.configure();
        }
    }

    protected int _operation = DEFAULT;
    private Target target;
    private Address address;
    private OID _authProtocol;
    private OID _privProtocol;
    private OctetString _privPassphrase;
    private OctetString _authPassphrase;
    private OctetString _community = new OctetString("public");
    private OctetString contextEngineID;
    private OctetString contextName = new OctetString();
    private OctetString _securityName = new OctetString();
    private int _numThreads = 1;
    private int _port = 0;
    private ThreadPool _threadPool = null;
    private boolean _isReceiver;
    private OctetString _authoritativeEngineID = new OctetString("1234567");
    private TransportMapping _transport = null;
    private TimeTicks _sysUpTime = new TimeTicks(0);
    private OID _trapOID = new OID("1.3.6.1.4.1.2789.2005");
    private int version;
    private int retries = 1;
    private int timeout = 1000;
    private int pduType = 0;
    private Vector vbs = new Vector();

    public SnmpUtil(String host, String varbind, boolean receiver, int type) {
        version = SnmpConstants.version2c;
        _isReceiver = receiver;
        if (type == 2) {
            pduType = PDU.INFORM;
        } else if (type == 1) {
            pduType = PDU.TRAP;
        }
        setPort();
        if (!_isReceiver) {
            init(host, varbind);
        } else {
            initReceiver(host);
        }
    }

    public SnmpUtil(String host, String varbind, String user, String authProtocol,
                    String authPasshrase, String privProtocol, String privPassphrase,
                    boolean receiver, int type) {

        version = SnmpConstants.version3;
        _isReceiver = receiver;
        _privPassphrase = new OctetString(privPassphrase);
        _authPassphrase = new OctetString(authPasshrase);
        _securityName = new OctetString(user);
        if (authProtocol.equals("MD5")) {
            _authProtocol = AuthMD5.ID;
        } else if (authProtocol.equals("SHA")) {
            _authProtocol = AuthSHA.ID;
        }

        if (privProtocol.equals("DES")) {
            _privProtocol = PrivDES.ID;
        } else if ((privProtocol.equals("AES128")) || (privProtocol.equals("AES"))) {
            _privProtocol = PrivAES128.ID;
        } else if (privProtocol.equals("AES192")) {
            _privProtocol = PrivAES192.ID;
        } else if (privProtocol.equals("AES256")) {
            _privProtocol = PrivAES256.ID;
        }
        if (type == 2) {
            pduType = PDU.INFORM;
        } else if (type == 1) {
            pduType = PDU.TRAP;
        }
        setPort();
        if (!_isReceiver) {
            init(host, varbind);
        } else {
            initReceiver(host);
        }
    }

    protected static void printVariableBindings(PDU response) {
        for (int i = 0; i < response.size(); i++) {
            VariableBinding vb = response.get(i);
            System.out.println(vb.toString());
        }
    }

    protected static void printReport(PDU response) {
        if (response.size() < 1) {
            System.out.println("REPORT PDU does not contain a variable binding.");
            return;
        }

        VariableBinding vb = response.get(0);
        OID oid = vb.getOid();
        if (SnmpConstants.usmStatsUnsupportedSecLevels.equals(oid)) {
            System.out.print("REPORT: Unsupported Security Level.");
        } else if (SnmpConstants.usmStatsNotInTimeWindows.equals(oid)) {
            System.out.print("REPORT: Message not within time window.");
        } else if (SnmpConstants.usmStatsUnknownUserNames.equals(oid)) {
            System.out.print("REPORT: Unknown user name.");
        } else if (SnmpConstants.usmStatsUnknownEngineIDs.equals(oid)) {
            System.out.print("REPORT: Unknown engine id.");
        } else if (SnmpConstants.usmStatsWrongDigests.equals(oid)) {
            System.out.print("REPORT: Wrong digest.");
        } else if (SnmpConstants.usmStatsDecryptionErrors.equals(oid)) {
            System.out.print("REPORT: Decryption error.");
        } else if (SnmpConstants.snmpUnknownSecurityModels.equals(oid)) {
            System.out.print("REPORT: Unknown security model.");
        } else if (SnmpConstants.snmpInvalidMsgs.equals(oid)) {
            System.out.print("REPORT: Invalid message.");
        } else if (SnmpConstants.snmpUnknownPDUHandlers.equals(oid)) {
            System.out.print("REPORT: Unknown PDU handler.");
        } else if (SnmpConstants.snmpUnavailableContexts.equals(oid)) {
            System.out.print("REPORT: Unavailable context.");
        } else if (SnmpConstants.snmpUnknownContexts.equals(oid)) {
            System.out.print("REPORT: Unknown context.");
        } else {
            System.out.print("REPORT contains unknown OID ("
                    + oid.toString() + ").");
        }

        System.out.println(" Current counter value is "
                + vb.getVariable().toString() + ".");
    }

    private static PDU walk(PDU request, Target target)
            throws IOException {
        request.setNonRepeaters(0);
        OID rootOID = request.get(0).getOid();
        PDU response;
        int objects = 0;
        int requests = 0;
        long startTime = System.currentTimeMillis();
        do {
            requests++;
            ResponseEvent responseEvent = SnmpUtil.snmp.send(request, target);
            response = responseEvent.getResponse();
            if (response != null) {
                objects += response.size();
            }
        }
        while (!processWalk(response, request, rootOID));

        System.out.println();
        System.out.println("Total requests sent:    " + requests);
        System.out.println("Total objects received: " + objects);
        System.out.println("Total walk time:        "
                + (System.currentTimeMillis() - startTime) + " milliseconds");
        return response;
    }

    private static boolean processWalk(PDU response, PDU request, OID rootOID) {
        if ((response == null) || (response.getErrorStatus() != 0)
                || (response.getType() == PDU.REPORT)) {
            return true;
        }
        boolean finished = false;
        OID lastOID = request.get(0).getOid();
        for (int i = 0; (!finished) && (i < response.size()); i++) {
            VariableBinding vb = response.get(i);
            if ((vb.getOid() == null) || (vb.getOid().size() < rootOID.size())
                    || (rootOID.leftMostCompare(rootOID.size(), vb.getOid()) != 0)) {
                finished = true;
            } else if (Null.isExceptionSyntax(vb.getVariable().getSyntax())) {
                System.out.println(vb.toString());
                finished = true;
            } else if (vb.getOid().compareTo(lastOID) <= 0) {
                System.out.println("Variable received is not lexicographic successor of requested one:");
                System.out.println(vb.toString() + " <= " + lastOID);
                finished = true;
            } else {
                System.out.println(vb.toString());
                lastOID = vb.getOid();
            }
        }
        if (response.size() == 0) {
            finished = true;
        }
        if (!finished) {
            VariableBinding next = response.get(response.size() - 1);
            next.setVariable(new Null());
            request.set(0, next);
            request.setRequestID(new Integer32(0));
        }
        return finished;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public int getOperation() {
        return _operation;
    }

    public void setOperation(int operation) {
        _operation = operation;
        if (_operation == WALK) {
            pduType = PDU.GETNEXT;
        }
    }

    public int getPduType() {
        return pduType;
    }

    public void setPort() {
        if (pduType == PDU.INFORM || pduType == PDU.TRAP
                || _isReceiver) {
            _port = 162;
        } else {
            _port = 161;
        }
    }

    public void init(String host, String varBind) {
        vbs = getVariableBinding(varBind);
        if (pduType == PDU.INFORM || pduType == PDU.TRAP) {
            checkTrapVariables(vbs);
        }
        address = new UdpAddress(host + "/" + _port);
        LogFactory.setLogFactory(new Log4jLogFactory());
        BER.setCheckSequenceLength(false);
    }

    public Vector getVariableBindings() {
        return vbs;
    }

    private void addUsmUser(Snmp snmp) {
        snmp.getUSM().addUser(_securityName, new UsmUser(_securityName,
                _authProtocol,
                _authPassphrase,
                _privProtocol,
                _privPassphrase));
    }

    private Snmp createSnmpSession() throws IOException {
        AbstractTransportMapping transport;
        if (address instanceof TcpAddress) {
            transport = new DefaultTcpTransportMapping();
        } else {
            transport = new DefaultUdpTransportMapping();
        }
        // Could save some CPU cycles:
        // transport.setAsyncMsgProcessingSupported(false);
        Snmp snmp = new Snmp(transport);

        if (version == SnmpConstants.version3) {
            USM usm = new USM(SecurityProtocols.getInstance(),
                    new OctetString(MPv3.createLocalEngineID()), 0);
            SecurityModels.getInstance().addSecurityModel(usm);
            addUsmUser(snmp);
        }
        return snmp;
    }

    private Target createTarget() {
        if (version == SnmpConstants.version3) {
            UserTarget target = new UserTarget();
            if (_authPassphrase != null) {
                if (_privPassphrase != null) {
                    target.setSecurityLevel(SecurityLevel.AUTH_PRIV);
                } else {
                    target.setSecurityLevel(SecurityLevel.AUTH_NOPRIV);
                }
            } else {
                target.setSecurityLevel(SecurityLevel.NOAUTH_NOPRIV);
            }
            target.setSecurityName(_securityName);
            return target;
        } else {
            CommunityTarget target = new CommunityTarget();
            target.setCommunity(_community);
            return target;
        }
    }

    public PDU send() throws IOException {
        snmp = createSnmpSession();
        this.target = createTarget();
        target.setVersion(version);
        target.setAddress(address);
        target.setRetries(retries);
        target.setTimeout(timeout);
        snmp.listen();

        PDU request = createPDU(target);
        for (Object vb : vbs) {
            request.add((VariableBinding) vb);
        }

        PDU response = null;
        if (_operation == WALK) {
            response = walk(request, target);
        } else {
            ResponseEvent responseEvent;
            long startTime = System.currentTimeMillis();
            responseEvent = snmp.send(request, target);
            if (responseEvent != null) {
                response = responseEvent.getResponse();
                System.out.println("Received response after "
                        + (System.currentTimeMillis() - startTime) + " millis");
            }
        }
        snmp.close();
        return response;
    }

    public PDU createPDU(Target target) {
        PDU request;
        if (this.target.getVersion() == SnmpConstants.version3) {
            request = new ScopedPDU();
            ScopedPDU scopedPDU = (ScopedPDU) request;
            if (contextEngineID != null) {
                scopedPDU.setContextEngineID(contextEngineID);
            }
            if (contextName != null) {
                scopedPDU.setContextName(contextName);
            }
        } else {
            request = new PDU();
        }
        request.setType(pduType);
        return request;
    }

    private Vector getVariableBinding(String varBind) {
        Vector v = new Vector(varBind.length());
        String oid;
        char type;
        String value;
        int equal = varBind.indexOf("={");
        if (equal > 0) {
            oid = varBind.substring(0, equal);
            type = varBind.charAt(equal + 2);
            value = varBind.substring(varBind.indexOf('}') + 1);
        } else {
            v.add(new VariableBinding(new OID(varBind)));
            return v;
        }

        VariableBinding vb = new VariableBinding(new OID(oid));
        if (value != null) {
            Variable variable;
            switch (type) {
                case 'i':
                    variable = new Integer32(Integer.parseInt(value));
                    break;
                case 'u':
                    variable = new UnsignedInteger32(Long.parseLong(value));
                    break;
                case 's':
                    variable = new OctetString(value);
                    break;
                case 'x':
                    variable = OctetString.fromString(value, ':', 16);
                    break;
                case 'd':
                    variable = OctetString.fromString(value, '.', 10);
                    break;
                case 'b':
                    variable = OctetString.fromString(value, ' ', 2);
                    break;
                case 'n':
                    variable = new Null();
                    break;
                case 'o':
                    variable = new OID(value);
                    break;
                case 't':
                    variable = new TimeTicks(Long.parseLong(value));
                    break;
                case 'a':
                    variable = new IpAddress(value);
                    break;
                default:
                    throw new IllegalArgumentException("Variable type " + type + " not supported");
            }
            vb.setVariable(variable);
        }
        v.add(vb);
        return v;
    }

    public void initReceiver(String host) {
        Address address = new UdpAddress(host + "/" + _port);
        try {
            _transport = new DefaultUdpTransportMapping((UdpAddress) address);
        } catch (IOException e) {
            System.out.println("Unable to bind to local IP and port: " + e);
            System.exit(-1);
        }

        _threadPool = ThreadPool.create(this.getClass().getName(), _numThreads);

        MessageDispatcher mtDispatcher =
                new MultiThreadedMessageDispatcher(_threadPool, new MessageDispatcherImpl());

        // add message processing models
        mtDispatcher.addMessageProcessingModel(new MPv1());
        mtDispatcher.addMessageProcessingModel(new MPv2c());

        // add all security protocols
        SecurityProtocols.getInstance().addDefaultProtocols();

        snmp = new Snmp(mtDispatcher, _transport);
        snmp.addCommandResponder(this);

        if (version == SnmpConstants.version3) {
            mtDispatcher.addMessageProcessingModel(new MPv3());
            MPv3 mpv3 = (MPv3) snmp.getMessageProcessingModel(MessageProcessingModel.MPv3);

            USM usm = new USM(SecurityProtocols.getInstance(), new OctetString(mpv3.createLocalEngineID()), 0);

            SecurityModels.getInstance().addSecurityModel(usm);
            if (_authoritativeEngineID != null) {
                snmp.setLocalEngine(_authoritativeEngineID.getValue(), 0, 0);
            }
            this.addUsmUser(snmp);
        }
    }

    public synchronized void listen() {
        try {
            _transport.listen();
        } catch (IOException e) {
            System.out.println("Unable to listen: " + e);
            System.exit(-1);
        }
        System.out.println("Waiting for traps..");
        try {
            // Wait for traps to come in.
            this.wait();
        } catch (InterruptedException ex) {
            System.out.println("Interrupted while waiting for traps: " + ex);
            System.exit(-1);
        }
    }

    public synchronized void processPdu(CommandResponderEvent e) {
        PDU command = e.getPDU();
        if (command != null) {
            System.out.println(command.toString());
            if ((command.getType() != PDU.TRAP)
                    && (command.getType() != PDU.V1TRAP)
                    && (command.getType() != PDU.REPORT)
                    && (command.getType() != PDU.RESPONSE)) {
                command.setErrorIndex(0);
                command.setErrorStatus(0);
                command.setType(PDU.RESPONSE);
                StatusInformation statusInformation = new StatusInformation();
                StateReference ref = e.getStateReference();
                try {
                    e.getMessageDispatcher().returnResponsePdu(e.
                                    getMessageProcessingModel(),
                            e.getSecurityModel(),
                            e.getSecurityName(),
                            e.getSecurityLevel(),
                            command,
                            e.getMaxSizeResponsePDU(),
                            ref,
                            statusInformation);
                } catch (MessageException ex) {
                    System.err.println("Error while sending response: " + ex.getMessage());
                }
            }
        }
    }

    public void sendAndProcessResponse() {
        try {
            PDU response = this.send();
            if ((getPduType() == PDU.TRAP)
                    || (getPduType() == PDU.REPORT)
                    || (getPduType() == PDU.V1TRAP)
                    || (getPduType() == PDU.RESPONSE)) {
                System.out.println(PDU.getTypeString(getPduType()) + " sent successfully");
            } else if (response == null) {
                System.out.println("Request timed out.");
            } else if (response.getType() == PDU.REPORT) {
                printReport(response);
            } else if (getOperation() == WALK) {
                System.out.println("End of walked subtree '"
                        + ((VariableBinding) getVariableBindings().get(0)).getOid()
                        + "' reached at:");
                printVariableBindings(response);
            } else {
                System.out.println("Received something strange: requestID="
                        + response.getRequestID()
                        + ", errorIndex="
                        + response.getErrorIndex() + ", "
                        + "errorStatus=" + response.getErrorStatusText()
                        + "(" + response.getErrorStatus() + ")");
                printVariableBindings(response);
            }
        } catch (IOException ex) {
            System.err.println("Error while trying to send request: " + ex.getMessage());
            ex.printStackTrace();
        }
    }

    private void checkTrapVariables(Vector vbs) {
        if ((pduType == PDU.INFORM) || (pduType == PDU.TRAP)) {
            if ((vbs.size() == 0)
                    || ((vbs.size() > 1)
                    && (!((VariableBinding) vbs.get(0)).getOid().equals(SnmpConstants.sysUpTime)))) {
                vbs.add(0, new VariableBinding(SnmpConstants.sysUpTime, _sysUpTime));
            }
            if ((vbs.size() == 1) || ((vbs.size() > 2)
                    && (!((VariableBinding) vbs.get(1)).getOid().equals(SnmpConstants.snmpTrapOID)))) {
                vbs.add(1, new VariableBinding(SnmpConstants.snmpTrapOID, _trapOID));
            }
        }
    }
}


text:
class JustifyText < Liquid::Tag
  MAX_LENGTH = 80

  def initialize(tag_name, args, tokens)
    super
    @left = args.split(' ').first
    @right = args.split(' ').last
  end

  def render(context)
    left = context[@left.strip]
    right = context[@right.strip]

    result = left
    spaces = MAX_LENGTH - left.size - right.size
    spaces.times do
      result += ' '
    end
    result += right
  end
end

Liquid::Template.register_tag('justify_text', JustifyText)

redpajama_set_name: RedPajamaGithub


text:
const Dropdown          = require('@binary-com/binary-style').selectDropdown;
const TradingAnalysis   = require('./analysis');
const commonTrading     = require('./common');
const cleanupChart      = require('./charts/webtrader_chart').cleanupChart;
const displayCurrencies = require('./currency');
const Defaults          = require('./defaults');
const TradingEvents     = require('./event');
const Price             = require('./price');
const Process           = require('./process');
const ViewPopup         = require('../user/view_popup/view_popup');
const Client            = require('../../base/client');
const Header            = require('../../base/header');
const BinarySocket      = require('../../base/socket');
const DerivBanner       = require('../../common/deriv_banner');
const CloseBanner       = require('../../common/game_close_banner');
const ClosePopup       = require('../../common/game_close_popup');
const Guide             = require('../../common/guide');
const TopUpVirtualPopup = require('../../pages/user/account/top_up_virtual/pop_up');
const State             = require('../../../_common/storage').State;

const TradePage = (() => {
    let events_initialized = 0;
    State.remove('is_trading');
    const onLoad = () => {
        BinarySocket.wait('authorize', 'website_status', 'landing_company').then(() => {
            const is_uk_residence = (Client.get('residence') === 'gb' || State.getResponse('website_status.clients_country') === 'gb');
            const is_iom_client = (Client.get('residence') === 'im' || State.getResponse('website_status.clients_country') === 'im');
            if (is_uk_residence && Client.hasAccountType('gaming')) {
                CloseBanner.onLoad();
                ClosePopup.onLoad();
            } else if (is_iom_client && Client.hasAccountType('gaming')) {
                CloseBanner.onLoad();
                ClosePopup.onLoad();
            } else {
                DerivBanner.onLoad();
            }
        });

        BinarySocket.wait('authorize' , 'landing_company').then(() => {
            init();
        });
    };

    const init = () => {
        if (Client.isAccountOfType('financial') || Client.isOptionsBlocked()) {
            return;
        }

        State.set('is_trading', true);
        Price.clearFormId();
        if (events_initialized === 0) {
            events_initialized = 1;
            TradingEvents.init();
        }
        BinarySocket.wait('authorize').then(() => {
            Header.displayAccountStatus();
            if (Client.get('is_virtual')) {
                Header.upgradeMessageVisibility(); // To handle the upgrade buttons visibility
                // if not loaded by pjax, balance update function calls TopUpVirtualPopup
                if (State.get('is_loaded_by_pjax')) {
                    BinarySocket.wait('balance').then(() => {
                        TopUpVirtualPopup.init(State.getResponse('balance.balance'));
                    });
                }
            }
            Client.activateByClientType('trading_socket_container');
            BinarySocket.send({ payout_currencies: 1 }).then(() => {
                displayCurrencies();
                Dropdown('#currency', true);
                if (document.getElementById('multiplier_currency').tagName === 'SELECT') {
                    Dropdown('#multiplier_currency', true);
                }
                Process.processActiveSymbols();

                const $currency = $('.currency');

                // if currency symbol is span, restore back from custom dropdown
                if ($currency.is('span') && $currency.parent('div.select').length) {
                    $currency.parent().replaceWith(() => {
                        const curr_element = $currency;
                        return curr_element;
                    });
                    if ($currency.next().attr('id') === $currency.attr('id')) $currency.next().eq(0).remove();
                }
            });
        });
        if (document.getElementById('websocket_form')) {
            commonTrading.addEventListenerForm();
        }

        // Walk-through Guide
        Guide.init({
            script: 'trading',
        });
        TradingAnalysis.bindAnalysisTabEvent();

        ViewPopup.viewButtonOnClick('#contract_confirmation_container');
    };

    const reload = () => {
        sessionStorage.removeItem('underlying');
        window.location.reload();
    };

    const onUnload = () => {
        State.remove('is_trading');
        events_initialized = 0;
        Process.forgetTradingStreams();
        BinarySocket.clear();
        Defaults.clear();
        cleanupChart();
        commonTrading.clean();
        BinarySocket.clear('active_symbols');
        TradingAnalysis.onUnload();
        DerivBanner.onUnload();
    };

    const onDisconnect = () => {
        commonTrading.showPriceOverlay();
        commonTrading.showFormOverlay();
        cleanupChart();
        onLoad();
    };

    return {
        onLoad,
        reload,
        onUnload,
        onDisconnect,
    };
})();

module.exports = TradePage;


text:
    #pragma warning (push)
    #pragma warning (disable: 4996) // This function or variable may be unsafe
    #pragma warning (disable: 4244) // 'return': conversion from 'const int64_t' to 'float', possible loss of data
    #pragma warning (disable: 4715) // configuru::Config::operator[]': not all control paths return a value
#endif
#define CONFIGURU_IMPLEMENTATION 1
#include <configuru.hpp>
#ifdef _MSC_VER
    #pragma warning (pop)
#endif

namespace steamvrbridge {

	Config::Config(const std::string &fnamebase)
	: ConfigFileBase(fnamebase) {
	}

	const std::string
	Config::getConfigPath()
	{
		std::string home_dir= Utils::Path_GetHomeDirectory();
		std::string config_path = home_dir + "/PSMoveSteamVRBridge";

		if (!Utils::Path_CreateDirectory(config_path))
		{
			Logger::Error("Config::getConfigPath() - Failed to create config directory: %s", config_path.c_str());
		}

		std::string config_filepath = config_path + "/" + ConfigFileBase + ".json";

		return config_filepath;
	}

	void
	Config::save()
	{
		save(getConfigPath());
	}

	void
	Config::save(const std::string &path)
	{
		configuru::dump_file(path, WriteToJSON(), configuru::JSON);
	}

	bool
	Config::load()
	{
		return load(getConfigPath());
	}

	bool
	Config::load(const std::string &path)
	{
		bool bLoadedOk = false;

		if (Utils::Path_FileExists( path ) )
		{
			configuru::Config cfg = configuru::parse_file(path, configuru::JSON);
			ReadFromJSON(cfg);
			bLoadedOk = true;
		}

		return bLoadedOk;
	}
}


text:
from setuptools import setup

setup(name='pySphericalPolygon',
		version='0.1.7',
		description='preform point in spherical polygon operations',
		long_description=open('README.rst').read(),
		author='Omry V',
		author_email='omryv@post.bgu.ac.il',
		license='MIT',
		packages=['pySphericalPolygon'],
		url='https://pypi.python.org/pypi/pySphericalPolygon',
		install_requires=[
		   'numpy',
		   'pyproj',
		   'matplotlib'
		],
		zip_safe=False)


text:
<link rel="stylesheet" type="text/css" href="/devwidgets/contentmetadata/css/contentmetadata.css" />

__MSG__DETAILS__

        <button type="button" id="contentmetadata_show_more" class="s3d-button s3d-link-button s3d-action">

__MSG__SEE_MORE__

__MSG__SEE_LESS__

        </button>


text:
package netty.example;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;

/**
 * @author liming
 * @since 2015/8/4
 */
public class EchoClinetHandler extends SimpleChannelInboundHandler<ByteBuf>
{
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg)
        throws Exception
    {
        System.out.println("Client received: " + ByteBufUtil.hexDump(msg.readBytes(msg.readableBytes())));
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx)
        throws Exception
    {
        ctx.write(Unpooled.copiedBuffer("Netty client read", CharsetUtil.UTF_8));
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
        throws Exception
    {
        cause.printStackTrace();
        ctx.close();
    }

}


text:
package com.example.sample2;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}


text:
package framework

import (
	"fmt"

	yaml "gopkg.in/yaml.v2"
	"regexp"
)

const (
	ConfigStack = iota
	ConfigDataCenter
	ConfigCluster
	ConfigZone
)

type StackStatus int

const (
	StackStatusStaging StackStatus = iota
	StackStatusRunning
	StackStatusFailed
)

type Stack struct {
	Namespace    string
	Name         string                  `yaml:"name,omitempty"`
	From         string                  `yaml:"from,omitempty"`
	Applications map[string]*Application `yaml:"applications,omitempty"`
	Layer        int
}

func UnmarshalStack(yml []byte) (*Stack, error) {
	Logger.Info("Unmarshalling stack")
	stack := new(Stack)
	err := yaml.Unmarshal(yml, &stack)
	if err != nil {
		return nil, err
	}

	return stack, nil
}

func (s *Stack) GetApplications() map[string]*Application {
	return s.Applications
}

func (s *Stack) GetRunner() Runner {
	return s
}

func (s *Stack) GetStack() *Stack {
	return s
}

func (s *Stack) Merge(child *Stack) {
	Logger.Debug("Merging stacks: \n%s\n\n%s", s, child)
	s.Name = child.Name

	for name, childApp := range child.Applications {
		app, ok := s.Applications[name]
		if !ok {
			s.Applications[name] = childApp
			continue
		}

		setString(childApp.ID, &app.ID)
		setString(childApp.Version, &app.Version)
		setFloat(childApp.Cpu, &app.Cpu)
		setFloat(childApp.Mem, &app.Mem)
		setIntSlice(childApp.Ports, &app.Ports)
		setString(childApp.User, &app.User)
		setString(childApp.Healthcheck, &app.Healthcheck)
		setString(childApp.LaunchCommand, &app.LaunchCommand)
		setStringSlice(childApp.ArtifactURLs, &app.ArtifactURLs)
		setStringSlice(childApp.AdditionalArtifacts, &app.AdditionalArtifacts)
		setStringSlice(childApp.Dependencies, &app.Dependencies)
		for k, v := range childApp.Scheduler {
			if v == "" {
				delete(app.Scheduler, k)
				continue
			}

			if app.Scheduler == nil {
				app.Scheduler = make(map[string]string)
			}
			app.Scheduler[k] = v
		}
		if len(childApp.Tasks) > 0 {
			app.Tasks = childApp.Tasks
		}

		setStringSlice(childApp.BeforeScheduler, &app.BeforeScheduler)
		setStringSlice(childApp.AfterScheduler, &app.AfterScheduler)
		setStringSlice(childApp.BeforeTask, &app.BeforeTask)
		setStringSlice(childApp.AfterTask, &app.AfterTask)
		setStringSlice(childApp.AfterTasks, &app.AfterTasks)
	}
}

func (s *Stack) String() string {
	yml, err := yaml.Marshal(s)
	if err != nil {
		panic(err)
	}

	return string(yml)
}

func (s *Stack) Validate() error {
	//TODO determine circular dependencies also

	// validate applications
	for name, app := range s.Applications {
		if err := app.Validate(); err != nil {
			return fmt.Errorf("Invalid application %s: %s", name, err)
		}
	}

	return nil
}

func (s *Stack) Run(request *RunRequest, context *RunContext) error {
	if err := s.Validate(); err != nil {
		return err
	}

	runningApps := make(map[string]ApplicationStatus)
	statuses := make(chan *ApplicationRunStatus, len(s.Applications))

	info, err := context.Marathon.Info()
	if err != nil {
		Logger.Debug("Error getting client info: %s", err)
		return err
	}
	context.Variables.SetStackVariable("mesos.master", info.MarathonConfig.Master)
	context.Variables.SetStackVariable("zone", context.Zone)
	context.Variables.SetStackVariable("stack", context.StackName)

	err = s.markSkippedApps(request.SkipApplications, runningApps, statuses)
	if err != nil {
		return err
	}
	s.runApplications(runningApps, context, statuses, request.MaxWait)

	for status := range statuses {
		if status.Error != nil {
			Logger.Warn("Application %s failed with error %s", status.Application.ID, status.Error)
			_ = context.StateStorage.SaveApplicationStatus(context.StackName, context.Zone, status.Application.ID, ApplicationStatusFailed)
			return fmt.Errorf("%s: %s", status.Application.ID, status.Error)
		}

		runningApps[status.Application.ID] = ApplicationStatusRunning
		err = context.StateStorage.SaveApplicationStatus(context.StackName, context.Zone, status.Application.ID, ApplicationStatusRunning)
		if err != nil {
			return err
		}
		err = context.StateStorage.SaveStackVariables(context.StackName, context.Zone, context.Variables)
		if err != nil {
			return err
		}
		if s.allApplicationsRunning(runningApps) {
			close(statuses)
			return nil
		}

		s.runApplications(runningApps, context, statuses, request.MaxWait)
	}

	return nil
}

func (s Stack) ID() string {
	return fmt.Sprintf("%s.%s", s.Namespace, s.Name)
}

func (s *Stack) markSkippedApps(skipApplications []string, runningApps map[string]ApplicationStatus,
	statuses chan *ApplicationRunStatus) error {
	for _, skipRegex := range skipApplications {
		pattern, err := regexp.Compile(skipRegex)
		if err != nil {
			return err
		}

		for _, app := range s.Applications {
			if pattern.MatchString(app.ID) {
				Logger.Info("Application %s matches skip pattern \"%s\", skipping", app.ID, skipRegex)
				runningApps[app.ID] = ApplicationStatusRunning
				statuses <- NewApplicationRunStatus(app, nil)
			}
		}
	}

	return nil
}

func (s *Stack) runApplications(runningApps map[string]ApplicationStatus, context *RunContext, status chan *ApplicationRunStatus, maxWait int) {
	Logger.Debug("Running applications...")
	for _, app := range s.Applications {
		if state, exists := runningApps[app.ID]; exists {
			Logger.Debug("Application %s is in state %s, continuing", app.ID, ApplicationStatuses[state])
			continue
		}

		if app.IsDependencySatisfied(runningApps) {
			runningApps[app.ID] = ApplicationStatusStaging
			go s.runApplication(app, context, status, maxWait)
		}
	}
}

func (s *Stack) runApplication(app *Application, context *RunContext, status chan *ApplicationRunStatus, maxWait int) {
	err := app.Run(context, maxWait)
	if err != nil {
		// TODO should remove the application if anything goes wrong
	}

	status <- NewApplicationRunStatus(app, err)
}

func (s *Stack) allApplicationsRunning(apps map[string]ApplicationStatus) bool {
	for _, app := range s.Applications {
		state, exists := apps[app.ID]
		if !exists || state != ApplicationStatusRunning {
			Logger.Debug("Application %s is not yet running", app.ID)
			return false
		}
	}

	return true
}


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

namespace Azure.ResourceManager.MachineLearningServices.Models
{
    /// <summary> The result of a request to list machine learning workspaces. </summary>
    internal partial class WorkspaceListResult
    {
        /// <summary> Initializes a new instance of WorkspaceListResult. </summary>
        internal WorkspaceListResult()
        {
            Value = new ChangeTrackingList<Workspace>();
        }

        /// <summary> Initializes a new instance of WorkspaceListResult. </summary>
        /// <param name="value"> The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. </param>
        /// <param name="nextLink"> The URI that can be used to request the next list of machine learning workspaces. </param>
        internal WorkspaceListResult(IReadOnlyList<Workspace> value, string nextLink)
        {
            Value = value;
            NextLink = nextLink;
        }

        /// <summary> The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. </summary>
        public IReadOnlyList<Workspace> Value { get; }
        /// <summary> The URI that can be used to request the next list of machine learning workspaces. </summary>
        public string NextLink { get; }
    }
}


text:
namespace Colore.Helpers
{
    using System;
    using System.Runtime.InteropServices;
    using System.Security;

    using Colore.Data;
    using Colore.Logging;

    using Microsoft.Win32;

    /// <summary>
    /// Contains helper methods for accessing the registry.
    /// </summary>
    internal static class RegistryHelper
    {
        /// <summary>
        /// Path to a SubKey under "Razer Chroma SDK" in the registry containing information about the SDK.
        /// </summary>
        /// <remarks>
        /// In some version of the SDK, the location of the "Enabled" key changed to be in this SubKey
        /// under the main key in the registry for the Chroma SDK.
        /// </remarks>
        private const string AppsSubKeyPath = "Apps";

        /// <summary>
        /// Logger instance for this class.
        /// </summary>
        private static readonly ILog Log = LogProvider.GetLogger(typeof(RegistryHelper));

        /// <summary>
        /// The path to the Razer Chroma SDK registry key.
        /// </summary>
        private static readonly string SdkRegKeyPath = GetSdkRegKeyPath();

        /// <summary>
        /// Checks if the Chroma SDK is available on this system.
        /// </summary>
        /// <returns><c>true</c> if Chroma SDK is available, otherwise <c>false</c>.</returns>
        internal static bool IsSdkAvailable()
        {
            Log.Debug("Checking for SDK availability");

            var dllValid = IsSdkDllValid();
            var regEnabled = IsSdkEnabledInRegistry();

            return dllValid && regEnabled;
        }

        /// <summary>
        /// Attempts to extract the SDK version from the registry.
        /// </summary>
        /// <param name="ver">The SDK version will be saved in this variable.</param>
        /// <returns>
        /// <c>true</c> if the version was retrieved successfully and stored in <paramref name="ver" />,
        /// otherwise <c>false</c> with <c>(0, 0, 0)</c> stored in <paramref name="ver" />.
        /// </returns>
        internal static bool TryGetSdkVersion(out SdkVersion ver)
        {
            if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                Log.Debug("Not running on Windows platform, aborting registry check");
                ver = new SdkVersion(0, 0, 0);
                return false;
            }

            try
            {
                using (var key = Registry.LocalMachine.OpenSubKey(SdkRegKeyPath, false))
                {
                    if (key == null)
                    {
                        Log.Warn("Failed to open registry key to read SDK version.");
                        ver = new SdkVersion(0, 0, 0);
                        return false;
                    }

                    var major = key.GetValue("MajorVersion");
                    var minor = key.GetValue("MinorVersion");
                    var revision = key.GetValue("RevisionNumber");

                    if (major is int majorInt && minor is int minorInt && revision is int revInt)
                    {
                        ver = new SdkVersion(majorInt, minorInt, revInt);
                        return true;
                    }

                    Log.WarnFormat(
                        "Unknown version component types, please tell a developer: Ma is {0}, Mi is {1}, R is {2}.",
                        major?.GetType().ToString() ?? "<NULL>",
                        minor?.GetType().ToString() ?? "<NULL>",
                        revision?.GetType().ToString() ?? "<NULL>");

                    ver = new SdkVersion(0, 0, 0);
                    return false;
                }
            }
            catch (PlatformNotSupportedException ex)
            {
                Log.WarnException("Can't obtain SDK version due to registry not being supported on this system", ex);
                ver = new SdkVersion(0, 0, 0);
                return false;
            }
            catch (SecurityException ex)
            {
                Log.WarnException("System raised SecurityException during read of SDK version in registry.", ex);
                ver = new SdkVersion(0, 0, 0);
                return false;
            }
            catch (UnauthorizedAccessException ex)
            {
                Log.WarnException("Not authorized to read registry for SDK version.", ex);
                ver = new SdkVersion(0, 0, 0);
                return false;
            }
        }

        /// <summary>
        /// Gets the path to the Razer Chroma SDK registry key.
        /// </summary>
        /// <returns>Path to the Razer Chroma SDK registry key.</returns>
        private static string GetSdkRegKeyPath()
        {
            return EnvironmentHelper.Is64Bit()
                ? @"SOFTWARE\WOW6432Node\Razer Chroma SDK"
                : @"SOFTWARE\Razer Chroma SDK";
        }

        /// <summary>
        /// Checks if the Chroma SDK DLL is valid by attempting to load it.
        /// </summary>
        /// <returns><c>true</c> if the DLL is valid and could be loaded; otherwise, <c>false</c>.</returns>
        private static bool IsSdkDllValid()
        {
            IntPtr libraryPointer;

            var dllName = EnvironmentHelper.Is64Bit() ? "RzChromaSDK64.dll" : "RzChromaSDK.dll";
            Log.Debug("Attempting to load SDK library {DllName}", dllName);
            var valid = (libraryPointer = Native.Kernel32.NativeMethods.LoadLibrary(dllName)) != IntPtr.Zero;

            Log.Debug("DLL valid? {DllValid}. SDK library pointer: {LibraryPointer}", valid, libraryPointer);

            if (libraryPointer != IntPtr.Zero)
            {
                Log.Debug("Calling FreeLibrary on temporary library pointer {LibraryPointer}", libraryPointer);
                Native.Kernel32.NativeMethods.FreeLibrary(libraryPointer);
            }

            return valid;
        }

        /// <summary>
        /// Checks if the Chroma SDK is enabled in the Windows registry.
        /// </summary>
        /// <returns><c>true</c> if the SDK is enabled in the registry; otherwise, <c>false</c>.</returns>
        /// <remarks>
        /// On unsupported platforms or if the registry cannot be read, this method will fallback to <c>true</c>
        /// to maximize compatibility.
        /// </remarks>
        private static bool IsSdkEnabledInRegistry()
        {
            try
            {
                if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                {
                    using (var key = Registry.LocalMachine.OpenSubKey(SdkRegKeyPath))
                    {
                        if (key == null)
                        {
                            return false;
                        }

                        var value = key.GetValue("Enable");

                        if (value is null)
                        {
                            Log.Debug("'Enable' under main registry subkey was NULL, trying 'Apps' subkey");

                            using (var appsSubKey = key.OpenSubKey(AppsSubKeyPath))
                            {
                                if (appsSubKey != null)
                                {
                                    value = appsSubKey.GetValue("Enable");
                                }
                            }
                        }

                        if (value is int i)
                        {
                            return i == 1;
                        }

                        Log.Warn(
                            "Chroma SDK has changed registry setting format. Please update Colore to latest version.");

                        Log.DebugFormat("New Enabled type: {0}", value?.GetType().ToString() ?? "<NULL>");

                        return true;
                    }
                }

                Log.Debug("Not running on Windows, treating 'SDK exists in registry' as true");
                return true;
            }
            catch (PlatformNotSupportedException ex)
            {
                Log.WarnException("Assuming SDK is available due to registry not being available on this system", ex);
                return true;
            }
            catch (SecurityException ex)
            {
                // If we can't access the registry, best to just assume
                // it is enabled.
                Log.WarnException("System raised SecurityException during read of SDK enable flag in registry.", ex);
                return true;
            }
            catch (UnauthorizedAccessException ex)
            {
                // If we can't access the registry, best to just assume
                // it is enabled.
                Log.WarnException("Not authorized to read registry for SDK enable flag.", ex);
                return true;
            }
        }
    }
}


text:
type: post102
title:  Overview
categories: XAP102ADM
parent: logging-overview.html
weight: 100
---

{{% ssummary %}}{{% /ssummary %}}

XAP makes logging calls by use of the Java TM platform's core logging facilities.
For more information on the JDK logging framework, please refer to the following online documentation: [Java Logging Overview](http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html).

# Configuration File

The logging configuration is initialized using a logging configuration file that is read at startup. This logging configuration file is in the standard `java.util.Properties` format. It configures custom versions of both `java.util.logging.Handler` and `java.util.logging.Formatter`, and default levels for frequently used loggers (categories).

The default configuration file is located under:

```bash
<XAP>/config/gs_logging.properties
```

# Logging Level

The [logging level](http://docs.oracle.com/javase/{{%version "java-version"%}}/docs/api/java/util/logging/Level.html) class defines a set of standard logging levels that can be used to control logging output. The logging level are ordered and are specified by ordered integers/constants.

{{% tip %}}
Enabling logging at a given level also enables logging at all higher levels.
{{% /tip %}}

The supported logging levels in descending order are:

- SEVERE (highest value)
- WARNING
- INFO
- CONFIG
- FINE
- FINER
- FINEST (lowest value)

In addition, there is a level **OFF** that can be used to turn off logging, and a level **ALL** that can be used to enable logging of all messages.

# Logging Categories

The following categories are available:

- Client
- Communication Protocol
- Class Loader
- Space (Caching, Query, Replication, etc)
- Runtime (GCC, GSM, etc)
- Security
- Web Container
- Mule Integration
- Management

For each category there are various logger name you should use when configuring the logging level. See `gs_logging.properties` file for exact logger name supported for each category. You can find all logger names also at the `com.gigaspaces.logger.Constants` class.

Here are the different modules , their logging names and their default logging level:

{{%tabs%}}
{{%tab "Client"%}}

{{%panel%}}
### Client General

```bash
com.gigaspaces.client.level = INFO
com.gigaspaces.client.cluster.liveness.level = INFO
```

GigaSpaces Client can be another component or application that connects to a GigaSpaces cluster.
Liveness check is a functionality that runs inside a GigaSpaces proxy (usually held by a client connecting to a space) to keep track of the cluster members.
Additional info about GigaSpaces proxy can be found [here]({{%currentadmurl%}}/tuning-proxy-connectivity.html)

### .Net API

The logging configuration file includes declarations of the loggers available at the bridge between .NET and Java.

```bash
com.gigaspaces.externaldatasource.dotnet.level = INFO
com.gigaspaces.bridge.dispatcher.level = INFO
com.gigaspaces.bridge.pbsexecuter.level = INFO
com.gigaspaces.dotnet.pu.level = INFO
```

### C++ API

The logging configuration file includes declarations of the C++ Java Proxy logger, which logs info such as exceptions and JVM creation.

```bash
com.gigaspaces.cpp.proxy.level = INFO
```

### OpenSpaces

```bash
org.openspaces.level = INFO
org.openspaces.pu.container.support.level = WARNING
org.openspaces.pu.container.jee.context.ProcessingUnitWebApplicationContext.level = WARNING
org.springframework.level = WARNING
```

OpenSpaces wraps the   core product with Spring which enables Spring configuration and Spring life cycle to XAP applications.

### Spring

```bash
com.gigaspaces.spring.level = INFO
```

GigaSpaces Spring application logging

### JMS API

```bash
com.gigaspaces.jms.level = INFO
```
{{%/panel%}}

{{% /tab %}}

{{% tab "Comunication Protocol" %}}
{{%panel%}}

```bash
com.gigaspaces.lrmi.nio.filters.SSLFilterFactory.level = INFO
com.gigaspaces.lrmi.level = INFO
com.gigaspaces.lrmi.stubcache.level = INFO
com.gigaspaces.lrmi.context.level = INFO
com.gigaspaces.lrmi.marshal.level = INFO
com.gigaspaces.lrmi.watchdog.level = INFO
com.gigaspaces.lrmi.classloading.level = INFO
com.gigaspaces.lrmi.slow_consumer.level = INFO
com.gigaspaces.lrmi.exporter.level = INFO
com.gigaspaces.lrmi.communication.transport.level = INFO
com.gigaspaces.lrmi.communication.manager.level = INFO
com.gigaspaces.lrmi.channel.transport.level = INFO
com.gigaspaces.lrmi.channel.manager.level = INFO
com.gigaspaces.lrmi.channel.protocol.level = INFO
```

{{%/panel%}}
{{% /tab %}}
{{%tab "  Class Loader "%}}
{{%panel%}}

```bash
com.gigaspaces.core.classloadercleaner.level = INFO
com.gigaspaces.core.classloadercache.level = INFO
```

XAP applications are running as part of a XAP runtime container and packaged using the structure described [here]({{%currentjavaurl%}}/the-processing-unit-structure-and-configuration.html).
Application jars/classes are packaged in different folders and some of the classes could be loaded as part of GigaSpaces container (GSC's). There are multiple class loaders involved when an application is running. More information about the class loaders and their hierarchy is [here]({{%currentjavaurl%}}/the-processing-unit-structure-and-configuration.html).
{{%/panel%}}
{{% /tab %}}
{{%tab "  Space "%}}
{{%panel%}}
### Space Core & Kernel

```bash
com.gigaspaces.core.engine.level = INFO
com.gigaspaces.core.lease.level = INFO
com.gigaspaces.core.types.level = INFO
com.gigaspaces.memory-manager.level = INFO
com.gigaspaces.kernel.level = CONFIG
com.gigaspaces.core.common.level = INFO
com.gigaspaces.core.config.level = CONFIG
com.gigaspaces.container.level = INFO
```

Core runtime for the space component of GigaSpaces, above loggers relate to this component and some aspects of this engine including, lease, object types and Memory Manager.

### Space Filters

```bash
com.gigaspaces.filters.level = INFO
```

Space filters are described here {{%currentjavanet "the-space-filters.html" %}}

### Space Persistency

```bash
com.gigaspaces.persistent.level = INFO
com.gigaspaces.persistent.shared_iterator.level = INFO
org.hibernate.level = WARNING
```

GigaSpaces persistence options are explained here {{%currentjavanet "space-persistency.html"%}}. One of the packaged External Data Source implementations uses Hibernate and it is called Hibernate External Data Source which is described [here]({{%currentjavaurl%}}/hibernate-space-persistency.html).

### Space Query

```bash
com.gigaspaces.query.level = INFO
```

GigaSpaces supports SQL queries on the data in space and logger corresponds to this functionality {{%currentjavanet "query-sql.html"%}}.

### Space LRU and Eviction

```bash
com.gigaspaces.cache.level = INFO
```

More information about LRU policy and Eviction behavior is [here](./lru-cache-policy.html)

### Space Notifications

```bash
com.gigaspaces.core.notify.level = INFO
```

Notifications are a mechanism that can be used to identify events related to space data (write, update, take, etc). Notifications are typically used with a [Notify Container]({{%currentjavaurl%}}/notify-container.html).
Another way notifications can be used is thru Session based messaging which is discussed [here]({{%currentjavaurl%}}/session-based-messaging-api.html).

### Space FIFO

```bash
com.gigaspaces.core.fifo.level = INFO
```

FIFO functionality is applicable for writes, reads and events (notifications) and discussed here {{%currentjavanet "fifo-support.html" %}}.

### Space Replication

```bash
com.gigaspaces.core.cluster.replication.level = INFO
com.gigaspaces.core.cluster.replication.redolog.level = INFO
com.gigaspaces.core.cluster.sync_replication.level = INFO
```

When a cluster topology is replicated, replication functionality is enabled. More information about topologies is [here](/product_overview/space-topologies.html).
Replication between spaces is one of the core features of GigaSpaces and is explained in detail [here](./replication.html).

### Space Partitioning

```bash
com.gigaspaces.core.cluster.partition.level = INFO
```

When cluster uses partitioned topology, data is partitioned across multiple instances of spaces. More information about topologies is [here](/product_overview/space-topologies.html).

### Space Active-Election

```bash
com.gigaspaces.cluster.active_election.level = INFO
```

When multiple instances (primary/backup(s)), Active Election process is used by cluster members to determine which member acts as a primary. Additional information regarding active election process is [here](./split-brain-and-primary-resolution.html).

### POJO

```bash
com.gigaspaces.pojo.level = INFO
```

Logger corresponding to GigaSpaces POJO support, more info [here]({{%currentjavaurl%}}/pojo-support.html).

### Space XA manager

```bash
com.gigaspaces.core.xa.level = INFO
```

Logger corresponding to XA Transaction manager running in the space, more information here {{%currentjavanet "transaction-management.html" %}}.

### Space Jini Dist. TX manager

```bash
com.sun.jini.mahalo.startup.level = INFO
com.sun.jini.mahalo.destroy.level = INFO
```

Logger for Jini Distributed Transaction manager, more information here {{%currentjavanet "transaction-management.html" %}}.

### SpaceURL, SpaceValidator, SpaceURLParser

```bash
com.gigaspaces.common.spaceurl.level = INFO
com.gigaspaces.common.spacefinder.level = INFO
com.gigaspaces.common.lookupfinder.level = INFO
com.gigaspaces.common.resourceloader.level = INFO
```

SpaceURL and its constraints are explained here {{%currentjavanet "the-space-configuration.html" %}}.
Other loggers are related to this and applicable when a client trying to create a space proxy using a URL.

### Space Multicast Notifications

```bash
com.gigaspaces.worker.multicast.level = INFO
```

Space notifications support multicast mode and this logger corresponds to this [functionality]({{%currentjavaurl%}}/session-based-messaging-api.html#AdvancedOptions)
{{%/panel%}}
{{% /tab %}}
{{%tab "  Runtime "%}}
{{%panel%}}
### Service Container - General

```bash
com.gigaspaces.grid.space.SpaceHandler.level = FINE
org.jini.rio.level = INFO
com.gigaspaces.start.level = CONFIG
com.gigaspaces.grid.space.GigaSpacesFaultDetectionHandler.level=INFO
com.gigaspaces.grid.lookup.level = INFO
com.gigaspaces.management.level = INFO
```

### Lookup Service

```bash
com.gigaspaces.core.lookupmanager.level = INFO
com.sun.jini.reggie.level = INFO
net.jini.discovery.LookupLocatorDiscovery.level = INFO
net.jini.lookup.ServiceDiscoveryManager.level = INFO
net.jini.discovery.LookupDiscovery.level = INFO
net.jini.lookup.JoinManager.level = INFO
net.jini.config.level = WARNING
com.sun.jini.start.service.starter.level = INFO
com.sun.jini.thread.TaskManager.level = INFO
```

Lookup Service is a runtime registry of GigaSpaces components. Each component registers itself to a LUS thereby providing visibility to other components. For e.g., a GSM discovers a GSC by looking at an entry in LUS and GSC discovers a GSM similarly. More information about LUS is [here](/product_overview/the-lookup-service.html).

### GSM

```bash
com.gigaspaces.grid.gsm.level = INFO
com.gigaspaces.grid.gsm.peer.level = INFO
com.gigaspaces.grid.gsm.feedback.level = INFO
com.gigaspaces.grid.gsm.provision.level = INFO
com.gigaspaces.grid.gsm.services.level = INFO
com.gigaspaces.grid.gsm.service-instances.level = INFO
com.gigaspaces.grid.gsm.selector.level = INFO
org.jini.rio.tools.webster.level = INFO
```

GSM manages the applications and maintains the SLA's of deployments. More information about GSM is [here](/product_overview/service-grid.html#gsm).

### GSC

```bash
com.gigaspaces.grid.gsc.level = INFO
com.gigaspaces.grid.gsc.GSCFaultDetectionHandler.level = INFO
com.gigaspaces.grid.gsm.GSMFaultDetectionHandler.level = INFO
org.openspaces.pu.container.servicegrid.PUFaultDetectionHandler.level = INFO
```

GSC is the runtime environment for GigaSpaces applications. More information about GSC's is [here](/product_overview/service-grid.html#gsc).

### ESM

```bash
org.openspaces.grid.esm.level = INFO
```

Elastic Service Manager (ESM) is an implementation of the Elastic Middleware Services. It is built on-top of the existing administrative API exposed by the GigaSpaces components. See [The Elastic Service Manager]({{%currentjavaurl%}}/elastic-processing-unit.html) page for more details.

### GSA

```bash
com.gigaspaces.grid.gsa.level = INFO
```

The GigaSpaces Agent (GSA) acts as a process manager that can spawn and manage Service Grid processes (Operating System level processes) such as The GigaSpaces Manager (GSM), The GigaSpaces Container (GSC), and Lookup Service (LUS). More information regarding GSA can be found [here](/product_overview/service-grid.html#gsa).
{{%/panel%}}
{{% /tab %}}
{{%tab "  Security "%}}
{{%panel%}}

```bash
com.gigaspaces.security.level = INFO
```

Logger corresponding to security of GigaSpaces components. This includes configuration and runtime execution of security functionality. More information regarding GigaSpaces security is [here]({{%currentsecurl%}}/security.html).
{{%/panel%}}
{{% /tab %}}
{{%tab "  Web Container "%}}
{{%panel%}}
Any web application default logging level (logger name for them is web.`[processing unit name].[instance id]`)

```bash
web.level = INFO
org.mortbay.level = WARNING
```

Web application support in XAP is provided using a Jetty container. These loggers correspond to Web Container. More information about GigaSpaces Web Application support is [here]({{%currentjavaurl%}}/web-jetty-processing-unit-container.html).
{{%/panel%}}
{{% /tab %}}
{{%tab "  Mule Integration "%}}
{{%panel%}}

```bash
org.mule.level = WARNING
org.mule.MuleServer.level = INFO
org.mule.RegistryContext.level = INFO
org.openspaces.esb.mule.level = WARNING
```

These loggers correspond to Mule integration. More information about Mule integration is here, [Mule ESB]({{%currentjavaurl%}}/mule-esb.html) and [Mule Processing Unit]({{%currentjavaurl%}}/mule-processing-unit.html)
{{%/panel%}}
{{% /tab %}}

{{%tab "  Management "%}}
{{%panel%}}
For GUI, browser, cluster view, JMX logging:

```bash
com.gigaspaces.admin.level = INFO
com.gigaspaces.admin.ui.level = INFO
com.gigaspaces.admin.ui.cluster.view.level = INFO
com.gigaspaces.admin.ui.spacebrowser.level = INFO
com.gigaspaces.admin.cli.level = INFO
com.gigaspaces.jmx.level = INFO
```

Loggers corresponding to XAPs Management Console/UI. Additional information regarding UI can be found [here]({{%currentadmurl%}}/gigaspaces-management-center.html).
{{%/panel%}}
{{% /tab %}}

{{%tab " Persistence"%}}

{{%panel%}}
For Persistence:

```bash
com.gigaspaces.persistent.level = INFO
com.gigaspaces.persistent.shared_iterator.level = INFO
```
{{%/panel%}}
{{% /tab %}}

{{% /tabs %}}

# Overriding the Default Configuration

The configuration defined in the `gs_logging.properties` file may be overridden by either using system properties or by providing an external configuration file with overrides. This external configuration file should be located in the classpath under:

```bash
/config/gs_ext_logging.properties
```

Any configuration that you wish to override in `gs_logging.properties` file, should appear in `gs_ext_logging.properties` with its new value. The same applies for system properties, e.g.

```bash
-Dcom.gigaspaces.exceptions.level=WARNING
```

{{% info "Defining System Properties when Starting GSCs, GSMs and other runtime components "%}}
The recommended way to define system properties when starting service grid components is to wrap the original script, e.g. `gsc.sh(bat)` with a wrapper script which include the EXT_JAVA_OPTIONS variable. The `setenv.sh(bat)` script which is used by these components will pick these options automatically and use them as JVM arguments.
{{% /info %}}

# Overriding the Configuration File

Your own configuration file may also be used instead of the platform's default. This is done by setting the configuration file location using a system property:

```bash
-Djava.util.logging.config.file=myfile.properties
```

GigaSpaces scripts rely on the exported environment variable `GS_LOGGING_CONFIG_FILE` (declared in `<GigaSpaces>/bin/setenv script`). The preferred way to apply your override file is to use a wrapper script: export the new setting of this variable and call the original script. This ensures that when `setenv.sh(bat)` is called from within the platform's scripts, it will pick up the override.

```bash
# unix

export GS_LOGGING_CONFIG_FILE=myfile.properties
./gsc.sh
```

Provided that your application initializes the logging facility via the Logging API (e.g. `LogManager.readConfiguration(InputStream ins)`), you may wish to disable the GigaSpaces configuration altogether. Once disabled, your Java logging settings will take place. This is done with the following system property:

```bash
-Dcom.gs.logging.disabled=true
```

# Troubleshooting

To troubleshoot and detect which logging properties file was loaded and from which location, set the following system property to **true**. This property already exists in the scripts (for convenience) and by default is set to **false**.

```bash
-Dcom.gs.logging.debug=true
```

# Handlers

GigaSpaces out of the box configures logging with two log Handlers,

- `java.util.logging.ConsoleHandler`: A simple handler for writing formatted output to System.err (level is set to ALL)
- `com.gigaspaces.logger.RollingFileHandler`: A handler that writes formatted output to a file that rolls over if a certain policy is triggered. see [Managing Log Files](./logging-managing-files.html)

Java util logging supports other handlers. MemoryHandler, SocketHandler or any other handler can be used instead of the above. More information about handlers is [here](http://docs.oracle.com/javase/{{%version "java-version"%}}/docs/technotes/guides/logging/). You can also use one of the [open source logging frameworks](http://java-source.net/open-source/logging) that support java.util.logging.

# Formatters

Formatters are in charge of formatting the log messages and adding meta data to them (date, time, level, etc).
GigaSpaces configures the logging `Handler`'s `formatter` property with a single `Formatter` implementation class:
`com.gigaspaces.logger.GSSimpleFormatter. This formatter class is based on the `java.util.logging.SimpleFormatter` class. see [Formatting Log Messages](./logging-formatting-messages.html) for more details.

# Exception visibility

GigaSpaces prints exception stack traces for messages with level `SEVERE` or higher.

```bash
com.gigaspaces.exceptions.level = SEVERE
```

Messages with lower levels with only be logged with the exception's `toString()` value. To force the logger to print the stack trace of exception with lower levels, such as Level `WARNING` for example, set the `com.gigaspaces.exceptions.level` property to `WARNING`.

Note that if the exception is a `java.lang.RuntimeException` its stack trace will always be logged, regardless of the level definition.

# Logging Management at Runtime

It is possible to change various logger level settings while the system is up and running without the need to restart it.
This can be very useful in production environments when the system needs to be troubleshooted, but at the same time cannot be restarted.

You can do so by connecting to the JMX Bean of the Java logging facility via JConsole for example.
You can start JConsole for a specific running GSC or GSM using the GigaSpaces Managment Center (`<GigaSpaces>\bin\gs-ui.sh(bat)`).
To change the logging level in JConsole do the following:

1. Traverse to the MBeans tab
1. Expand the `java.util.logging` tree node and locate the Logging tree node
1. Select the Operations tab
1. Type the logger's name and level for the arguments of the `setLoggerLevel()` method. For example, If you want to change `com.gigaspaces.exceptions.level` level to `WARNING`, use `setLoggerLevel(com.gigaspaces.exceptions, WARNING)`.

{{% include "/COM/jconsolejmapwarning.markdown" %}}

{{% info %}}
Note, you will need to use the logging level without the .level string e.g.: "com.gigaspaces.core.cluster.replication" and set value "FINE"
{{%/info%}}

The LoggingMXBean enables you to:

- Get the name of the log level associated with the specified logger
- Get the list of currently registered loggers
- Get the name of the parent for the specified logger
- Sets the specified logger to the specified new level


text:
import MySQLdb as mdb
import sys
import re

path='/var/www/test/tagging/tools/db/tags/'

wordsFile = open(path+'wordsBare.txt', 'w')

con = mdb.connect('localhost', 'webuser', 'tialof', 'taggingdb');

with con:

    cur = con.cursor(mdb.cursors.DictCursor)
    cur.execute("select words.sentence_id, words.id, (case words.split when 1 then concat(words.stem, '-', words.suffix) else words.text end) as word_text from words order by sentence_id, position")

    lastSentId = -1
    for i in range(cur.rowcount):
        row = cur.fetchone()
        if row['word_text']:
            if row['sentence_id'] <> lastSentId:
                if lastSentId <> -1:
                    wordsFile.write("\n")
                lastSentId = row['sentence_id']

            text = re.sub('\s+','-',row['word_text'])
            wordsFile.write(text+' ')

    wordsFile.write("\n")

wordsFile.close()


text:
<?php namespace nyx\auth\id\interfaces;

interface Identity
{
    /**
     * Returns the unique identifier of the Identity specific to its Provider.
     *
     * @return  string
     */
    public function getId() : string;

    /**
     * Returns the username/nickname/display name bound to the Identity.
     *
     * @return  string|null
     */
    public function getUsername() : ?string;

    /**
     * Returns the full name bound to the Identity.
     *
     * @return  string|null
     */
    public function getName() : ?string;

    /**
     * Returns the e-mail address bound to the Identity.
     *
     * @return  string|null
     */
    public function getEmail() : ?string;

    /**
     * Returns the avatar URI bound to the Identity.
     *
     * @return  string|null
     */
    public function getAvatar() : ?string;
}


text:
import {Component, NgModule} from '@angular/core';

@Component({
  selector: 'my-component',
  template: `
  <ng-template i18n-title title="Hello {{ name }}"></ng-template>
`
})
export class MyComponent {
  name = '';
}

@NgModule({declarations: [MyComponent]})
export class MyModule {
}


text:
package org.apache.ignite.internal.processors.cache.eviction.paged;

import java.util.concurrent.ThreadLocalRandom;
import javax.cache.Cache;
import javax.cache.configuration.Factory;
import javax.cache.integration.CacheLoaderException;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.CachePeekMode;
import org.apache.ignite.cache.CacheWriteSynchronizationMode;
import org.apache.ignite.cache.store.CacheStoreAdapter;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataPageEvictionMode;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.junit.Ignore;
import org.junit.Test;

/**
 *
 */
public class PageEvictionReadThroughTest extends PageEvictionAbstractTest {
    /** {@inheritDoc} */
    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
        return setEvictionMode(DataPageEvictionMode.RANDOM_LRU, super.getConfiguration(gridName));
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testEvictionWithReadThroughAtomicReplicated() throws Exception {
        testEvictionWithReadThrough(CacheAtomicityMode.ATOMIC, CacheMode.REPLICATED);
    }

    /**
     * @throws Exception If failed.
     */
    @Test
    public void testEvictionWithReadThroughTxReplicated() throws Exception {
        testEvictionWithReadThrough(CacheAtomicityMode.TRANSACTIONAL, CacheMode.REPLICATED);
    }

    /**
     * @throws Exception If failed.
     */
    @Ignore("https://issues.apache.org/jira/browse/IGNITE-8582,https://issues.apache.org/jira/browse/IGNITE-7956")
    @Test
    public void testEvictionWithReadThroughMvccTxReplicated() throws Exception {
        testEvictionWithReadThrough(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT, CacheMode.REPLICATED);
    }

    /**
     * @throws Exception If failed.
     */
    @Ignore("https://issues.apache.org/jira/browse/IGNITE-8582,https://issues.apache.org/jira/browse/IGNITE-7956")
    @Test
    public void testEvictionWithReadThroughMvccTxPartitioned() throws Exception {
        testEvictionWithReadThrough(CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT, CacheMode.PARTITIONED);
    }

    /**
     * @param atomicityMode Atomicity mode.
     * @param cacheMode Cache mode.
     * @throws Exception If failed.
     */
    private void testEvictionWithReadThrough(CacheAtomicityMode atomicityMode, CacheMode cacheMode) throws Exception {
        startGrid(0);

        CacheConfiguration<Object, Object> cfg = cacheConfig("evict-rebalance", null, cacheMode, atomicityMode,
            CacheWriteSynchronizationMode.PRIMARY_SYNC);
        cfg.setReadThrough(true);
        cfg.setCacheStoreFactory(new TestStoreFactory());

        IgniteCache<Object, Object> cache = ignite(0).getOrCreateCache(cfg);

        for (int i = 1; i <= ENTRIES; i++) {
            cache.get(i);

            if (i % (ENTRIES / 10) == 0)
                System.out.println(">>> Entries: " + i);
        }

        int size = cache.size(CachePeekMode.PRIMARY);

        System.out.println(">>> Resulting size: " + size);

        assertTrue(size > 0);

        assertTrue(size < ENTRIES);
    }

    /** {@inheritDoc} */
    @Override protected void afterTest() throws Exception {
        stopAllGrids();
    }

    /**
     *
     */
    private static class TestStoreFactory implements Factory<TestCacheStore> {
        /** {@inheritDoc} */
        @Override public TestCacheStore create() {
            return new TestCacheStore();
        }
    }

    /**
     *
     */
    private static class TestCacheStore extends CacheStoreAdapter<Object, Object> {
        /** {@inheritDoc} */
        @Override public Object load(Object key) throws CacheLoaderException {
            ThreadLocalRandom r = ThreadLocalRandom.current();

            if (r.nextInt() % 5 == 0)
                return new TestObject(PAGE_SIZE / 4 - 50 + r.nextInt(5000)); // Fragmented object.
            else
                return new TestObject(r.nextInt(PAGE_SIZE / 4 - 50)); // Fits in one page.
        }

        /** {@inheritDoc} */
        @Override public void write(Cache.Entry<?, ?> entry) {
            throw new UnsupportedOperationException();
        }

        /** {@inheritDoc} */
        @Override public void delete(Object key) {
            // No-op.
        }
    }
}


text:
module CouchRest
  module Model
    module Properties
      extend ActiveSupport::Concern

      included do
        class_attribute(:properties) unless self.respond_to?(:properties)
        class_attribute(:properties_by_name) unless self.respond_to?(:properties_by_name)
        self.properties ||= []
        self.properties_by_name ||= {}
      end

      # Provide an attribute hash ready to be sent to CouchDB but with
      # all the nil attributes removed.
      def as_couch_json
        super.delete_if{|k,v| v.nil?}
      end

      # Read the casted value of an attribute defined with a property.
      def read_attribute(property)
        self[find_property!(property).to_s]
      end

      # Store a casted value in the current instance of an attribute defined
      # with a property.
      def write_attribute(property, value)
        prop = find_property!(property)
        value = prop.cast(self, value)
        self[prop.name] = value
      end

      # Returns a hash of this object's attributes with a defined property.
      # This is effectively an accessor to the underlying CouchRest
      # attributes hash.
      def read_attributes
        @_attributes
      end
      alias :attributes :read_attributes

      # Takes a hash as argument, and applies the values by using writer
      # methods respecting protected properties.
      def write_attributes(hash)
        attrs = remove_protected_attributes(hash)
        directly_set_attributes(attrs)
        self
      end
      alias :attributes= :write_attributes

      # Takes the provided attribute hash and sets all properties, assuming
      # that the data is from a trusted source, such as the database.
      def write_all_attributes(attrs = {})
        directly_set_read_only_attributes(attrs)
        directly_set_attributes(attrs, true)
        self
      end

      protected

      def find_property(property)
        property.is_a?(Property) ? property : self.class.properties_by_name[property.to_s]
      end

      def find_property!(property)
        find_property(property) or
          raise ArgumentError, "Missing property definition for #{property.to_s}"
      end

      def write_attributes_for_initialization(attrs = {}, opts = {})
        apply_all_property_defaults
        if opts[:write_all_attributes]
          # Assume coming from a database, so we clear change information after
          write_all_attributes(attrs)
          clear_changes_information
        else
          # Not from a persisted source, clear the change data in advance and do
          # not set protected or read-only attributes.
          clear_changes_information
          write_attributes(attrs)
        end
      end

      # Apply each property's default value to the attributes. This should
      # only ever be called on initialization.
      def apply_all_property_defaults
        self.class.properties.each do |property|
          write_attribute(property, property.default_value)
        end
      end

      # Set all the attributes and return a hash with the attributes
      # that have not been accepted.
      def directly_set_attributes(hash, mass_assign = false)
        return if hash.nil?

        multi_parameter_attributes = []

        hash.reject do |key, value|
          if key.to_s.include?("(")
            multi_parameter_attributes << [ key, value ]
            false
          elsif self.respond_to?("#{key}=")
            self.send("#{key}=", value)
          elsif mass_assign || mass_assign_any_attribute
            self[key] = value
          end
        end

        # Handle attributes provided in an embedded object format, such
        # as a web-form.
        unless multi_parameter_attributes.empty?
          assign_multiparameter_attributes(multi_parameter_attributes, hash)
        end
      end

      def directly_set_read_only_attributes(hash)
        property_list = self.properties.map{|p| p.name}
        hash.each do |attribute_name, attribute_value|
          next if self.respond_to?("#{attribute_name}=")
          if property_list.include?(attribute_name)
            write_attribute(attribute_name, hash.delete(attribute_name))
          end
        end
      end

      def assign_multiparameter_attributes(pairs, hash)
        execute_callstack_for_multiparameter_attributes(
          extract_callstack_for_multiparameter_attributes(pairs), hash
        )
      end
      def execute_callstack_for_multiparameter_attributes(callstack, hash)
        callstack.each do |name, values_with_empty_parameters|
          if self.respond_to?("#{name}=")
            casted_attrib = send("#{name}=", values_with_empty_parameters)
            unless casted_attrib.is_a?(Hash)
              hash.reject { |key, value| key.include?(name.to_s)}
            end
          end
        end
        hash
      end

      def extract_callstack_for_multiparameter_attributes(pairs)
        attributes = { }

        pairs.each do |pair|
          multiparameter_name, value = pair
          attribute_name = multiparameter_name.split("(").first
          attributes[attribute_name] = {} unless attributes.include?(attribute_name)
          attributes[attribute_name][find_parameter_name(multiparameter_name)] ||= value
        end
        attributes
      end

      def find_parameter_name(multiparameter_name)
        position = multiparameter_name.scan(/\(([0-9]*).*\)/).first.first.to_i
        {1 => :year, 2 => :month, 3 => :day, 4 => :hour, 5 => :min, 6 => :sec}[position]
      end

      module ClassMethods

        def property(name, *options, &block)
          raise "Invalid property definition, '#{name}' already used for CouchRest Model type field" if name.to_s == model_type_key.to_s && CouchRest::Model::Base >= self
          opts = { }
          type = options.shift
          if type.class != Hash
            opts[:type] = type
            opts.merge!(options.shift || {})
          else
            opts.update(type)
          end
          existing_property = self.properties.find{|p| p.name == name.to_s}
          if existing_property.nil? || (existing_property.default != opts[:default])
            define_property(name, opts, &block)
          end
        end

        # Automatically set <tt>updated_at</tt> and <tt>created_at</tt> fields
        # on the document whenever saving occurs.
        #
        # These properties are casted as Time objects, so they should always
        # be set to UTC.
        def timestamps!
          property(:updated_at, Time, :read_only => true, :protected => true, :auto_validation => false)
          property(:created_at, Time, :read_only => true, :protected => true, :auto_validation => false)

          set_callback :save, :before do |object|
            write_attribute('updated_at', Time.now)
            write_attribute('created_at', Time.now) if object.new?
          end
        end

        protected

          # This is not a thread safe operation, if you have to set new properties at runtime
          # make sure a mutex is used.
          def define_property(name, options = {}, &block)
            property = Property.new(name, options, &block)
            create_property_getter(property)
            create_property_setter(property) unless property.read_only == true

            if property.type.respond_to?(:validates_casted_model)
              validates_casted_model property.name
            end

            # Dirty!
            create_dirty_property_methods(property)

            properties << property
            properties_by_name[property.to_s] = property
            property
          end

          # defines the getter for the property (and optional aliases)
          def create_property_getter(property)
            define_method(property.name) do
              read_attribute(property.name)
            end

            if ['boolean', TrueClass.to_s.downcase].include?(property.type.to_s.downcase)
              define_method("#{property.name}?") do
                value = read_attribute(property.name)
                !(value.nil? || value == false)
              end
            end

            if property.alias
              alias_method(property.alias, property.name.to_sym)
            end
          end

          # defines the setter for the property (and optional aliases)
          def create_property_setter(property)
            name = property.name

            define_method("#{name}=") do |value|
              write_attribute(name, value)
            end

            if property.alias
              alias_method "#{property.alias}=", "#{name}="
            end
          end

      end # module ClassMethods

    end
  end
end


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Erysiphe mali Duby, 1830

### Remarks
null


text:
global.should = require('should').noConflict();
should.extend();


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/sgml/loosedtd.html">

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Reporting bugs</title>
<meta name="author" content="Wincent Colaiuta">
<meta name="author-email" content="win@wincent.com">
<meta name="copyright" content="Copyright 2007-2010 Wincent Coliauta">
<meta name="description" content="">
<link href="../css/base.css" rel="stylesheet" media="all" type="text/css">

Hextrapolate Help

Index

Reporting bugs

Before submitting a bug report please try the troubleshooting tips. If you think you've discovered a bug there are two avenues for submitting a bug report:

Submit a bug report via the web at bugs.wincent.com

Submit a bug report via email to bugs@wincent.com

Submitting a bug report via the web is strongly recommended because you can use the web interface to perform a search before submitting (it may be that someone else has already reported the issue).

When submitting a bug report, please follow the guidelines for how to file a good bug report; submitting a detailed, high-quality bug report will help me to fix the issue.

See also

troubleshooting tips

troubleshooting


text:
package org.apache.hadoop.hive.serde2.objectinspector.primitive;

import org.apache.hadoop.hive.serde2.objectinspector.ConstantObjectInspector;

import org.apache.hadoop.io.BooleanWritable;

/**
 * A WritableConstantBooleanObjectInspector is a WritableBooleanObjectInspector
 * that implements ConstantObjectInspector.
 */
public class WritableConstantBooleanObjectInspector extends
    WritableBooleanObjectInspector implements
    ConstantObjectInspector {

  private BooleanWritable value;

  protected WritableConstantBooleanObjectInspector() {
    super();
  }
  WritableConstantBooleanObjectInspector(BooleanWritable value) {
    super();
    this.value = value;
  }

  @Override
  public BooleanWritable getWritableConstantValue() {
    return value;
  }
}