text:
.. raw:: html

urllib3 is a powerful, *user-friendly* HTTP client for Python. Much of the
Python ecosystem already uses urllib3 and you should too.
urllib3 brings many critical features that are missing from the Python
standard libraries:

- Thread safety.
- Connection pooling.
- Client-side SSL/TLS verification.
- File uploads with multipart encoding.
- Helpers for retrying requests and dealing with HTTP redirects.
- Support for gzip, deflate, and brotli encoding.
- Proxy support for HTTP and SOCKS.
- 100% test coverage.

urllib3 is powerful and easy to use:

.. code-block:: pycon

    >>> import urllib3
    >>> http = urllib3.PoolManager()
    >>> resp = http.request("GET", "http://httpbin.org/robots.txt")
    >>> resp.status
    200
    >>> resp.data
    b"User-agent: *\nDisallow: /deny\n"

Installing
----------

urllib3 can be installed with `pip <https://pip.pypa.io>`_:

.. code-block:: bash

    $ python -m pip install urllib3

Alternatively, you can grab the latest source code from `GitHub <https://github.com/urllib3/urllib3>`_:

.. code-block:: bash

    $ git clone git://github.com/urllib3/urllib3.git
    $ python setup.py install

Documentation
-------------

urllib3 has usage and reference documentation at `urllib3.readthedocs.io <https://urllib3.readthedocs.io>`_.

Community
---------

urllib3 has a `community Discord channel <https://discord.gg/urllib3>`_ for asking questions and
collaborating with other contributors. Drop by and say hello 👋

Contributing
------------

urllib3 happily accepts contributions. Please see our
`contributing documentation <https://urllib3.readthedocs.io/en/latest/contributing.html>`_
for some tips on getting started.

Security Disclosures
--------------------

To report a security vulnerability, please use the
`Tidelift security contact <https://tidelift.com/security>`_.
Tidelift will coordinate the fix and disclosure with maintainers.

Maintainers
-----------

- `@sethmlarson <https://github.com/sethmlarson>`__ (Seth M. Larson)
- `@pquentin <https://github.com/pquentin>`__ (Quentin Pradet)
- `@theacodes <https://github.com/theacodes>`__ (Thea Flowers)
- `@haikuginger <https://github.com/haikuginger>`__ (Jess Shapiro)
- `@lukasa <https://github.com/lukasa>`__ (Cory Benfield)
- `@sigmavirus24 <https://github.com/sigmavirus24>`__ (Ian Stapleton Cordasco)
- `@shazow <https://github.com/shazow>`__ (Andrey Petrov)

👋

Sponsorship
-----------

If your company benefits from this library, please consider `sponsoring its
development <https://urllib3.readthedocs.io/en/latest/sponsors.html>`_.

For Enterprise
--------------

.. |tideliftlogo| image:: https://nedbatchelder.com/pix/Tidelift_Logos_RGB_Tidelift_Shorthand_On-White_small.png
   :width: 75
   :alt: Tidelift

.. list-table::
   :widths: 10 100

   * - |tideliftlogo|
     - Professional support for urllib3 is available as part of the `Tidelift
       Subscription`_.  Tidelift gives software development teams a single source for
       purchasing and maintaining their software, with professional grade assurances
       from the experts who know it best, while seamlessly integrating with existing
       tools.

.. _Tidelift Subscription: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=readme


text:
/**
 * Created Jun 16, 2008
 */
package com.crawljax.plugins.testcasegenerator;

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

/**
 * @author mesbah
 * @version $Id: TestMethod.java 6234 2009-12-18 13:46:37Z mesbah $
 */
public class TestMethod {
	private String methodName;
	private List<TestMethodEvent> eventList;

	/**
	*
	*/
	public TestMethod() {
		super();
		eventList = new ArrayList<TestMethodEvent>();
	}

	/**
	 * @param methodName
	 *            the method name.
	 * @param eventList
	 *            the list of events.
	 */
	public TestMethod(String methodName, List<TestMethodEvent> eventList) {
		super();
		this.methodName = methodName;
		this.eventList = eventList;
	}

	/**
	 * @return the methodName
	 */
	public String getMethodName() {
		return methodName;
	}

	/**
	 * @param methodName
	 *            the methodName to set
	 */
	public void setMethodName(String methodName) {
		this.methodName = methodName;
	}

	/**
	 * @return the eventList
	 */
	public List<TestMethodEvent> getEventList() {
		return eventList;
	}

	public void addMethodEvent(TestMethodEvent methodEvent) {
		eventList.add(methodEvent);
	}

	/**
	 * @param eventList
	 *            the eventList to set
	 */
	public void setEventList(List<TestMethodEvent> eventList) {
		this.eventList = eventList;
	}
}

redpajama_set_name: RedPajamaGithub


text:
DGVocabulary = function () {

};

DGVocabulary._MSG = {};
DGVocabulary._MSG["alert_select_row"] = "U hebt een of meer rijen te selecteren voor de uitvoering van deze operatie!";
DGVocabulary._MSG["alert_perform_operation"] = "Weet u zeker dat u wilt verrichten deze operatie?";
DGVocabulary._MSG["alert_perform_operation_delete"] = "Ben je zeker dat je wilt uitvoeren operatie verwijderen?";
DGVocabulary._MSG["alert_perform_operation_clone"] = "Ben je zeker dat je wilt uitvoeren kloon operatie?";
DGVocabulary._MSG["alert_blocked_in_demo"] = "Deze operatie is geblokkeerd in de demo versie!";
DGVocabulary._MSG["cookies_required"] = "Deze operatie vereist dat uw browser cookies accepteert! Aangeraden over cookies accepteren.";
DGVocabulary._MSG["extension_not_allowed"] = "Bestanden met geselecteerde extensie zijn niet toegestaan.";
DGVocabulary._MSG["need_upload_file"] = "U moet uploaden of een afbeelding voordat update! Klik op Upload link.";
DGVocabulary._MSG["please_reenter"] = "Probeer opnieuw in te voeren!";
DGVocabulary._MSG["upload_file_size_alert"] = "Het bestand dat u probeert te uploaden is groter dan de maximum toegestane grootte: ";


text:
var Aria = require('../../Aria');

var ariaUtilsFunction = require('../Function');
var nop = ariaUtilsFunction.empty;

////////////////////////////////////////////////////////////////////////////////
// Helpers
////////////////////////////////////////////////////////////////////////////////

function assignPropertyWithDefault(destination, source, property, defaultValue) {
    var value = source[property];

    if (value == null) {
        value = defaultValue;
    }

    destination[property] = value;

    return value;
}

////////////////////////////////////////////////////////////////////////////////
// Model: Debouncer
////////////////////////////////////////////////////////////////////////////////

 module.exports = Aria.classDefinition({
    $classpath : 'aria.utils.async.Debouncer',

    $constructor : function (spec) {
        this.delay = spec.delay;
        this.state = spec.state;

        assignPropertyWithDefault(this, spec, 'onStart', nop);
        assignPropertyWithDefault(this, spec, 'onEnd', nop);

        this._currentTimeout = null;
    },
    $destructor : function () {
        this._stopWaitingForTimeout();
    },

    $prototype : {
        run : function () {
            var state = this.state;
            var onStart = this.onStart;

            if (!this._isWaitingForTimeout()) {
                onStart(state);
            }

            this._stopWaitingForTimeout();
            this._startWaitingForTimeout();
        },

        _isWaitingForTimeout : function () {
            return this._currentTimeout != null;
        },

        _stopWaitingForTimeout : function () {
            if (this._isWaitingForTimeout()) {
                clearTimeout(this._currentTimeout);
                this._currentTimeout = null;
            }
        },

        _startWaitingForTimeout : function () {
            this._currentTimeout = setTimeout(
                ariaUtilsFunction.bind(this._afterTimeout, this),
                this.delay
            );
        },

        _afterTimeout : function () {
            var state = this.state;
            var onEnd = this.onEnd;

            this._currentTimeout = null;
            onEnd(state);
        }
    }
});


text:
package ch.epfl.data.squall.ewh.algorithms;

import java.util.List;

import ch.epfl.data.squall.ewh.algorithms.optimality.WeightFunction;
import ch.epfl.data.squall.ewh.data_structures.JoinMatrix;
import ch.epfl.data.squall.ewh.data_structures.Region;

public interface TilingAlgorithm {

    // sb is for collecting stats
    public List<Region> partition(JoinMatrix joinMatrix, StringBuilder sb);

    // returns null for those algorithm which do not use it (e.g. Okcan)
    public WeightPrecomputation getPrecomputation();

    // is always specified; that's what algorithm's optimality will be tested
    // against
    // not necessarily what it opimizes for (e.g. Okcan)
    public WeightFunction getWeightFunction();

    public double getWeight(Region region);

    public String getShortName();

}


text:
package org.uberfire.client.workbench;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import com.google.gwt.animation.client.Animation;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.HeaderPanel;
import com.google.gwt.user.client.ui.RequiresResize;
import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.errai.common.client.dom.DOMUtil;
import org.jboss.errai.common.client.dom.Div;
import org.jboss.errai.common.client.dom.HTMLElement;
import org.jboss.errai.common.client.ui.ElementWrapperWidget;
import org.jboss.errai.ioc.client.container.SyncBeanDef;
import org.jboss.errai.ioc.client.container.SyncBeanManager;
import org.uberfire.client.util.Layouts;
import org.uberfire.client.workbench.docks.UberfireDocksContainer;
import org.uberfire.client.workbench.widgets.dnd.WorkbenchDragAndDropManager;
import org.uberfire.client.workbench.widgets.dnd.WorkbenchPickupDragController;
import org.uberfire.mvp.Command;
import org.uberfire.workbench.model.PerspectiveDefinition;

import static java.util.Collections.sort;

/**
 * The default layout implementation.
 */
@ApplicationScoped
public class WorkbenchLayoutImpl implements WorkbenchLayout {

    public static final String UF_MAXIMIZED_PANEL = "uf-maximized-panel";

    /**
     * Holder for style information that was modified in order to maximize a panel.
     */

    private static final int MAXIMIZED_PANEL_Z_INDEX = 100;
    /**
     * Dock Layout panel: in center root perspective and also (if available) with east west south docks
     */
    private final DockLayoutPanel rootContainer = new DockLayoutPanel(Unit.PX);
    /**
     * The panel within which the current perspective's root view resides. This panel lasts the lifetime of the app; it's
     * cleared and repopulated with the new perspective's root view each time
     * {@link org.uberfire.client.workbench.PanelManager#setPerspective(PerspectiveDefinition)} gets called.
     */
    private final SimpleLayoutPanel perspectiveRootContainer = new SimpleLayoutPanel();
    private final Map<Widget, OriginalStyleInfo> maximizedWidgetOriginalStyles = new HashMap<Widget, OriginalStyleInfo>();
    private SyncBeanManager iocManager;
    /**
     * Top-level widget of the whole workbench layout. This panel contains the nested container panels for headers,
     * footers, and the current perspective. During a normal startup of UberFire, this panel would be added directly to
     * the RootLayoutPanel.
     */
    private HeaderPanel root;
    /**
     * The panel within which the current perspective's header widgets reside. This panel lasts the lifetime of the app;
     * it's cleared and repopulated with the new perspective's root view each time
     * {@link #setHeaderContents(java.util.List)} gets called.
     */
    private Div headerPanel;
    /**
     * The panel within which the current perspective's footer widgets reside. This panel lasts the lifetime of the app;
     * it's cleared and repopulated with the new perspective's root view each time
     * {@link #setFooterContents(java.util.List)} gets called. The actual panel that's used for this is specified by the
     * concrete subclass's constructor.
     */
    private Div footerPanel;
    private WorkbenchDragAndDropManager dndManager;
    /**
     * An abstraction for DockLayoutPanel used by Uberfire Docks.
     */
    private UberfireDocksContainer uberfireDocksContainer;
    /**
     * We read the drag boundary panel out of this, and sandwich it between the root panel and the perspective container panel.
     */
    private WorkbenchPickupDragController dragController;

    public WorkbenchLayoutImpl() {

    }

    @Inject
    public WorkbenchLayoutImpl(SyncBeanManager iocManager,
                               HeaderPanel root,
                               WorkbenchDragAndDropManager dndManager,
                               UberfireDocksContainer uberfireDocksContainer,
                               WorkbenchPickupDragController dragController,
                               Div headerPanel,
                               Div footerPanel) {

        this.iocManager = iocManager;
        this.root = root;
        this.dndManager = dndManager;
        this.uberfireDocksContainer = uberfireDocksContainer;
        this.dragController = dragController;
        this.headerPanel = headerPanel;
        this.footerPanel = footerPanel;
    }

    @PostConstruct
    private void init() {
        perspectiveRootContainer.ensureDebugId("perspectiveRootContainer");
        headerPanel.setId("workbenchHeaderPanel");
        footerPanel.setId("workbenchFooterPanel");
        dragController.getBoundaryPanel().ensureDebugId("workbenchDragBoundary");
        root.addStyleName("uf-workbench-layout");
    }

    @Override
    public HeaderPanel getRoot() {
        return root;
    }

    @Override
    public HasWidgets getPerspectiveContainer() {
        return perspectiveRootContainer;
    }

    void setHeaderContents(List<Header> headers) {
        DOMUtil.removeAllChildren(headerPanel);
        if (!headers.isEmpty()) {
            for (Header h : headers) {
                headerPanel.appendChild(h.getElement());
            }
            root.setHeaderWidget(createWidgetFrom(headerPanel));
        }
    }

    void setFooterContents(List<Footer> footers) {
        DOMUtil.removeAllChildren(footerPanel);
        if (!footers.isEmpty()) {
            for (Footer f : footers) {
                footerPanel.appendChild(f.getElement());
            }
            root.setFooterWidget(createWidgetFrom(footerPanel));
        }
    }

    ElementWrapperWidget<?> createWidgetFrom(HTMLElement h) {
        return ElementWrapperWidget.getWidget(h);
    }

    @Override
    public void onBootstrap() {
        dndManager.unregisterDropControllers();

        AbsolutePanel dragBoundary = dragController.getBoundaryPanel();
        dragBoundary.add(perspectiveRootContainer);

        setupDocksContainer();
        rootContainer.add(dragBoundary);

        Layouts.setToFillParent(perspectiveRootContainer);
        Layouts.setToFillParent(dragBoundary);
        Layouts.setToFillParent(rootContainer);

        root.setContentWidget(rootContainer);
    }

    private void setupDocksContainer() {
        uberfireDocksContainer.setup(rootContainer,
                                     () -> Scheduler.get().scheduleDeferred(() -> onResize()));
    }

    @Override
    public void onResize() {
        resizeTo(Window.getClientWidth(),
                 Window.getClientHeight());
    }

    @Override
    public void resizeTo(int width,
                         int height) {
        root.setPixelSize(width,
                          height);

        // The dragBoundary can't be a LayoutPanel, so it doesn't support ProvidesResize/RequiresResize.
        // We start the cascade of onResize() calls at its immediate child.
        perspectiveRootContainer.onResize();

        new Timer() {
            @Override
            public void run() {
                updateMaximizedPanelSizes();
            }
        }.schedule(5);
    }

    private void updateMaximizedPanelSizes() {
        for (Widget w : maximizedWidgetOriginalStyles.keySet()) {
            Style style = w.getElement().getStyle();
            style.setTop(perspectiveRootContainer.getAbsoluteTop(),
                         Unit.PX);
            style.setLeft(perspectiveRootContainer.getAbsoluteLeft(),
                          Unit.PX);
            style.setWidth(perspectiveRootContainer.getOffsetWidth(),
                           Unit.PX);
            style.setHeight(perspectiveRootContainer.getOffsetHeight(),
                            Unit.PX);

            if (w instanceof RequiresResize) {
                ((RequiresResize) w).onResize();
            }
        }
    }

    @Override
    public void maximize(final Widget w) {
        maximize(w,
                 null);
    }

    @Override
    public void maximize(final Widget w,
                         final Command callback) {
        if (maximizedWidgetOriginalStyles.get(w) != null) {
            return;
        }

        // this allows application-specified background colour, animation, borders, etc.
        w.addStyleName(UF_MAXIMIZED_PANEL);

        new ExpandAnimation(w,
                            maximizedWidgetOriginalStyles,
                            perspectiveRootContainer,
                            callback).run();
    }

    @Override
    public void unmaximize(final Widget w) {
        unmaximize(w,
                   null);
    }

    @Override
    public void unmaximize(final Widget w,
                           final Command callback) {
        w.removeStyleName(UF_MAXIMIZED_PANEL);

        new CollapseAnimation(w,
                              maximizedWidgetOriginalStyles,
                              callback).run();
    }

    @Override
    public void setMarginWidgets(boolean isStandaloneMode,
                                 Set<String> headersToKeep) {
        setHeaderContents(discoverMarginWidgets(isStandaloneMode,
                                                headersToKeep,
                                                Header.class));
        setFooterContents(discoverMarginWidgets(isStandaloneMode,
                                                headersToKeep,
                                                Footer.class));
    }

    private <T extends Orderable> List<T> discoverMarginWidgets(boolean isStandaloneMode,
                                                                Set<String> headersToKeep,
                                                                Class<T> marginType) {
        final Collection<SyncBeanDef<T>> headerBeans = iocManager.lookupBeans(marginType);
        final List<T> instances = new ArrayList<T>();
        for (final SyncBeanDef<T> headerBean : headerBeans) {
            if (!headerBean.isActivated()) {
                continue;
            }

            T instance = headerBean.getInstance();

            // for regular mode (not standalone) we add every header and footer widget;
            // for standalone mode, we only add the ones requested in the URL
            if ((!isStandaloneMode) || headersToKeep.contains(instance.getId())) {
                instances.add(instance);
            }
        }
        sort(instances,
             new Comparator<Orderable>() {
                 @Override
                 public int compare(final Orderable o1,
                                    final Orderable o2) {
                     if (o1.getOrder() < o2.getOrder()) {
                         return 1;
                     } else if (o1.getOrder() > o2.getOrder()) {
                         return -1;
                     } else {
                         return 0;
                     }
                 }
             });

        return instances;
    }

    protected Div getHeaderPanel() {
        return headerPanel;
    }

    protected Div getFooterPanel() {
        return footerPanel;
    }

    protected static abstract class AbstractResizeAnimation extends Animation {

        protected final Style style;
        protected final Widget w;
        protected final Map<Widget, OriginalStyleInfo> maximizedWidgetOriginalStyles;
        protected final Command onCompleteCallback;

        public AbstractResizeAnimation(final Widget w,
                                       final Map<Widget, OriginalStyleInfo> maximizedWidgetOriginalStyles,
                                       final Command onCompleteCallback) {
            this.w = w;
            this.maximizedWidgetOriginalStyles = maximizedWidgetOriginalStyles;
            this.onCompleteCallback = onCompleteCallback;
            style = w.getElement().getStyle();
        }

        @Override
        protected void onUpdate(double progress) {
            final double width = newTarget(w.getElement().getClientWidth(),
                                           getTargetWidth(),
                                           progress);
            style.setWidth(width,
                           Unit.PX);
            final double height = newTarget(w.getElement().getClientHeight(),
                                            getTargetHeight(),
                                            progress);
            style.setHeight(height,
                            Unit.PX);
            final double top = newTarget(w.getAbsoluteTop(),
                                         getTargetTop(),
                                         progress);
            style.setTop(top,
                         Unit.PX);
            final double left = newTarget(w.getAbsoluteLeft(),
                                          getTargetLeft(),
                                          progress);
            style.setLeft(left,
                          Unit.PX);
        }

        public abstract int getTargetWidth();

        public abstract int getTargetHeight();

        public abstract int getTargetTop();

        public abstract int getTargetLeft();

        public void run() {
            super.run(1000);
        }

        @Override
        protected void onComplete() {
            super.onComplete();
            if (onCompleteCallback != null) {
                onCompleteCallback.execute();
            }
        }

        private double newTarget(int current,
                                 int target,
                                 double progress) {
            return Math.round(current + ((target - current) * progress));
        }

        public void onResize() {
            if (w instanceof RequiresResize) {
                ((RequiresResize) w).onResize();
            }
        }
    }

    protected static class ExpandAnimation extends AbstractResizeAnimation {

        protected final SimpleLayoutPanel perspectiveRootContainer;

        public ExpandAnimation(
                final Widget w,
                final Map<Widget, OriginalStyleInfo> maximizedWidgetOriginalStyles,
                final SimpleLayoutPanel perspectiveRootContainer,
                final Command onCompleteCallback) {
            super(w,
                  maximizedWidgetOriginalStyles,
                  onCompleteCallback);
            this.perspectiveRootContainer = perspectiveRootContainer;
        }

        @Override
        protected void onStart() {
            maximizedWidgetOriginalStyles.put(w,
                                              new OriginalStyleInfo(w));
            style.setZIndex(MAXIMIZED_PANEL_Z_INDEX);
            style.setHeight(w.getElement().getClientHeight(),
                            Unit.PX);
            style.setWidth(w.getElement().getClientWidth(),
                           Unit.PX);
            style.setTop(w.getAbsoluteTop(),
                         Unit.PX);
            style.setLeft(w.getAbsoluteLeft(),
                          Unit.PX);
            style.setPosition(Position.FIXED);
        }

        @Override
        public int getTargetWidth() {
            return perspectiveRootContainer.getOffsetWidth();
        }

        @Override
        public int getTargetHeight() {
            return perspectiveRootContainer.getOffsetHeight();
        }

        @Override
        public int getTargetTop() {
            return perspectiveRootContainer.getAbsoluteTop();
        }

        @Override
        public int getTargetLeft() {
            return perspectiveRootContainer.getAbsoluteLeft();
        }

        @Override
        protected void onComplete() {
            super.onComplete();
            onResize();
        }
    }

    protected static class CollapseAnimation extends AbstractResizeAnimation {

        private final OriginalStyleInfo originalStyleInfo;

        public CollapseAnimation(final Widget w,
                                 final Map<Widget, OriginalStyleInfo> maximizedWidgetOriginalStyles,
                                 final Command onCompleteCallback) {
            super(w,
                  maximizedWidgetOriginalStyles,
                  onCompleteCallback);
            originalStyleInfo = maximizedWidgetOriginalStyles.remove(w);
        }

        @Override
        public int getTargetWidth() {
            return originalStyleInfo.getClientWidth();
        }

        @Override
        public int getTargetHeight() {
            return originalStyleInfo.getClientHeight();
        }

        @Override
        public int getTargetTop() {
            return originalStyleInfo.getAbsoluteTop();
        }

        @Override
        public int getTargetLeft() {
            return originalStyleInfo.getAbsoluteLeft();
        }

        @Override
        protected void onComplete() {
            originalStyleInfo.restore(w);
            onResize();
            if (onCompleteCallback != null) {
                onCompleteCallback.execute();
            }
        }
    }

    /**
     * Holder for style information that was modified in order to maximize a panel.
     */
    protected static class OriginalStyleInfo {

        private String position;
        private String top;
        private String left;
        private String width;
        private String height;
        private String zIndex;
        private int absoluteTop;
        private int absoluteLeft;
        private int clientHeight;
        private int clientWidth;

        public OriginalStyleInfo(final Widget w) {
            absoluteLeft = w.getAbsoluteLeft();
            absoluteTop = w.getAbsoluteTop();
            clientHeight = w.getElement().getClientHeight();
            clientWidth = w.getElement().getClientWidth();

            final Style style = w.getElement().getStyle();
            position = style.getPosition();
            top = style.getTop();
            left = style.getLeft();
            width = style.getWidth();
            height = style.getHeight();
            zIndex = style.getZIndex();
        }

        /**
         * Restores to {@code w} all style values to those most recently set on this instance.
         * @param w the widget to restore styles on.
         */
        public void restore(final Widget w) {
            final Style style = w.getElement().getStyle();
            style.setProperty("position",
                              position);
            style.setProperty("top",
                              top);
            style.setProperty("left",
                              left);
            style.setProperty("width",
                              width);
            style.setProperty("height",
                              height);
            style.setProperty("zIndex",
                              zIndex);
        }

        public int getAbsoluteTop() {
            return absoluteTop;
        }

        public int getAbsoluteLeft() {
            return absoluteLeft;
        }

        public int getClientHeight() {
            return clientHeight;
        }

        public int getClientWidth() {
            return clientWidth;
        }
    }
}


text:
{% extends 'layout.html' %}
{% from "_forms.html" import render_field %}

{% block content %}

Pick a domain to use. Make sure it ends in ".mmcbox.com". For example, you could use myname.mmcbox.com where "myname" is your name. This will be what people type in their address bar to get to your website.

If you'd like to use a full domain name, please contact accounts@mmcbox.com.

<form action="" method="post">
	{{ form.hidden_tag() }}
	{{ render_field(form.domain) }}
	<input type="submit" value="Create" class="btn primary" />
</form>
{% endblock %}


text:
//! \file gicorerecord.cpp
//! \brief 实现内核视图类 GiCoreView 的录制功能
// Copyright (c) 2004-2015, https://github.com/rhcad/vgcore, BSD License

#include "gicoreview.h"
#include "gicoreviewimpl.h"
#include <algorithm>

static const bool VG_PRETTY = false;

long GiCoreView::getRecordTick(bool forUndo, long curTick)
{
    MgRecordShapes* recorder = impl->recorder(forUndo);
    if (!recorder)
        return 0;
    long tick = recorder->getCurrentTick(curTick);
    long pauseTick = curTick - impl->startPauseTick;
    return isPaused() && tick > pauseTick ? tick - pauseTick : tick;
}

bool GiCoreView::startRecord(const char* path, long doc, bool forUndo,
                             long curTick, MgStringCallback* c)
{
    MgRecordShapes* p = new MgRecordShapes(path, MgShapeDoc::fromHandle(doc), forUndo, curTick);
    impl->setRecorder(forUndo, p);

    if (isPlaying() || forUndo) {
        return true;
    }

    if (!saveToFile(doc, p->getFileName(false, 0).c_str(), VG_PRETTY)) {
        return false;
    }

    if (c) {
        c->onGetString(p->getFileName(false, 0).c_str());
    }
    return true;
}

void GiCoreView::stopRecord(bool forUndo)
{
    impl->setRecorder(forUndo, NULL);
    if (!forUndo && impl->play.playing) {
        impl->play.playing->clear();
    }
}

bool GiCoreView::recordShapes(bool forUndo, long tick, long changeCount, long doc, long shapes)
{
    return recordShapes(forUndo, tick, changeCount, doc, shapes, NULL, NULL);
}

bool GiCoreView::recordShapes(bool forUndo, long tick, long changeCount, long doc,
                              long shapes, const mgvector<long>* exts, MgStringCallback* c)
{
    MgRecordShapes* recorder = impl->recorder(forUndo);
    int ret = 0;
    std::vector<MgShapes*> arr;
    int i;

    for (i = 0; i < (exts ? exts->count() : 0); i++) {
        MgShapes* p = MgShapes::fromHandle(exts->get(i));
        if (p) {
            arr.push_back(p);
        }
    }

    if (recorder && !recorder->isLoading() && !recorder->isPlaying()) {
        ret = recorder->recordStep(tick, changeCount, impl->changeCount,
                                   MgShapeDoc::fromHandle(doc),
                                   MgShapes::fromHandle(shapes), arr) ? 2 : 1;
        if (ret > 1 && c) {
            c->onGetString(recorder->getFileName(false, recorder->getFileCount() - 1).c_str());
        }
    } else {
        GiPlaying::releaseDoc(doc);
        GiPlaying::releaseShapes(shapes);
    }
    for (i = 0; i < (int)arr.size(); i++) {
        MgObject::release_pointer(arr[i]);
    }

    return ret > 0;
}

bool GiCoreView::restoreRecord(int type, const char* path, long doc, long changeCount,
                               int index, int count, int tick, long curTick)
{
    MgRecordShapes* recorder = impl->recorder(type == 0);
    if (recorder || !path)
        return false;

    recorder = new MgRecordShapes(path, MgShapeDoc::fromHandle(doc), type == 0, curTick);
    recorder->restore(index, count, tick, curTick);
    impl->setRecorder(type == 0, recorder);

    if (type == 0 && changeCount != 0) {
        if (!giAtomicCompareAndSwap(&impl->changeCount, changeCount, impl->changeCount)) {
            LOGE("Fail to set changeCount via giAtomicCompareAndSwap");
        }
    }

    return true;
}

bool GiCoreView::isUndoLoading() const
{
    return impl->recorder(true) && impl->recorder(true)->isLoading();
}

bool GiCoreView::canUndo() const
{
    return impl->recorder(true) && impl->recorder(true)->canUndo();
}

bool GiCoreView::canRedo() const
{
    return impl->recorder(true) && impl->recorder(true)->canRedo();
}

int GiCoreView::getRedoIndex() const
{
    return impl->recorder(true) ? impl->recorder(true)->getFileCount() : 0;
}

int GiCoreView::getRedoCount() const
{
    return impl->recorder(true) ? impl->recorder(true)->getMaxFileCount() : 0;
}

bool GiCoreView::undo(GiView* view)
{
    MgRecordShapes* recorder = impl->recorder(true);
    bool ret = false;
    long changeCount = impl->changeCount;

    if (recorder) {
        recorder->setLoading(true);
        ret = recorder->undo(impl->getShapeFactory(), impl->doc(), &changeCount);
        if (ret) {
            submitBackDoc(view, true);
            submitDynamicShapes(view);
            if (!giAtomicCompareAndSwap(&impl->changeCount, changeCount, impl->changeCount)) {
                LOGE("Fail to set changeCount via giAtomicCompareAndSwap");
            }
            recorder->resetDoc(MgShapeDoc::fromHandle(acquireFrontDoc()));
            impl->regenAll(true);
            impl->hideContextActions();
        }
        recorder->setLoading(false);
    }
    if (ret && impl->cmds()) {
        impl->getCmdSubject()->onDocLoaded(impl->motion(), true);
    }

    return ret;
}

bool GiCoreView::redo(GiView* view)
{
    MgRecordShapes* recorder = impl->recorder(true);
    bool ret = false;
    long changeCount = impl->changeCount;

    if (recorder) {
        recorder->setLoading(true);
        ret = recorder->redo(impl->getShapeFactory(), impl->doc(), &changeCount);
        if (ret) {
            submitBackDoc(view, true);
            submitDynamicShapes(view);
            if (!giAtomicCompareAndSwap(&impl->changeCount, changeCount, impl->changeCount)) {
                LOGE("Fail to set changeCount via giAtomicCompareAndSwap");
            }
            recorder->resetDoc(MgShapeDoc::fromHandle(acquireFrontDoc()));
            impl->regenAll(true);
            impl->hideContextActions();
        }
        recorder->setLoading(false);
    }
    if (ret && impl->cmds()) {
        impl->getCmdSubject()->onDocLoaded(impl->motion(), true);
    }

    return ret;
}

bool GiCoreView::isUndoRecording() const
{
    return !!impl->recorder(true);
}

bool GiCoreView::isRecording() const
{
    return impl->recorder(false) && !impl->recorder(false)->isPlaying();
}

bool GiCoreView::isPlaying() const
{
    return impl->recorder(false) && impl->recorder(false)->isPlaying();
}

int GiCoreView::getFrameIndex() const
{
    return impl->recorder(false) ? impl->recorder(false)->getFileCount() : -1;
}

long GiCoreView::getFrameTick()
{
    return impl->recorder(false) ? (long)impl->recorder(false)->getFileTick() : 0;
}

int GiCoreView::getFrameFlags()
{
    return impl->recorder(false) ? impl->recorder(false)->getFileFlags() : 0;
}

bool GiCoreView::isPaused() const
{
    return impl->startPauseTick != 0;
}

bool GiCoreView::onPause(long curTick)
{
    bool ret = giAtomicCompareAndSwap(&impl->startPauseTick, curTick, 0);
    if (!ret) {
        LOGE("Fail to set startPauseTick via giAtomicCompareAndSwap");
    }
    return ret;
}

bool GiCoreView::onResume(long curTick)
{
    long startPauseTick = impl->startPauseTick;

    if (startPauseTick != 0
        && giAtomicCompareAndSwap(&impl->startPauseTick, 0, startPauseTick)) {
        long ticks = curTick - startPauseTick;
        if (impl->recorder(true) && !impl->recorder(true)->onResume(ticks)) {
            LOGE("recorder(true)->onResume(%ld) fail", ticks);
            return false;
        }
        if (impl->recorder(false) && !impl->recorder(false)->onResume(ticks)) {
            LOGE("recorder(false)->onResume(%ld) fail", ticks);
            return false;
        }
        return true;
    } else if (startPauseTick) {
        LOGE("Fail to set startPauseTick via giAtomicCompareAndSwap");
    }

    return false;
}

// GiPlaying
//

struct GiPlaying::Impl {
    MgShapeDoc* frontDoc_;
    MgShapeDoc* backDoc;
    MgShapes*   front_;
    MgShapes*   back;
    int         tag;
    bool        doubleSided;
    volatile long stopping;

    Impl(int tag, bool doubleSided) : frontDoc_(NULL), backDoc(NULL)
        , front_(NULL), back(NULL), tag(tag), doubleSided(doubleSided), stopping(0) {}

    MgShapeDoc*& frontDoc() { return doubleSided ? frontDoc_ : backDoc; }
    MgShapes*& frontShapes() { return doubleSided ? front_ : back; }
};

GiPlaying* GiPlaying::create(MgCoreView* v, int tag, bool doubleSided)
{
    GiPlaying* p = new GiPlaying(tag, doubleSided);
    if (v && tag >= 0) {
        GiCoreViewData::fromHandle(v->viewDataHandle())->addPlaying(p);
    }
    return p;
}

void GiPlaying::release(MgCoreView* v)
{
    if (v) {
        GiCoreViewData::fromHandle(v->viewDataHandle())->removePlaying(this);
    }
    delete this;
}

GiPlaying::GiPlaying(int tag, bool doubleSided) : impl(new Impl(tag, doubleSided))
{
}

GiPlaying::~GiPlaying()
{
    clear();
    delete impl;
}

void GiPlaying::clear()
{
    MgObject::release_pointer(impl->frontDoc_);
    MgObject::release_pointer(impl->backDoc);
    MgObject::release_pointer(impl->front_);
    MgObject::release_pointer(impl->back);
}

int GiPlaying::getTag() const
{
    return impl->tag;
}

void GiPlaying::stop()
{
    giAtomicIncrement(&impl->stopping);
}

bool GiPlaying::isStopping() const
{
    return impl->stopping > 0;
}

long GiPlaying::acquireFrontDoc()
{
    if (!impl->frontDoc())
        return 0;
    impl->frontDoc()->addRef();
    return impl->frontDoc()->toHandle();
}

void GiPlaying::releaseDoc(long doc)
{
    MgShapeDoc* p = MgShapeDoc::fromHandle(doc);
    MgObject::release_pointer(p);
}

MgShapeDoc* GiPlaying::getBackDoc()
{
    if (!impl->backDoc) {
        impl->backDoc = MgShapeDoc::createDoc();
    }
    return impl->backDoc;
}

void GiPlaying::submitBackDoc()
{
    if (impl->doubleSided) {
        MgObject::release_pointer(impl->frontDoc_);
        if (impl->backDoc) {
            impl->frontDoc_ = impl->backDoc->shallowCopy();
        }
    }
}

long GiPlaying::acquireFrontShapes()
{
    if (!impl->frontShapes())
        return 0;
    impl->frontShapes()->addRef();
    return impl->frontShapes()->toHandle();
}

void GiPlaying::releaseShapes(long shapes)
{
    MgShapes* p = MgShapes::fromHandle(shapes);
    MgObject::release_pointer(p);
}

long GiPlaying::getBackShapesHandle(bool needClear)
{
    return getBackShapes(needClear)->toHandle();
}

MgShapes* GiPlaying::getBackShapes(bool needClear)
{
    if (needClear || !impl->back) {
        MgObject::release_pointer(impl->back);
        impl->back = MgShapes::create();
    } else {
        MgShapes* old = impl->back;
        impl->back = old->shallowCopy();
        MgObject::release_pointer(old);
    }
    return impl->back;
}

void GiPlaying::submitBackShapes()
{
    if (impl->doubleSided) {
        MgObject::release_pointer(impl->front_);
        impl->front_ = impl->back;
        impl->front_->addRef();
    }
}


text:
#ifndef BABYLON_MATERIALS_TEXTURES_CUBE_TEXTURE_H
#define BABYLON_MATERIALS_TEXTURES_CUBE_TEXTURE_H

#include <babylon/babylon_api.h>
#include <babylon/babylon_fwd.h>
#include <babylon/engines/constants.h>
#include <babylon/materials/textures/base_texture.h>

namespace BABYLON {

struct CubeTextureData;
FWD_CLASS_SPTR(CubeTexture)
FWD_STRUCT_SPTR(LoaderOptions)

/**
 * @brief Class for creating a cube texture.
 */
class BABYLON_SHARED_EXPORT CubeTexture : public BaseTexture {

public:
  template <typename... Ts>
  static CubeTexturePtr New(Ts&&... args)
  {
    auto texture = std::shared_ptr<CubeTexture>(new CubeTexture(std::forward<Ts>(args)...));
    texture->addToScene(texture);

    return texture;
  }
  ~CubeTexture() override; // = default

  /**
   * @brief Get the current class name of the texture useful for serialization or dynamic coding.
   * @returns "CubeTexture"
   */
  std::string getClassName() const;

  /**
   * @brief Update the url (and optional buffer) of this texture if url was null during
   * construction.
   * @param url the url of the texture
   * @param forcedExtension defines the extension to use
   * @param onLoad callback called when the texture is loaded  (defaults to null)
   * @param prefiltered Defines whether the updated texture is prefiltered or not
   */
  void updateURL(const std::string& url, const std::string& forcedExtension = "",
                 const std::function<void(const std::optional<CubeTextureData>& data)>& onLoad
                 = nullptr,
                 bool prefiltered = false);

  /**
   * @brief Delays loading of the cube texture.
   */
  void delayLoad(const std::string& forcedExtension = "") override;

  /**
   * @brief Returns the reflection texture matrix.
   * @returns the reflection texture matrix
   */
  Matrix* getReflectionTextureMatrix() override;

  /**
   * @brief Sets the reflection texture matrix.
   * @param value Reflection texture matrix
   */
  void setReflectionTextureMatrix(Matrix value);

  /**
   * @brief Makes a clone, or deep copy, of the cube texture.
   * @returns a new cube texture
   */
  CubeTexturePtr clone() const;

  /**
   * @brief Creates a cube texture from an array of image urls.
   * @param files defines an array of image urls
   * @param scene defines the hosting scene
   * @param noMipmap specifies if mip maps are not used
   * @returns a cube texture
   */
  static CubeTexturePtr CreateFromImages(const std::vector<std::string>& files, Scene* scene,
                                         bool noMipmap = false);

  /**
   * @brief Creates and return a texture created from prefilterd data by tools like IBL Baker or
   * Lys.
   * @param url defines the url of the prefiltered texture
   * @param scene defines the scene the texture is attached to
   * @param forcedExtension defines the extension of the file if different from the url
   * @param createPolynomials defines whether or not to create polynomial harmonics from the texture
   * data if necessary
   * @return the prefiltered texture
   */
  static CubeTexturePtr CreateFromPrefilteredData(const std::string& url, Scene* scene,
                                                  const std::string& forcedExtension = "",
                                                  bool createPolynomials             = true);

  /**
   * @brief Parses text to create a cube texture.
   * @param parsedTexture define the serialized text to read from
   * @param scene defines the hosting scene
   * @param rootUrl defines the root url of the cube texture
   * @returns a cube texture
   */
  static CubeTexturePtr Parse(const json& parsedTexture, Scene* scene, const std::string& rootUrl);

protected:
  /**
   * @brief Creates a cube texture to use with reflection for instance. It can be based upon dds or
   * six images as well as prefiltered data.
   * @param rootUrl defines the url of the texture or the root name of the six images
   * @param null defines the scene or engine the texture is attached to
   * @param extensions defines the suffixes add to the picture name in case six images are in use
   * like _px.jpg...
   * @param noMipmap defines if mipmaps should be created or not
   * @param files defines the six files to load for the different faces in that order: px, py, pz,
   * nx, ny, nz
   * @param onLoad defines a callback triggered at the end of the file load if no errors occurred
   * @param onError defines a callback triggered in case of error during load
   * @param format defines the internal format to use for the texture once loaded
   * @param prefiltered defines whether or not the texture is created from prefiltered data
   * @param forcedExtension defines the extensions to use (force a special type of file to load) in
   * case it is different from the file name
   * @param createPolynomials defines whether or not to create polynomial harmonics from the texture
   * data if necessary
   * @param lodScale defines the scale applied to environment texture. This manages the range of LOD
   * level used for IBL according to the roughness
   * @param lodOffset defines the offset applied to environment texture. This manages first LOD
   * level used for IBL according to the roughness
   * @param loaderOptions options to be passed to the loader
   * @return the cube texture
   */
  CubeTexture(
    const std::string& rootUrl, const std::variant<Scene*, ThinEngine*>& sceneOrEngine,
    const std::vector<std::string>& extensions = {}, bool noMipmap = false,
    std::vector<std::string> files                                                = {},
    const std::function<void(const std::optional<CubeTextureData>& data)>& onLoad = nullptr,
    const std::function<void(const std::string& message, const std::string& exception)>& onError
    = nullptr,
    unsigned int format = Constants::TEXTUREFORMAT_RGBA, bool prefiltered = false,
    const std::string& forcedExtension = "", bool createPolynomials = false, float lodScale = 0.8f,
    float lodOffset = 0.f, const LoaderOptionsPtr& loaderOptions = nullptr);

  /**
   * @brief Gets or sets the size of the bounding box associated with the cube
   * texture When defined, the cubemap will switch to local mode
   * @see
   * https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity
   * Example: https://www.babylonjs-playground.com/#RNASML
   */
  void set_boundingBoxSize(const std::optional<Vector3>& value) override;

  /**
   * @brief Returns the bounding box size.
   * @see https://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode
   */
  std::optional<Vector3>& get_boundingBoxSize() override;

  /**
   * @brief Sets texture matrix rotation angle around Y axis in radians.
   * @param value rotation angle around Y axis in radians
   */
  void set_rotationY(float value);

  /**
   * @brief Gets texture matrix rotation angle around Y axis radians.
   * @return rotation angle around Y axis radians
   */
  float get_rotationY() const;

  /**
   * @brief Are mip maps generated for this texture or not.
   */
  bool get_noMipmap() const override;

public:
  /**
   * Observable triggered once the texture has been loaded.
   */
  Observable<CubeTexture> onLoadObservable;

  /**
   * The url of the texture
   */
  std::string url;

  /**
   * Gets or sets the center of the bounding box associated with the cube texture.
   * It must define where the camera used to render the texture was set
   * @see https://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode
   */
  Vector3 boundingBoxPosition;

  /**
   * Texture matrix rotation angle around Y axis in radians
   */
  Property<CubeTexture, float> rotationY;

  /**
   * Are mip maps generated for this texture or not
   */
  ReadOnlyProperty<CubeTexture, bool> noMipmap;

protected:
  std::string _forcedExtension;

private:
  std::function<void()> _onLoadProcessing;
  std::function<void(const std::optional<CubeTextureData>& data)> _delayedOnLoad;
  std::optional<Vector3> _boundingBoxSize;
  float _rotationY;
  bool _noMipmap;
  std::vector<std::string> _files;
  std::vector<std::string> _extensions;
  std::unique_ptr<Matrix> _textureMatrix;
  unsigned int _format;
  bool _createPolynomials;
  LoaderOptionsPtr _loaderOptions;
  float _lodScale;
  float _lodOffset;

}; // end of class CubeTexture

} // end of namespace BABYLON

#endif // end of BABYLON_MATERIALS_TEXTURES_CUBE_TEXTURE_H


text:
import moment from 'moment';
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
// eslint-disable-next-line no-restricted-imports
import { withRouter } from 'react-router';
import { withCurrentUser } from '../../lib/crud/withCurrentUser';
import { DatabasePublicSetting, localeSetting } from '../../lib/publicSettings';
import { LocationContext, NavigationContext, parseRoute, ServerRequestStatusContext, SubscribeLocationContext, ServerRequestStatusContextType } from '../../lib/vulcan-core/appContext';
import { IntlProvider, intlShape } from '../../lib/vulcan-i18n';
import { Components, registerComponent, Strings } from '../../lib/vulcan-lib';
import { userIdentifiedCallback } from '../../lib/analyticsEvents';
import { MessageContext } from '../common/withMessages';
import type { RouterLocation } from '../../lib/vulcan-lib/routes';

const siteImageSetting = new DatabasePublicSetting<string | null>('siteImage', 'https://res.cloudinary.com/lesswrong-2-0/image/upload/v1503704344/sequencesgrid/h6vrwdypijqgsop7xwa0.jpg') // An image used to represent the site on social media

interface ExternalProps {
  apolloClient: any
  serverRequestStatus?: ServerRequestStatusContextType
}
interface AppProps extends ExternalProps {
  // From withRouter
  location: any
  history: any

  // From withCurrentUser HoC
  currentUser: UsersCurrent
}

class App extends PureComponent<AppProps,any> {
  locationContext: RouterLocation|null = null
  subscribeLocationContext: RouterLocation|null = null
  navigationContext: any

  constructor(props: AppProps) {
    super(props);
    if (props.currentUser) {
      void userIdentifiedCallback.runCallbacks({
        iterator: props.currentUser,
        properties: [],
      });
    }
    const locale = localeSetting.get();
    this.state = {
      locale,
      messages: [],
    };
    moment.locale(locale);
  }

  /*

  Show a flash message

  */
  flash = message => {
    this.setState({
      messages: [...this.state.messages, message]
    });
  }

  /*

  Clear all flash messages

  */
  clear = () => {
    // When clearing messages, we first set all current messages to have a hide property
    // And only after 500ms set the array to empty, to allow UI elements to show a fade-out animation
    this.setState({
      messages: this.state.messages.map(message => ({...message, hide: true}))
    })
    setTimeout(() => {
      this.setState({ messages: []});
    }, 500)
  }

  getLocale = (truncate?: boolean) => {
    return truncate ? this.state.locale.slice(0, 2) : this.state.locale;
  };

  getChildContext() {
    return {
      getLocale: this.getLocale,
    };
  }

  UNSAFE_componentWillUpdate(nextProps: AppProps) {
    if (!this.props.currentUser && nextProps.currentUser) {
      void userIdentifiedCallback.runCallbacks({
        iterator: nextProps.currentUser,
        properties: [],
      });
    }
  }

  render() {
    const { flash } = this;
    const { messages } = this.state;
    const { currentUser, serverRequestStatus } = this.props;

    // Parse the location into a route/params/query/etc.
    const location = parseRoute({location: this.props.location});

    if (location.redirected) {
      return <Components.PermanentRedirect url={location.url}/>
    }

    // Reuse the container objects for location and navigation context, so that
    // they will be reference-stable and won't trigger spurious rerenders.
    if (!this.locationContext) {
      this.locationContext = {...location};
    } else {
      Object.assign(this.locationContext, location);
    }

    if (!this.navigationContext) {
      this.navigationContext = {
        history: this.props.history
      };
    } else {
      this.navigationContext.history = this.props.history;
    }

    // subscribeLocationContext changes (by shallow comparison) whenever the
    // URL changes.
    if (!this.subscribeLocationContext || this.subscribeLocationContext.pathname != location.pathname) {
      this.subscribeLocationContext = {...location};
    } else {
      Object.assign(this.subscribeLocationContext, location);
    }

    const { RouteComponent } = location;
    return (
      <LocationContext.Provider value={this.locationContext}>
      <SubscribeLocationContext.Provider value={this.subscribeLocationContext}>
      <NavigationContext.Provider value={this.navigationContext}>
      <ServerRequestStatusContext.Provider value={serverRequestStatus||null}>
      <IntlProvider locale={this.getLocale()} key={this.getLocale()} messages={Strings[this.getLocale()]}>
        <MessageContext.Provider value={{ messages, flash, clear: this.clear }}>
          <Components.HeadTags image={siteImageSetting.get()} />
          <Components.ScrollToTop />
          <Components.Layout currentUser={currentUser} messages={messages}>
            <RouteComponent />
          </Components.Layout>
        </MessageContext.Provider>
      </IntlProvider>
      </ServerRequestStatusContext.Provider>
      </NavigationContext.Provider>
      </SubscribeLocationContext.Provider>
      </LocationContext.Provider>
    );
  }
}

(App as any).childContextTypes = {
  intl: intlShape,
  getLocale: PropTypes.func,
};

//registerComponent('App', App, withCurrentUser, [withUpdate, updateOptions], withCookies, withRouter);
// TODO LESSWRONG-Temporarily omit withCookies until it's debugged
const AppComponent = registerComponent<ExternalProps>('App', App, {
  hocs: [
    withCurrentUser,
    withRouter
  ]
});

declare global {
  interface ComponentTypes {
    App: typeof AppComponent
  }
}

export default App;


text:
#region Copyright

//--------------------------------------------------------------------------------------------------------
// <copyright file="UnitOfWork.cs" company="DNN Corp®">
//      DNN Corp® - http://www.dnnsoftware.com Copyright (c) 2002-2013 by DNN Corp®
//
//      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
//      associated documentation files (the "Software"), to deal in the Software without restriction,
//      including without limitation the rights to use, copy, modify, merge, publish, distribute,
//      sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
//      furnished to do so, subject to the following conditions:
//
//      The above copyright notice and this permission notice shall be included in all copies or
//      substantial portions of the Software.
//
//      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
//      NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//      NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//      DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
////------------------------------------------------------------------------------------------------------

#endregion Copyright

using DotNetNuke.Data;
using DotNetNuke.Entities.Users;
using System;
using System.Web;

namespace DotNetNuke.Wiki.BusinessObjects
{
    /// <summary>
    /// The Unit Of Work Business Object
    /// </summary>
    public class UnitOfWork : IDisposable
    {
        #region Variables

        private UserInfo mCurrentUser = null;
        private IDataContext mDataContext;
        private bool mDisposed = false;

        #endregion Variables

        #region Properties

        /// <summary>
        /// Gets the context.
        /// </summary>
        /// <value>The context.</value>
        internal IDataContext Context
        {
            get
            {
                return this.mDataContext;
            }
        }

        /// <summary>
        /// Gets the current user.
        /// </summary>
        /// <value>The current user.</value>
        internal UserInfo CurrentUser
        {
            get
            {
                return this.mCurrentUser;
            }
        }

        #endregion Properties

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="UnitOfWork"/> class.
        /// </summary>
        public UnitOfWork()
        {
            this.mDataContext = DataContext.Instance();

            if (HttpContext.Current != null && HttpContext.Current.User.Identity.IsAuthenticated)
            {
                this.mCurrentUser = UserController.GetCurrentUserInfo();
            }
        }

        #endregion Constructor

        #region transaction

        /// <summary>
        /// Starts a new transaction
        /// </summary>
        public void BeginTransaction()
        {
            this.mDataContext.BeginTransaction();
        }

        /// <summary>
        /// Commits a transaction
        /// </summary>
        public void CommitTransaction()
        {
            this.mDataContext.Commit();
        }

        /// <summary>
        /// Rolls back a transaction
        /// </summary>
        public void RollbackTransaction()
        {
            this.mDataContext.RollbackTransaction();
        }

        #endregion transaction

        #region IDisposable Members

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting
        /// unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            this.Dispose(true);

            // This object will be cleaned up by the Dispose method. Therefore, you should call
            // GC.SupressFinalize to take this object off the finalization queue and prevent
            // finalization code for this object from executing a second time.
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources;
        /// <c>false</c> to release only unmanaged resources.</param>
        private void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if (!this.mDisposed)
            {
                // If disposing equals true, dispose all managed and unmanaged resources.
                if (disposing)
                {
                    // Clean up all managed resources
                    if (this.mDataContext != null)
                    {
                        (this.mDataContext as IDisposable).Dispose();
                        this.mDataContext = null;
                    }

                    this.mCurrentUser = null;
                }

                // Clean up all native resources

                // Note disposing has been done.
                this.mDisposed = true;
            }
        }

        /// <summary>
        /// Finalizes an instance of the <see cref="UnitOfWork"/> class.
        /// </summary>
        ~UnitOfWork()
        {
            this.Dispose(false);
        }

        #endregion IDisposable Members
    }
}


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

public class ScreenshotDisplayManager : Singleton<ScreenshotDisplayManager> {
	public float CROSSFADE_TIME = 0.25f;
	UITexture[] screens;
	UIPanel panel;
	int currentScreenIndex = 0;
	Coroutine<_> crossfade;

	void Start() {
		panel = transform.parent.GetComponent<UIPanel>();
		screens = GetComponentsInChildren<UITexture>();
		foreach (var screen in screens) {
			screen.alpha = 0;
		}

		screens[0].alpha = 1;
		screens[0].mainTexture = GameRepository.Instance.games[0].screenshot;
	}

	void Update() {
		panel.Refresh();
	}

	public void LoadScreenshot(Texture2D screenshot) {
		if (crossfade == null) {
			var nextIndex = Maths.Mod((currentScreenIndex + 1), screens.Length);
			screens[nextIndex].mainTexture = screenshot;
			crossfade = StartCoroutine<_>(Coroutines.OverTime(CROSSFADE_TIME, Funcs.Identity, t => {
				screens[currentScreenIndex].alpha = 1 -t;
				screens[nextIndex].alpha = t;
				if (t == 1) {
					currentScreenIndex = Maths.Mod((currentScreenIndex + 1), screens.Length);
					crossfade = null;
				}
			}));
		}
	}
}


text:
/**
 * @since 2016-06-25 17:39
 * @author vivaxy
 */

self.addEventListener('fetch', function (event) {
  var request = event.request;
  console.log('Handling fetch event for', request.url);
  var requestUrl = new URL(request.url);

  // Determine whether this is a URL Shortener API request that should be mocked.
  // Matching on just the pathname gives some flexibility in case there are multiple domains that
  // might host the same RESTful API (imagine this being used to mock responses against what might be
  // a test, or QA, or production environment).
  // Also check for the existence of the 'X-Mock-Response' header.
  if (requestUrl.pathname.indexOf('data.json') !== -1) {
    // This matches the result format documented at
    // https://developers.google.com/url-shortener/v1/getting_started#shorten
    var responseBody = {
      code: 200,
    };

    var responseConfig = {
      // status/statusText default to 200/OK, but we're explicitly setting them here.
      status: 200,
      statusText: 'OK',
      headers: {
        'Content-Type': 'application/json',
        // Purely optional, but we return a custom response header indicating that this is a
        // mock response. The controlled page could check for this header if it wanted to.
        'X-Mock-Response': 'yes',
      },
    };

    var mockResponse = new Response(
      JSON.stringify(responseBody),
      responseConfig,
    );

    event.respondWith(mockResponse);
    console.log('Respond with a mock response body:', responseBody);
  }

  // If event.respondWith() isn't called because this wasn't a request that we want to mock,
  // then the default request/response behavior will automatically be used.
});


text:
Pàgina web del Club de Rol Regnehostil
========================

Aquest projecte conté el codi font de la plataforma web de Regne Hostil (www.regnehostil.com)

Està realitzada utilitzant les següents tecnologies:
- PHP Framework Symfony2 http://symfony.com/
- CSS Framework Bootstrap http://twitter.github.com/bootstrap/
- JS jQuery 1.7.2 http://jquery.com/
- JS ShadowBox http://www.shadowbox-js.com/


text:
<?php

/** @var $installer Mage_Weee_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
/**
 * Create table 'weee/tax'
 */
$table = $installer->getConnection()
    ->newTable($installer->getTable('weee/tax'))
    ->addColumn('value_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'nullable'  => false,
        'primary'   => true,
        ), 'Value Id')
    ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        'default'   => '0',
        ), 'Website Id')
    ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        'default'   => '0',
        ), 'Entity Id')
    ->addColumn('country', Varien_Db_Ddl_Table::TYPE_TEXT, 2, array(
        'nullable'  => true,
        ), 'Country')
    ->addColumn('value', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array(
        'nullable'  => false,
        'default'   => '0.0000',
        ), 'Value')
    ->addColumn('state', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
        'nullable'  => false,
        'default'   => '*',
        ), 'State')
    ->addColumn('attribute_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        ), 'Attribute Id')
    ->addColumn('entity_type_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        ), 'Entity Type Id')
    ->addIndex($installer->getIdxName('weee/tax', array('website_id')),
        array('website_id'))
    ->addIndex($installer->getIdxName('weee/tax', array('entity_id')),
        array('entity_id'))
    ->addIndex($installer->getIdxName('weee/tax', array('country')),
        array('country'))
    ->addIndex($installer->getIdxName('weee/tax', array('attribute_id')),
        array('attribute_id'))
    ->addForeignKey($installer->getFkName('weee/tax', 'country', 'directory/country', 'country_id'),
        'country', $installer->getTable('directory/country'), 'country_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->addForeignKey($installer->getFkName('weee/tax', 'entity_id', 'catalog/product', 'entity_id'),
        'entity_id', $installer->getTable('catalog/product'), 'entity_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->addForeignKey($installer->getFkName('weee/tax', 'website_id', 'core/website', 'website_id'),
        'website_id', $installer->getTable('core/website'), 'website_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->addForeignKey($installer->getFkName('weee/tax', 'attribute_id', 'eav/attribute', 'attribute_id'),
        'attribute_id', $installer->getTable('eav/attribute'), 'attribute_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->setComment('Weee Tax');
$installer->getConnection()->createTable($table);

/**
 * Create table 'weee/discount'
 */
$table = $installer->getConnection()
    ->newTable($installer->getTable('weee/discount'))
    ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        'default'   => '0',
        ), 'Entity Id')
    ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        'default'   => '0',
        ), 'Website Id')
    ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
        'unsigned'  => true,
        'nullable'  => false,
        ), 'Customer Group Id')
    ->addColumn('value', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array(
        'nullable'  => false,
        'default'   => '0.0000',
        ), 'Value')
    ->addIndex($installer->getIdxName('weee/discount', array('website_id')),
        array('website_id'))
    ->addIndex($installer->getIdxName('weee/discount', array('entity_id')),
        array('entity_id'))
    ->addIndex($installer->getIdxName('weee/discount', array('customer_group_id')),
        array('customer_group_id'))
    ->addForeignKey(
        $installer->getFkName('weee/discount', 'customer_group_id', 'customer/customer_group', 'customer_group_id'),
        'customer_group_id', $installer->getTable('customer/customer_group'), 'customer_group_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->addForeignKey($installer->getFkName('weee/discount', 'entity_id', 'catalog/product', 'entity_id'),
        'entity_id', $installer->getTable('catalog/product'), 'entity_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->addForeignKey($installer->getFkName('weee/discount', 'website_id', 'core/website', 'website_id'),
        'website_id', $installer->getTable('core/website'), 'website_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
    ->setComment('Weee Discount');
$installer->getConnection()->createTable($table);

$installer->addAttribute('order_item', 'base_weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'base_weee_tax_applied_row_amnt', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'weee_tax_applied_row_amount', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'weee_tax_applied', array('type'=>'text'));

$installer->addAttribute('quote_item', 'weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('quote_item', 'weee_tax_row_disposition', array('type'=>'decimal'));
$installer->addAttribute('quote_item', 'base_weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('quote_item', 'base_weee_tax_row_disposition', array('type'=>'decimal'));

$installer->addAttribute('order_item', 'weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'weee_tax_row_disposition', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'base_weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('order_item', 'base_weee_tax_row_disposition', array('type'=>'decimal'));

$installer->addAttribute('invoice_item', 'base_weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'base_weee_tax_applied_row_amnt', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'weee_tax_applied_row_amount', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'weee_tax_applied', array('type'=>'text'));
$installer->addAttribute('invoice_item', 'weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'weee_tax_row_disposition', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'base_weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('invoice_item', 'base_weee_tax_row_disposition', array('type'=>'decimal'));

$installer->addAttribute('quote_item', 'weee_tax_applied', array('type'=>'text'));
$installer->addAttribute('quote_item', 'weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('quote_item', 'weee_tax_applied_row_amount', array('type'=>'decimal'));
$installer->addAttribute('quote_item', 'base_weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('quote_item', 'base_weee_tax_applied_row_amnt', array('type'=>'decimal'));

$installer->addAttribute('creditmemo_item', 'weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'weee_tax_row_disposition', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'base_weee_tax_disposition', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'base_weee_tax_row_disposition', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'weee_tax_applied', array('type'=>'text'));
$installer->addAttribute('creditmemo_item', 'base_weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'base_weee_tax_applied_row_amnt', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'weee_tax_applied_amount', array('type'=>'decimal'));
$installer->addAttribute('creditmemo_item', 'weee_tax_applied_row_amount', array('type'=>'decimal'));

$installer->endSetup();


text:
<?php

namespace PHPExiftool\Driver\Tag\MIEPreview;

use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;

/**
 * @ExclusionPolicy("all")
 */
class PreviewImageSize extends AbstractTag
{

    protected $Id = 'ImageSize';

    protected $Name = 'PreviewImageSize';

    protected $FullName = 'MIE::Preview';

    protected $GroupName = 'MIE-Preview';

    protected $g0 = 'MIE';

    protected $g1 = 'MIE-Preview';

    protected $g2 = 'Image';

    protected $Type = 'int16u';

    protected $Writable = true;

    protected $Description = 'Preview Image Size';
}


text:
TABLE OF INTERACTIONS WITH

DIHYDROPYRIDINES

From the French ANSM drug interactions document of September 2016, p.777

DIHYDROPYRIDINES

CLASS CODE:

C08CA-002

BETA BLOCKING AGENTS (EXCEPT ESMOLOL)

CLASS CODE:

C07AB-002

Hypotension, heart failure with patients having latent or uncontrolled cardiac insufficiency (addition of the negative inotropic effects). The beta blocking agent can furthermore minimize the sympathetic reflex reaction brought into play in the case of excessive hemodynamic repercussion

Take into account

DIHYDROPYRIDINES

CLASS CODE:

C08CA-002

BETA-BLOCKING AGENTS IN HEART FAILURE

CLASS CODE:

C07AB-003

Hypotension, heart failure in patients with latent or uncontrolled cardiac insufficiency (negative inotropic effect of the dihydropyridines in vitro, more or less marked, and susceptible of adding to the negative inotropic effects of the beta blocking agents). The presence of a beta-blocking treatment can furthermore minimize the sympathetic reflex reaction put into play in cases of excessive hemodynamic repercussion.

Take into account

DIHYDROPYRIDINES

CLASS CODE:

C08CA-002

DANTROLENE

RxNorm: 3105

ATC: M03CA M03CA01

With the dantrolene administered via IV: with animals, fatal cases of ventricular fibrillations are constantly observed when verapamil and dantrolene are administered via IV route. The administration of a calcium channel blocker and dantrolene together is thus potentially dangerous. However, some patients have received nifedipine and dantrolene together without incident.

Not recommended


text:
SELECT u.id, u.first_name, u.last_name, u.phone, u.user_type, u.active,
       u.profile_image_url, u.account_kit_access_token, u.account_kit_user_id,
       u.account_kit_access_token_expires_at, u.accepted_terms, u.created_by_user,
       u.created_on, u.updated_at,
       g.availabilities, g.other_availability,
       g.care_ages, g.care_experiences,
       g.other_care_experience, g.care_locations,
       g.demeanors, g.other_demeanor,
       g.care_trainings, g.neighborhood_id, g.other_neighborhood,
       g.available_outside_neighborhood, g.why_care_for_kids, g.additional_info,
       n.name as neighborhood_name, n.label as neighborhood_label,
       n.city_id, c.name as city_name, c.label as city_label, c.state as city_state
FROM users as u, gmas as g
  LEFT OUTER JOIN
    neighborhoods as n
  ON g.neighborhood_id = n.id
  LEFT OUTER JOIN
    cities as c
  ON n.city_id = c.id
WHERE
  (u.deleted=false or u.deleted=:deleted)
  AND
  u.user_type = 'GMA'
  AND
  u.id = g.user_id
ORDER BY
  u.id


text:
/**
 * Retrieve the current window handle.
 *
 * <example>
    :windowHandle.js
    it('should return window handle', function () {
        browser.url('http://webdriver.io');

        var handle = browser.windowHandle()
        console.log(handle);
        // outputs something like the following:
        //  {
        //      state: 'success',
        //      sessionId: 'e6782264-9eb1-427b-9250-d8302ac35161',
        //      hCode: 988127308,
        //      value: 'CDwindow-849D79B1-5CCB-4A1D-A217-5BA809D935F3',
        //      class: 'org.openqa.selenium.remote.Response',
        //      status: 0
        //  }
    });
 * </example>
 *
 * @return {String} the current window handle
 *
 * @see https://w3c.github.io/webdriver/webdriver-spec.html#dfn-get-window-handle
 * @type protocol
 *
 */

export default function windowHandle () {
    return this.requestHandler.create('/session/:sessionId/window_handle').catch((err) => {
        /**
         * jsonwire command not supported try webdriver endpoint
         */
        if (err.message.match(/did not match a known command/)) {
            return this.requestHandler.create('/session/:sessionId/window')
        }

        throw err
    })
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/iv_type"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="10dp" />

    <TextView
        android:id="@+id/tv_type"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginLeft="5dp"
        android:layout_toRightOf="@id/iv_type" />

    <TextView
        android:textColor="#056f00"
        android:id="@+id/tv_money"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="15dp"
        android:textSize="20sp" />

</RelativeLayout>


text:
require 'properties/evaluator'

module Properties
  class RubyEvaluatorFactory
    def create(context)
      RubyEvaluator.new(context)
    end
  end

  class RubyEvaluator < Evaluator
    def initialize(context)
      super
      @built_in = BuiltInMethods.new
    end

    def evaluate(src_value)
      src_value = super
      data = /\#\{([^\}]+)\}/.match(src_value)
      return src_value if data.nil?
      src_value.gsub(/\#\{([^\}]+)\}/){@built_in.instance_eval($1)}
    end

    class BuiltInMethods
      def read(file)
        IO.read(file)
      end
    end
  end
end


text:
<link rel="import" href="../../../behaviors/base-url-behavior/base-url-behavior.html">
<link rel="import" href="../../../behaviors/gr-url-encoding-behavior/gr-url-encoding-behavior.html">
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html">
<link rel="import" href="../../../bower_components/iron-input/iron-input.html">
<link rel="import" href="../../../styles/gr-form-styles.html">
<link rel="import" href="../../../styles/gr-subpage-styles.html">
<link rel="import" href="../../../styles/gr-table-styles.html">
<link rel="import" href="../../../styles/shared-styles.html">
<link rel="import" href="../../shared/gr-account-link/gr-account-link.html">
<link rel="import" href="../../shared/gr-autocomplete/gr-autocomplete.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<link rel="import" href="../../shared/gr-overlay/gr-overlay.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../gr-confirm-delete-item-dialog/gr-confirm-delete-item-dialog.html">

<dom-module id="gr-group-members">
  <template>

        Loading...

[[_groupName]]

Members

          <fieldset>

              <gr-autocomplete
                  id="groupMemberSearchInput"
                  text="{{_groupMemberSearchName}}"
                  value="{{_groupMemberSearchId}}"
                  query="[[_queryMembers]]"
                  placeholder="Name Or Email">
              </gr-autocomplete>

            <gr-button
                id="saveGroupMember"
                on-tap="_handleSavingGroupMember"
                disabled="[[!_groupMemberSearchId]]">
              Add
            </gr-button>

                Name
                Email Address
                Delete Member

                <template is="dom-repeat" items="[[_groupMembers]]">

                      <gr-account-link account="[[item]]"></gr-account-link>

                    [[item.email]]

                      <gr-button
                          class="deleteMembersButton"
                          on-tap="_handleDeleteMember">
                        Delete
                      </gr-button>

                </template>

          </fieldset>

Included Groups

          <fieldset>

              <gr-autocomplete
                  id="includedGroupSearchInput"
                  text="{{_includedGroupSearchName}}"
                  value="{{_includedGroupSearchId}}"
                  query="[[_queryIncludedGroup]]"
                  placeholder="Group Name">
              </gr-autocomplete>

            <gr-button
                id="saveIncludedGroups"
                on-tap="_handleSavingIncludedGroups"
                disabled="[[!_includedGroupSearchId]]">
              Add
            </gr-button>

                Group Name
                Description

                  Delete Group

                <template is="dom-repeat" items="[[_includedGroups]]">

                      <template is="dom-if" if="[[item.url]]">

                          [[item.name]]

                      </template>
                      <template is="dom-if" if="[[!item.url]]">
                        [[item.name]]
                      </template>

                    [[item.description]]

                      <gr-button
                          class="deleteIncludedGroupButton"
                          on-tap="_handleDeleteIncludedGroup">
                        Delete
                      </gr-button>

                </template>

          </fieldset>

    <gr-overlay id="overlay" with-backdrop>
      <gr-confirm-delete-item-dialog
          class="confirmDialog"
          on-confirm="_handleDeleteConfirm"
          on-cancel="_handleConfirmDialogCancel"
          item="[[_itemName]]"
          item-type="[[_itemType]]"></gr-confirm-delete-item-dialog>
    </gr-overlay>
    <gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
  </template>

</dom-module>


text:
The playbook in this directory is an example to replace the current libvirt-based playbook with
one that would use the openstack API. It won't work 'as is' and would require some little adjustments, but
it shows the logic and main steps.

A working example can be found in git history, see commit : 82c91e7d630012b104bda4fa2ef0400e6f3e02c9


text:
layout: page
title: Salinas Software Show
date: 2016-05-24
author: Evelyn Mcknight
tags: weekly links, java
status: published
summary: Integer arcu elit, varius a urna sed, gravida.
banner: images/banner/wedding.jpg
booking:
  startDate: 08/29/2019
  endDate: 08/30/2019
  ctyhocn: SJCCRHX
  groupCode: SSS
published: true
---
Aliquam nisi mi, suscipit eget bibendum id, accumsan ac sem. Praesent augue libero, lacinia sed tempus eget, iaculis ac est. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus fermentum placerat mauris a fermentum. Quisque facilisis erat sit amet metus tristique aliquam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur convallis, lorem a consectetur volutpat, nisi arcu aliquet tortor, nec tincidunt odio lorem et risus. Pellentesque laoreet bibendum purus, non suscipit nisl vulputate nec. Fusce in dui rutrum, ultrices dui at, interdum urna. In ultrices nunc sit amet nisi posuere elementum.

1 Vestibulum ultricies nisl at mi iaculis, in gravida nunc porta
1 In suscipit elit in vulputate condimentum
1 Aenean lobortis risus a tortor molestie pulvinar.

Pellentesque vitae lobortis velit. Curabitur dictum dignissim elementum. Nulla tempor turpis et felis ultricies fringilla. Aliquam lacinia feugiat rhoncus. Duis porttitor ut risus quis euismod. Proin venenatis nec magna a bibendum. Vestibulum vel augue orci. Nam sollicitudin, quam eget facilisis consectetur, nunc urna ultricies nisi, quis lacinia dolor orci et neque. Nam egestas consequat nunc, nec fermentum est molestie quis. Pellentesque maximus, augue sit amet sollicitudin auctor, mauris urna maximus orci, non porttitor augue leo dapibus dolor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tincidunt non ligula quis interdum. Nam tincidunt sapien non tincidunt aliquam.


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Kunal Mahajan: Cultural Blog</title>
  <link type="text/css" rel="stylesheet" href="blog-stylesheet.css"/>

Kunal Mahajan: Dev BootCamp

"The tale of my journey on becoming a Junior Web Developer..."

Home

About Me:

Project(s):

            Blog(s): ▾

DBC: Technical Blog(s):

DBC: Cultural Blog(s):

DBC: Personal Blog(s):

Contact:

DBC-Cultural Blog:

Date: 08.14.15
Entry #: 5

Commentary:

                  I wanted to talk about something called 'Stereotype Threat'. The gist of what stereotype threat is, "Stereotype threat refers to being at risk of confirming, as self-characteristic, a negative stereotype about one's group." (Steele & Aronson, 1995). The long-term effect of one who accepts these threats is educational and social inequality. These threats pose danger especially when one is relatively new to circumstances -whether a new job or a new social environment like school where one tries their best to 'fit in'. During these times, one can be made most vulnerable and as such will oft be willing to let go of stereotypes in order to fit into their niche's. The dangers of conforming to these stereotypes are obviously negative and pressure to avoid threats by cutting them off at the bud are tricky situations to overcome.

                  The best way to avoid these tricky situations is to be honest with yourself and present your self-goals during times of wanting to fit in. Being open and honest with yourself with your goals presents a much stronger argument than wanting to fit in socially. For instance, a social injustice -stereotypically, is found that women aren't as good in Maths as their male counterparts. Well, if you're a female and want to pursue Maths, succombing to the notion that you're not 'supposed' to be in the field will not only demotivate you, but also harm you in the long-run with the possibility of male counterparts being able to walk over you and you not being able to stand up for yourself. Knowing what you want, knowing who you are, and knowing what's important will help overcome threats that will likely bombard you...simply because of your gender/race/or skin color. Make sure you arm yourself with knowledge, as it will pull you out of the darkest of holes!

        LinkedIN
        GitHub
        Google+
        Twitter


text:
package models.asynchttp.response;

import models.asynchttp.RequestProtocol;
import models.asynchttp.request.AgentRequest;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
/**
 *
 * @author ypei
 *
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class AgentResponse {
	// Response attributes
	private boolean error = false;
	private String errorMessage;
	private int errorCode;
	private String stackTrace;
	private long operationTimeMillis;

	private String statusCode;

	// jeff for generic agent response
	protected AgentResponse(AgentResponse orig) {
		super();
		this.error = orig.error;
		this.errorMessage = orig.errorMessage;
		this.errorCode = orig.errorCode;
		this.stackTrace = orig.stackTrace;
		this.operationTimeMillis = orig.operationTimeMillis;
		this.request = orig.request;
		this.host = orig.host;
		this.agentPort = orig.agentPort;
		this.protocol = orig.protocol;

		this.statusCode = orig.statusCode;
	}

	// Request attributes
	private AgentRequest request;

	// Host details
	private String host;
	private int agentPort;
	private RequestProtocol protocol;

	public AgentResponse() {
		super();
	}

	@JsonProperty("isError")
	public boolean isError() {
		return error;
	}

	@JsonProperty("isError")
	public void setError(boolean error) {
		this.error = error;
	}

	@JsonProperty("errorMsg")
	public String getErrorMessage() {
		return errorMessage;
	}

	@JsonProperty("errorMsg")
	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	@JsonProperty("error")
	public int getErrorCode() {
		return errorCode;
	}

	@JsonProperty("error")
	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public String getStackTrace() {
		return stackTrace;
	}

	public void setStackTrace(String stackTrace) {
		this.stackTrace = stackTrace;
	}

	public long getOperationTimeMillis() {
		return operationTimeMillis;
	}

	public void setOperationTimeMillis(long operationTimeMillis) {
		this.operationTimeMillis = operationTimeMillis;
	}

	public AgentRequest getRequest() {
		return request;
	}

	public void setRequest(AgentRequest request) {
		this.request = request;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public int getAgentPort() {
		return agentPort;
	}

	public void setAgentPort(int agentPort) {
		this.agentPort = agentPort;
	}

	public RequestProtocol getProtocol() {
		return protocol;
	}

	public void setProtocol(RequestProtocol protocol) {
		this.protocol = protocol;
	}

	public String getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	@Override
	public String toString() {
		return "AgentResponse [error=" + error + ", errorMessage="
				+ errorMessage + ", errorCode=" + errorCode + ", stackTrace="
				+ stackTrace + ", operationTimeMillis=" + operationTimeMillis
				+ ", statusCode=" + statusCode + ", request=" + request
				+ ", host=" + host + ", agentPort=" + agentPort + ", protocol="
				+ protocol + "]";
	}

}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('civictechprojects', '0021_auto_20190108_0259'),
    ]

    operations = [
        migrations.AddField(
            model_name='project',
            name='project_date_created',
            field=models.DateTimeField(null=True),
        ),
        migrations.AddField(
            model_name='volunteerrelation',
            name='approved_date',
            field=models.DateTimeField(null=True),
        ),
    ]


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE563_Unused_Variable__unused_init_variable_char_21.c
Label Definition File: CWE563_Unused_Variable__unused_init_variable.label.xml
Template File: source-sinks-21.tmpl.c
*/
/*
 * @description
 * CWE: 563 Unused Variable
 * BadSource:  Initialize data
 * Sinks:
 *    GoodSink: Use data
 *    BadSink : do nothing
 * Flow Variant: 21 Control flow: Flow controlled by value of a static global variable. All functions contained in one file.
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifndef OMITBAD

/* The static variable below is used to drive control flow in the sink function */
static int badStatic = 0;

static void badSink(char data)
{
    if(badStatic)
    {
        /* FLAW: Do not use the variable */
        /* do nothing */
        ; /* empty statement needed for some flow variants */
    }
}

void CWE563_Unused_Variable__unused_init_variable_char_21_bad()
{
    char data;
    /* POTENTIAL FLAW: Initialize, but do not use data */
    data = 'C';
    badStatic = 1; /* true */
    badSink(data);
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* The static variables below are used to drive control flow in the sink functions. */
static int goodB2G1Static = 0;
static int goodB2G2Static = 0;

/* goodB2G1() - use badsource and goodsink by setting the static variable to false instead of true */
static void goodB2G1Sink(char data)
{
    if(goodB2G1Static)
    {
        /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
        printLine("Benign, fixed string");
    }
    else
    {
        /* FIX: Use data */
        printHexCharLine(data);
    }
}

static void goodB2G1()
{
    char data;
    /* POTENTIAL FLAW: Initialize, but do not use data */
    data = 'C';
    goodB2G1Static = 0; /* false */
    goodB2G1Sink(data);
}

/* goodB2G2() - use badsource and goodsink by reversing the blocks in the if in the sink function */
static void goodB2G2Sink(char data)
{
    if(goodB2G2Static)
    {
        /* FIX: Use data */
        printHexCharLine(data);
    }
}

static void goodB2G2()
{
    char data;
    /* POTENTIAL FLAW: Initialize, but do not use data */
    data = 'C';
    goodB2G2Static = 1; /* true */
    goodB2G2Sink(data);
}

void CWE563_Unused_Variable__unused_init_variable_char_21_good()
{
    goodB2G1();
    goodB2G2();
}

#endif /* OMITGOOD */

/* Below is the main(). It is only used when building this testcase on
   its own for testing or for building a binary to use in testing binary
   analysis tools. It is not used when compiling all the testcases as one
   application, which is how source code analysis tools are tested. */

#ifdef INCLUDEMAIN

int main(int argc, char * argv[])
{
    /* seed randomness */
    srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
    printLine("Calling good()...");
    CWE563_Unused_Variable__unused_init_variable_char_21_good();
    printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
    printLine("Calling bad()...");
    CWE563_Unused_Variable__unused_init_variable_char_21_bad();
    printLine("Finished bad()");
#endif /* OMITBAD */
    return 0;
}

#endif


text:
/* Boehm, March 29, 1995 12:51 pm PST */
# ifdef CHECKSUMS

# include "private/gc_priv.h"

/* This is debugging code intended to verify the results of dirty bit	*/
/* computations. Works only in a single threaded environment.		*/
/* We assume that stubborn objects are changed only when they are 	*/
/* enabled for writing.  (Certain kinds of writing are actually		*/
/* safe under other conditions.)					*/
# define NSUMS 10000

# define OFFSET 0x10000

typedef struct {
	GC_bool new_valid;
	word old_sum;
	word new_sum;
	struct hblk * block;	/* Block to which this refers + OFFSET  */
				/* to hide it from collector.		*/
} page_entry;

page_entry GC_sums [NSUMS];

word GC_checksum(h)
struct hblk *h;
{
    register word *p = (word *)h;
    register word *lim = (word *)(h+1);
    register word result = 0;

    while (p < lim) {
        result += *p++;
    }
    return(result | 0x80000000 /* doesn't look like pointer */);
}

# ifdef STUBBORN_ALLOC
/* Check whether a stubborn object from the given block appears on	*/
/* the appropriate free list.						*/
GC_bool GC_on_free_list(h)
struct hblk *h;
{
    register hdr * hhdr = HDR(h);
    register int sz = hhdr -> hb_sz;
    ptr_t p;

    if (sz > MAXOBJSZ) return(FALSE);
    for (p = GC_sobjfreelist[sz]; p != 0; p = obj_link(p)) {
        if (HBLKPTR(p) == h) return(TRUE);
    }
    return(FALSE);
}
# endif

int GC_n_dirty_errors;
int GC_n_changed_errors;
int GC_n_clean;
int GC_n_dirty;

void GC_update_check_page(h, index)
struct hblk *h;
int index;
{
    page_entry *pe = GC_sums + index;
    register hdr * hhdr = HDR(h);
    struct hblk *b;

    if (pe -> block != 0 && pe -> block != h + OFFSET) ABORT("goofed");
    pe -> old_sum = pe -> new_sum;
    pe -> new_sum = GC_checksum(h);
#   if !defined(MSWIN32) && !defined(MSWINCE)
        if (pe -> new_sum != 0x80000000 && !GC_page_was_ever_dirty(h)) {
            GC_printf1("GC_page_was_ever_dirty(0x%lx) is wrong\n",
        	       (unsigned long)h);
        }
#   endif
    if (GC_page_was_dirty(h)) {
    	GC_n_dirty++;
    } else {
    	GC_n_clean++;
    }
    b = h;
    while (IS_FORWARDING_ADDR_OR_NIL(hhdr) && hhdr != 0) {
	b -= (word)hhdr;
	hhdr = HDR(b);
    }
    if (pe -> new_valid
	&& hhdr != 0 && hhdr -> hb_descr != 0 /* may contain pointers */
	&& pe -> old_sum != pe -> new_sum) {
    	if (!GC_page_was_dirty(h) || !GC_page_was_ever_dirty(h)) {
    	    /* Set breakpoint here */GC_n_dirty_errors++;
    	}
#	ifdef STUBBORN_ALLOC
    	  if ( hhdr -> hb_map != GC_invalid_map
    	    && hhdr -> hb_obj_kind == STUBBORN
    	    && !GC_page_was_changed(h)
    	    && !GC_on_free_list(h)) {
    	    /* if GC_on_free_list(h) then reclaim may have touched it	*/
    	    /* without any allocations taking place.			*/
    	    /* Set breakpoint here */GC_n_changed_errors++;
    	  }
#	endif
    }
    pe -> new_valid = TRUE;
    pe -> block = h + OFFSET;
}

word GC_bytes_in_used_blocks;

void GC_add_block(h, dummy)
struct hblk *h;
word dummy;
{
   register hdr * hhdr = HDR(h);
   register bytes = WORDS_TO_BYTES(hhdr -> hb_sz);

   bytes += HBLKSIZE-1;
   bytes &= ~(HBLKSIZE-1);
   GC_bytes_in_used_blocks += bytes;
}

void GC_check_blocks()
{
    word bytes_in_free_blocks = GC_large_free_bytes;

    GC_bytes_in_used_blocks = 0;
    GC_apply_to_all_blocks(GC_add_block, (word)0);
    GC_printf2("GC_bytes_in_used_blocks = %ld, bytes_in_free_blocks = %ld ",
    		GC_bytes_in_used_blocks, bytes_in_free_blocks);
    GC_printf1("GC_heapsize = %ld\n", GC_heapsize);
    if (GC_bytes_in_used_blocks + bytes_in_free_blocks != GC_heapsize) {
    	GC_printf0("LOST SOME BLOCKS!!\n");
    }
}

/* Should be called immediately after GC_read_dirty and GC_read_changed. */
void GC_check_dirty()
{
    register int index;
    register unsigned i;
    register struct hblk *h;
    register ptr_t start;

    GC_check_blocks();

    GC_n_dirty_errors = 0;
    GC_n_changed_errors = 0;
    GC_n_clean = 0;
    GC_n_dirty = 0;

    index = 0;
    for (i = 0; i < GC_n_heap_sects; i++) {
    	start = GC_heap_sects[i].hs_start;
        for (h = (struct hblk *)start;
             h < (struct hblk *)(start + GC_heap_sects[i].hs_bytes);
             h++) {
             GC_update_check_page(h, index);
             index++;
             if (index >= NSUMS) goto out;
        }
    }
out:
    GC_printf2("Checked %lu clean and %lu dirty pages\n",
    	      (unsigned long) GC_n_clean, (unsigned long) GC_n_dirty);
    if (GC_n_dirty_errors > 0) {
        GC_printf1("Found %lu dirty bit errors\n",
        	   (unsigned long)GC_n_dirty_errors);
    }
    if (GC_n_changed_errors > 0) {
    	GC_printf1("Found %lu changed bit errors\n",
        	   (unsigned long)GC_n_changed_errors);
	GC_printf0("These may be benign (provoked by nonpointer changes)\n");
#	ifdef THREADS
	    GC_printf0(
	    "Also expect 1 per thread currently allocating a stubborn obj.\n");
#	endif
    }
}

# else

extern int GC_quiet;
	/* ANSI C doesn't allow translation units to be empty.	*/
	/* So we guarantee this one is nonempty.		*/

# endif /* CHECKSUMS */


text:
import { Injectable } from '@angular/core';
import {BehaviorSubject} from "rxjs";

@Injectable()
export class PreferencesService {

  private preferences_source = new BehaviorSubject<any>({
    // Default preferences
    language_code: 'en'
  });
  public preferences$ = this.preferences_source.asObservable();

  constructor() {
    let saved_preferences = window.localStorage.getItem("preferences");
    if (saved_preferences !== null) {
      this.preferences_source.next(JSON.parse(saved_preferences))
    }
  }

  // this.setPref('language_code', "en")
  public setPref = (pref_key, pref_val) => {
    let preferences_object = this.preferences_source.value;
    preferences_object[pref_key] = pref_val;
    window.localStorage.setItem("preferences", JSON.stringify(preferences_object));
    this.preferences_source.next(preferences_object);
  };

  // this.getPref('language_code')
  public getPref(pref_key) {
    let preferences_object = this.preferences_source.value;
    return preferences_object.hasOwnProperty(pref_key) ? preferences_object[pref_key] : null;
  }

}