text:
BASE.require([
    "jQuery",
    "BASE.util.Observable",
    "BASE.web.Route",
    "components.material.segues.InertSegue"
], function () {
    BASE.namespace("components.ui.states");
    var Future = BASE.async.Future;
    var InertSegue = components.material.segues.InertSegue;
    var emptyFuture = Future.fromResult(undefined);
    var defaultAppearSegue = new InertSegue();
    var defaultDisappearSegue = new InertSegue();

    var emptyFn = function () {
        return undefined;
    };

    components.ui.states.UIStateManager = function (elem, tags) {
        var self = this;
        BASE.util.Observable.call(self);

        var $elem = $(elem);
        var $statesContainer = $(tags['states-container']);

        var initialized = false;
        var activeStates = [];
        var states = {};
        var transitions = Future.fromResult();

        var autoInit;
        if (typeof $(elem).attr("autoinit") === "undefined") {
            autoInit = true;
        } else if ($(elem).attr("autoinit") === "true") {
            autoInit = true;
        } else {
            autoInit = false;
        }

        var recoverFuture = function (future) {
            return future.catchCanceled(emptyFn)["catch"](emptyFn);
        };

        var invokeMethodIfExist = function (controller, methodName, args) {
            var returnValue = emptyFuture;

            if (!Array.isArray(args)) {
                args = [];
            }

            if (controller) {
                var method = controller[methodName];
                if (typeof method === "function") {
                    returnValue = method.apply(controller, args);

                    if (!(returnValue instanceof Future)) {
                        returnValue = Future.fromResult(returnValue);
                    }

                }
            }

            return recoverFuture(returnValue);
        };

        var setLayerPrecedence = function () {
            var activeStateHash = activeStates.reduce(function (activeStateHash, state, index) {
                activeStateHash[state.name] = index + 2;
                return activeStateHash;
            }, {});

            Object.keys(states).forEach(function (name) {
                var $element = $(states[name]);

                if (typeof activeStateHash[name] === "number") {
                    $element.css("z-index", activeStateHash[name]);
                } else {
                    $element.addClass("inactive");
                    $element.css("z-index", 1);
                }
            });
        };

        var hasSegue = function (options) {
            return typeof options !== "undefined" && options !== null &&
                typeof options.segue !== "undefined" && options.segue !== null &&
                typeof options.segue.executeAsync === "function";
        };

        var pushAsync = function (element, options) {
            if (typeof element === "undefined") {
                throw new Error("All states need to have a 'name' attribute.");
            }

            return new Future(function (setValue) {
                transitions = recoverFuture(transitions).chain(function (name) {
                    var segue = defaultAppearSegue;

                    if (hasSegue(options)) {
                        segue = options.segue;
                    }

                    var $element = $(element);

                    $element.removeClass("inactive");

                    var prepareFutureArray = [];
                    var name = element.getAttribute("name");

                    var topState = self.getActiveState();
                    if (topState && topState.element === element) {
                        self.updateState(options);
                        setValue(name);
                        return Future.fromResult();
                    }

                    options = options || {};
                    var topStateElement = null;

                    var stateObject = {
                        element: element,
                        name: name,
                        options: options
                    };

                    if (topState) {
                        topStateElement = topState.element;
                        var $topElement = $(topStateElement);
                        var topStateController = $topElement.controller();
                        prepareFutureArray.push(invokeMethodIfExist(topStateController, "prepareToDeactivate"));
                        prepareFutureArray.push(invokeMethodIfExist(topStateController, "prepareToDeactivateAsync"));
                    }

                    var pushToElementController = $element.controller();
                    prepareFutureArray.push(invokeMethodIfExist(pushToElementController, "prepareToActivate", [stateObject.options]));
                    prepareFutureArray.push(invokeMethodIfExist(pushToElementController, "prepareToActivateAsync", [stateObject.options]));

                    prepareFutureArray.push(recoverFuture(segue.executeAsync(topStateElement, $element[0])));
                    return Future.all(prepareFutureArray).chain(function () {
                        if (topStateController) {
                            invokeMethodIfExist(topStateController, "stateBlur")["try"]();
                            invokeMethodIfExist(topStateController, "deactivated")["try"]();
                        }

                        activeStates.push(stateObject);
                        $element.removeClass("inactive");
                        setLayerPrecedence();

                        invokeMethodIfExist(pushToElementController, "stateActive", [stateObject.options])["try"]();
                        invokeMethodIfExist(pushToElementController, "activated", [stateObject.options])["try"]();

                        setValue(stateObject.name);
                    });
                })["try"]();

            });
        };

        var popAsync = function (options) {
            return new Future(function (setValue) {
                transitions = recoverFuture(transitions).chain(function () {
                    if (activeStates.length > 1) {
                        var segue = defaultDisappearSegue;

                        if (hasSegue(options)) {
                            segue = options.segue;
                        }

                        var topState = activeStates.pop();
                        var $topElement = $(topState.element);
                        var topElementController = $topElement.controller();

                        var newTopState = self.getActiveState();
                        var $newTopElement = $(newTopState.element);
                        var newTopElementController = $newTopElement.controller();

                        var prepareFutureArray = [];
                        prepareFutureArray.push(invokeMethodIfExist(topElementController, "prepareToDeactivate"));
                        prepareFutureArray.push(invokeMethodIfExist(topElementController, "prepareToDeactivateAsync"));
                        prepareFutureArray.push(invokeMethodIfExist(newTopElementController, "prepareToActivate"));
                        prepareFutureArray.push(invokeMethodIfExist(newTopElementController, "prepareToActivateAsync"));

                        prepareFutureArray.push(recoverFuture(segue.executeAsync($topElement[0], $newTopElement[0])));

                        return Future.all(prepareFutureArray).chain(function () {
                            var newStateName = $newTopElement.attr("name");

                            /*Blur is not wanted, but we have to keep it for backward comptability*/
                            invokeMethodIfExist(topElementController, "stateBlur")["try"]();
                            invokeMethodIfExist(topElementController, "deactivated")["try"]();

                            if (typeof options === "object" && options !== null) {
                                newTopState.options = options;
                            }

                            setLayerPrecedence();

                            if (newTopState) {
                                /*stateActive and stateFocus are not wanted, but we have to keep it for backward comptability*/
                                invokeMethodIfExist(newTopElementController, "stateActive", [newTopState.options])["try"]();
                                invokeMethodIfExist(newTopElementController, "activated", [newTopState.options])["try"]();
                                invokeMethodIfExist(newTopElementController, "stateFocus")["try"]();
                            }

                            setValue(newTopState.name);
                        });
                    } else {
                        setValue(self.getActiveState().name);
                    }
                })["try"]();
            });
        };

        var replaceAsync = function (element, options) {
            return popAsync().chain(function () {
                return self.pushAsync(element.getAttribute("name"), options);
            });
        };

        var clear = function () {
            $statesContainer.children().each(function () {
                $(this).removeClass("currenty-active-state");
                $(this).addClass("inactive");
            });

            activeStates = [];
        };

        var setStatesAsync = function (newStates) {
            clear();

            return newStates.reduce(function (future, state) {
                return future.chain(function () {
                    return pushAsync(state.state, state.options);
                });
            }, Future.fromResult());
        };

        var updateState = function (options) {
            var stateToBeUpdated = activeStates[activeStates.length - 1];
            stateToBeUpdated.options = options;
            var controller = $(stateToBeUpdated.element).controller();
            invokeMethodIfExist(controller, "updateState", [options]);
        };

        var initialize = function () {
            if (!initialized) {
                initialized = true;
                // Go through the inactive state container, pulling out
                // each state.
                // The default state should be the first one given, or the last one with the
                // [initial] attribute
                // If the element has a controller, try to call "init" on it.
                var initial;
                $statesContainer.children().each(function () {
                    var elem = this;
                    var name = $(elem).attr("name");
                    if (name) {
                        if (!initial) {
                            initial = elem;
                        }
                        states[name] = elem;
                        $(elem).addClass("inactive");
                        if ($(elem).is("[initial]")) {
                            initial = elem;
                        }
                    }
                });

                Object.keys(states).forEach(function (stateName) {
                    var controller = $(states[stateName]).controller();
                    invokeMethodIfExist(controller, "init", [self]);
                });

                var initialName = $(initial).attr("name");
                self.pushAsync(initialName)["try"]();
                $statesContainer.removeClass("initializing");

                setLayerPrecedence();
            }
        };

        self.getActiveState = function () {
            var state = activeStates[activeStates.length - 1];
            return state;
        };

        self.getStateStack = function () {
            return activeStates.map(function (state) {
                return state.name;
            });
        };

        self.push = function (name, options) {
            return self.pushAsync(name, options)["try"]();
        };

        self.pushAsync = function (name, options) {
            var element = states[name];
            return pushAsync(element, options);
        };

        self.pop = function (options) {
            return self.popAsync(options)["try"]();
        };

        self.popAsync = function (options) {
            return popAsync(options);
        };

        self.replace = function (name, options) {
            return replaceAsync(states[name], options)["try"]();
        };

        self.replaceAsync = function (name, options) {
            return replaceAsync(states[name], options);
        };

        self.clear = function () {
            return clear();
        };

        self.getState = function (stateName) {
            return states[stateName];
        };

        self.setStates = function (stateNames) {
            return self.setStatesAsync(stateNames)["try"]();
        };

        self.setStatesAsync = function (stateNames) {
            var newStates = stateNames.map(function (state) {
                return { state: states[state.name], options: state.options };
            });
            return setStatesAsync(newStates);
        };

        self.updateState = function (options) {
            return updateState(options);
        };

        self.data = {};

        self.initialize = function () {
            initialize();
        };

        if (autoInit) {
            self.initialize();
        }
    };
});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources name="ru" flag="ru" title="Russian">
	<string name="_bx_attendant"><![CDATA[Помошник]]></string>
  <string name="_bx_attendant_adm_stg_cpt_type"><![CDATA[Помошник]]></string>
  <string name="_bx_attendant_adm_stg_cpt_category_on_profile_creation"><![CDATA[Высплывающее окно с рекомендованными профилями]]></string>
  <string name="_bx_attendant_adm_stg_on_profile_creation_modules_list"><![CDATA[Список подулей]]></string>
  <string name="_bx_attendant_adm_stg_on_profile_creation_event_list"><![CDATA[Показывать высплывающее окно после]]></string>
  <string name="_bx_attendant_adm_stg_on_profile_after_action_url"><![CDATA[Cсылка для перехода после показа окна]]></string>
  <string name="_bx_attendant_popup_with_recommended_title_default"><![CDATA[Заголовок по умолчанию]]></string>
  <string name="_bx_attendant_popup_with_recommended_description_default"><![CDATA[Текст по умолчанию]]></string>
  <string name="_bx_attendant_popup_with_recommended_button_text"><![CDATA[Продолжить]]></string>
  <string name="_bx_attendant_popup_event_after_registration"><![CDATA[регистрации]]></string>
  <string name="_bx_attendant_popup_event_after_confirmation"><![CDATA[подтверждения аккаунта]]></string>
</resources>

redpajama_set_name: RedPajamaGithub


text:
<TITLE>Review for Relentless (1989)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Relentless (1989)

reviewed by
Randy Parker

                                RELENTLESS
                       A film review by Randy Parker
                        Copyright 1996 Randy Parker

RATING:  **  (out of ****)

(Review written in 1989)

     The newspaper add for RELENTLESS read: "Killers aren't born.
They're made."  Likewise, lousy movies aren't born; they're made--and
director William Lustig has made one.

     In a sense, RELENTLESS is only half bad--the half with Judd Nelson
portraying Buck Taylor, a homicidal maniac who's murdering people selected
at random from the phone book..  Screenwriter Jack Robinson seems to think
he can throw in some flashbacks of Buck's childhood and call it character
psychology; I call it superficial B.S.  We're supposed to sympathize with
Buck because his authoritarian father made him fire guns at age five.  But
as soon as he starts committing the gruesome murders, any sympathy we had
for him immediately flies right out the window.  Buck is despondent because
the police academy has rejected him on the grounds that he's
"psychologically unfit."  Call me an optimist, but there must be a
healthier way to cope with rejection than by killing people.

     According to the production notes, Nelson prepared for the role by
reading books about serial killings.  I would have guessed he prepared by
watching NIGHT OF THE LIVING DEAD 500 times because all he does in the role
is walk around like a zombie, complete with bags under his eyes and greasy,
disheveled hair.  As a psychological character study, RELENTLESS is about
as fresh and satisfying as moldy bread.

     As a buddy-buddy comedy, on the other hand, RELENTLESS has more to
offer.  The movie is nearly saved by the humorous repartee between Robert
Loggia and Leo Rossi who play the investigating homicide detectives.  Rossi
is an earnest ex-New York patrolman who has been promoted to detective in
L.A.  His new partner, Loggia, is a seasoned veteran preparing to retire.
RELENTLESS has fun with the clash between Rossi's anxious, New York
personality and Loggia's laid back California life-style.  Loggia seems
indifferent to the murder victims, showing more interest in the real estate
value of their condos.  Rossi, on the other hand, is almost too eager to
collect clues; he thinks he's Sherlock Holmes.  To a certain extent, the
movie makes up for its cliched story line with its satirical depiction of
the L.A.P.D.  The clever one-liners sprinkled throughout the film keep the
mood from becoming too somber.

     Ultimately, RELENTLESS is done in by its utter predictability.  At
the climax, for example, Buck Taylor threatens to kill Rossi's family; now
where have you seen that before?  RELENTLESS shows few, if any, signs of
imagination or creativity, but that shouldn't stop you from catching it on
cable some night while you're eating last week's leftovers.

---
Randy Parker
rparker@slip.net
http://www.shoestring.org

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package com.navercorp.pinpoint.profiler.context;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;

import com.navercorp.pinpoint.bootstrap.context.ServerMetaData;
import com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder;
import com.navercorp.pinpoint.bootstrap.context.ServiceInfo;

/**
 * @author hyungil.jeong
 */
public class DefaultServerMetaDataHolder implements ServerMetaDataHolder {

    private final List<ServerMetaDataListener> listeners;

    protected String serverName;
    private final List<String> vmArgs;
    private final Map<Integer, String> connectors = new ConcurrentHashMap<Integer, String>();
    protected final Queue<ServiceInfo> serviceInfos = new ConcurrentLinkedQueue<ServiceInfo>();

    public DefaultServerMetaDataHolder(List<String> vmArgs) {
        this.listeners = new ArrayList<ServerMetaDataListener>();
        this.vmArgs = vmArgs;
    }

    @Override
    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    @Override
    public void addConnector(String protocol, int port) {
        this.connectors.put(port, protocol);
    }

    @Override
    public void addServiceInfo(String serviceName, List<String> serviceLibs) {
        ServiceInfo serviceInfo = new DefaultServiceInfo(serviceName, serviceLibs);
        this.serviceInfos.add(serviceInfo);
    }

    @Override
    public void addListener(ServerMetaDataListener listener) {
        this.listeners.add(listener);
    }

    @Override
    public void removeListener(ServerMetaDataListener listener) {
        this.listeners.remove(listener);
    }

    @Override
    public void publishServerMetaData() {
        final ServerMetaData serverMetaData = createServerMetaData();
        for (ServerMetaDataListener listener : this.listeners) {
            listener.publishServerMetaData(serverMetaData);
        }
    }

    private ServerMetaData createServerMetaData() {
        String serverName = this.serverName == null ? "" : this.serverName;
        List<String> vmArgs =
                this.vmArgs == null ? Collections.<String>emptyList() : new ArrayList<String>(this.vmArgs);
        Map<Integer, String> connectors =
                this.connectors.isEmpty() ? Collections.<Integer, String>emptyMap() : new HashMap<Integer, String>(this.connectors);
        List<ServiceInfo> serviceInfos =
                this.serviceInfos.isEmpty() ? Collections.<ServiceInfo>emptyList() : new ArrayList<ServiceInfo>(this.serviceInfos);
        return new DefaultServerMetaData(serverName, vmArgs, connectors, serviceInfos);
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />

    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
    <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.2.min.css" />
    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <title>Contatos</title>

Contatos

Adicionar Novo Contato

Compartilhar

Localizar Contatos

Todos direitos reservados


text:
package com.intellij.openapi.extensions.impl;

import com.intellij.openapi.extensions.AreaInstance;
import com.intellij.openapi.extensions.ExtensionPoint;
import com.intellij.openapi.extensions.Extensions;
import junit.framework.TestCase;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;

import java.util.Arrays;

/**
 * @author Alexander Kireyev
 */
public class ExtensionsComplexTest extends TestCase {
  private static final String PLUGIN_NAME = "the.test.plugin";
  private static final String PLUGIN_NAME_2 = "another.test.plugin";

  private static final String TEST_EP_NAME = "the.test.plugin.extensionPoint";

  private static final String TEST_DEPENDENT1_NAME = "the.test.plugin.dependentOne";
  private static final String TEST_DEPENDENT2_NAME = "the.test.plugin.dependentTwo";
  private static final String TEST_DEPENDENT3_NAME = "another.test.plugin.dependentThree";

  private static final String TEST_DEPENDENT_CHILD_NAME = "the.test.plugin.dependentChildThree";

  private static final String EXTENSION_POINTS_ROOT =
    "<extensionPoints>\n" +
    "  <extensionPoint name=\"extensionPoint\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
    "  <extensionPoint name=\"dependentOne\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectOne\" />\n" +
    "</extensionPoints>";

  private static final String EXTENSION_POINTS_4_AREA =
    "<extensionPoints>\n" +
    "  <extensionPoint name=\"dependentTwo\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectTwo\" area=\"area\"/>\n" +
    "  <extensionPoint name=\"extensionPoint4area\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" area=\"area\" />\n" +
    "</extensionPoints>";

  private static final String EXTENSION_POINTS_4_CHILD_AREA =
    "<extensionPoints>\n" +
    "  <extensionPoint name=\"dependentChildThree\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectThree\" area=\"child_area\"/>\n" +
    "</extensionPoints>";

  private static final String EXTENSIONS_ROOT =
    "  <extensions xmlns=\"the.test.plugin\">\n" +
    "    <extensionPoint>\n" +
    "      <prop1>321</prop1>\n" +
    "    </extensionPoint>\n" +
    "    <dependentOne/>\n" +
    "  </extensions>";

  private static final String EXTENSIONS_ROOT_FAILING =
    "  <extensions>\n" +
    "    <extension point=\"the.test.plugin.extensionPoint\" implementation=\"com.intellij.openapi.extensions.impl.NonCreatableClass\" />\n" +
    "  </extensions>";

  private static final String EXTENSIONS_4_CHILD_AREA =
    "  <extensions xmlns=\"the.test.plugin\">\n" +
    "    <dependentChildThree area=\"child_area\"/>\n" +
    "  </extensions>";

  private static final String EXTENSION_POINTS_ROOT_2 =
    "  <extensionPoints>\n" +
    "    <extensionPoint name=\"anotherTestEP\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
    "  </extensionPoints>";

  private static final String EXTENSION_POINTS_4_AREA_2 =
    "  <extensionPoints>\n" +
    "    <extensionPoint area=\"area\" name=\"anotherTestEP4area\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
    "    <extensionPoint name=\"dependentThree\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectThree\" area=\"area\"/>\n" +
    "  </extensionPoints>";

  private static final String EXTENSIONS_4_AREA_2 =
    "  <extensions xmlns=\"the.test.plugin\">\n" +
    "    <extensionPoint4area area=\"area\"/>\n" +
    "  </extensions>";

  private static final String EXTENSIONS_4_AREA_2_PLUS =
    "  <extensions xmlns=\"another.test.plugin\">\n" +
    "    <dependentThree area=\"area\"/>\n" +
    "  </extensions>";

  protected void setUp() throws Exception {
    super.setUp();
    Extensions.registerAreaClass("area", null);
    Extensions.registerAreaClass("child_area", "area");
  }

  protected void tearDown() throws Exception {
    disposeAreas("child_area");
    disposeAreas("area");
    for (ExtensionPoint extensionPoint : Extensions.getRootArea().getExtensionPoints()) {
      if (extensionPoint.getName().startsWith(PLUGIN_NAME) || extensionPoint.getName().startsWith(PLUGIN_NAME_2)) {
        Extensions.getRootArea().unregisterExtensionPoint(extensionPoint.getName());
      }
    }
    super.tearDown();
  }

  private static void disposeAreas(final @NonNls String areaClass) {
    for (AreaInstance areaInstance : Extensions.getAllAreas(areaClass)) {
      Extensions.disposeArea(areaInstance);
    }
  }

  public void testPluginInit() throws Exception {
    initExtensionPoints(
      PLUGIN_NAME, "<extensionPoints>\n" +
                   "  <extensionPoint name=\"extensionPoint\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
                   "  <extensionPoint name=\"dependentOne\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectOne\" />\n" +
                   "</extensionPoints>", null);
    initExtensions(
      "  <extensions xmlns=\"the.test.plugin\">\n" +
      "    <extensionPoint>\n" +
      "      <prop1>321</prop1>\n" +
      "    </extensionPoint>\n" +
      "    <dependentOne/>\n" +
      "  </extensions>", null);

    assertTrue(Extensions.getRootArea().hasExtensionPoint("the.test.plugin.extensionPoint"));
    assertEquals(1, Extensions.getExtensions("the.test.plugin.extensionPoint").length);
    assertEquals(321, ((XMLTestBean)Extensions.getRootArea().getExtensionPoint("the.test.plugin.extensionPoint").getExtension()).getProp1());
    assertEquals("the.test.plugin", ((XMLTestBean)Extensions.getRootArea().getExtensionPoint("the.test.plugin.extensionPoint").getExtension()).getPluginId().getIdString());

    DependentObjectOne dependentObjectOne = (DependentObjectOne)Extensions.getRootArea().getExtensionPoint("the.test.plugin.dependentOne").getExtension();
    assertEquals(1, dependentObjectOne.getTestBeans().length);

    AreaInstance areaInstance = new MyAreaInstance();
    Extensions.instantiateArea("area", areaInstance, null);
    initExtensionPoints(
      PLUGIN_NAME,
      "<extensionPoints>\n" +
      "  <extensionPoint name=\"dependentTwo\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectTwo\" area=\"area\"/>\n" +
      "  <extensionPoint name=\"extensionPoint4area\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" area=\"area\" />\n" +
      "</extensionPoints>", areaInstance);

    initExtensions(
      "  <extensions xmlns=\"the.test.plugin\">\n" +
      "    <extensionPoint4area area=\"area\"/>\n" +
      "    <dependentTwo area=\"area\"/>\n" +
      "  </extensions>", areaInstance);

    ExtensionPoint extensionPoint = Extensions.getArea(areaInstance).getExtensionPoint("the.test.plugin.extensionPoint4area");
    assertNotNull(extensionPoint);
    assertSame(areaInstance, extensionPoint.getArea());
    assertNotNull(extensionPoint.getExtension());

    DependentObjectTwo dependentObjectTwo = (DependentObjectTwo)Extensions.getArea(areaInstance).getExtensionPoint("the.test.plugin.dependentTwo").getExtension();
    assertSame(dependentObjectOne, dependentObjectTwo.getOne());
  }

  public void _testPluginInitInAreas() throws Exception {
    initExtensionPoints(PLUGIN_NAME,
                        "<extensionPoints>\n" +
                        "  <extensionPoint name=\"extensionPoint\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
                        "  <extensionPoint name=\"dependentOne\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectOne\" />\n" +
                        "</extensionPoints>", null);
    initExtensionPoints(PLUGIN_NAME_2,
                        "  <extensionPoints>\n" +
                        "    <extensionPoint name=\"anotherTestEP\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
                        "  </extensionPoints>", null);
    initExtensions(EXTENSIONS_ROOT, null);

    AreaInstance areaInstance1 = new MyAreaInstance();
    Extensions.instantiateArea("area", areaInstance1, null);

    initExtensionsInAREA(areaInstance1);

    AreaInstance areaInstance2 = new MyAreaInstance();
    Extensions.instantiateArea("area", areaInstance2, null);

    initExtensionsInAREA(areaInstance2);

    AreaInstance areaInstance3 = new MyAreaInstance();
    Extensions.instantiateArea("area", areaInstance3, null);

    initExtensionsInAREA(areaInstance3);

    checkAreaInitialized(areaInstance1);
    checkAreaInitialized(areaInstance2);
    checkAreaInitialized(areaInstance3);

    MyAreaInstance childAreaInstance1 = new MyAreaInstance();
    Extensions.instantiateArea("child_area", childAreaInstance1, areaInstance1);
    initExtensionsInCHILD_AREA(childAreaInstance1);
    MyAreaInstance childAreaInstance2 = new MyAreaInstance();
    Extensions.instantiateArea("child_area", childAreaInstance2, areaInstance2);
    initExtensionsInCHILD_AREA(childAreaInstance2);

    // check initialization through PicoContainer
    DependentObjectOne dependentObjectOne = (DependentObjectOne)Extensions.getRootArea().getExtensionPoint(TEST_DEPENDENT1_NAME).getExtension();
    assertEquals(1, dependentObjectOne.getTestBeans().length);
    DependentObjectTwo dependentObjectTwo = (DependentObjectTwo)Extensions.getArea(areaInstance1).getExtensionPoint(TEST_DEPENDENT2_NAME).getExtension();
    assertSame(dependentObjectOne, dependentObjectTwo.getOne());
    DependentObjectThree dependentObjectThree = (DependentObjectThree)Extensions.getArea(areaInstance1).getExtensionPoint(TEST_DEPENDENT3_NAME).getExtension();
    assertSame(dependentObjectOne, dependentObjectThree.getOne());
    assertSame(dependentObjectTwo, dependentObjectThree.getTwo());
    assertTrue(Arrays.asList(dependentObjectThree.getTestBeans()).containsAll(Arrays.asList(dependentObjectOne.getTestBeans())));

    // check PicoContainers
    assertTrue(Extensions.getRootArea().getPicoContainer().getComponentInstances().contains(dependentObjectOne));
    assertTrue(Extensions.getArea(areaInstance1).getPicoContainer().getComponentInstances().contains(dependentObjectTwo));
    assertTrue(Extensions.getArea(areaInstance1).getPicoContainer().getComponentInstances().contains(dependentObjectThree));
    assertFalse(Extensions.getArea(areaInstance2).getPicoContainer().getComponentInstances().contains(dependentObjectThree));

    assertTrue(Extensions.getRootArea().getPluginContainer(PLUGIN_NAME).getComponentInstances().contains(dependentObjectOne));
    assertFalse(Extensions.getRootArea().getPluginContainer(PLUGIN_NAME_2).getComponentInstances().contains(dependentObjectOne));
    assertTrue(Extensions.getArea(areaInstance1).getPluginContainer(PLUGIN_NAME).getComponentInstances().contains(dependentObjectTwo));
    assertFalse(Extensions.getArea(areaInstance1).getPluginContainer(PLUGIN_NAME_2).getComponentInstances().contains(dependentObjectTwo));
    assertTrue(Extensions.getArea(areaInstance1).getPluginContainer(PLUGIN_NAME_2).getComponentInstances().contains(dependentObjectThree));

    // check area inheritance
    DependentObjectThree dependentChild1 = (DependentObjectThree)Extensions.getArea(childAreaInstance1).getExtensionPoint(TEST_DEPENDENT_CHILD_NAME).getExtension();
    DependentObjectThree dependentChild2 = (DependentObjectThree)Extensions.getArea(childAreaInstance2).getExtensionPoint(TEST_DEPENDENT_CHILD_NAME).getExtension();
    assertSame(dependentObjectTwo, dependentChild1.getTwo());
    assertNotSame(dependentObjectTwo, dependentChild2.getTwo());

    // Check extensions
    assertNotSame(Extensions.getArea(areaInstance1).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions()[0],
                  Extensions.getArea(areaInstance2).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions()[0]);

    XMLTestBean ownExtension = new XMLTestBean();
    ownExtension.setProp1(54321);
    Extensions.getArea(areaInstance1).getExtensionPoint("the.test.plugin.extensionPoint4area").registerExtension(ownExtension);
    ExtensionPoint ep = Extensions.getArea(areaInstance2).getExtensionPoint("the.test.plugin.extensionPoint4area");
    ep.unregisterExtension(ep.getExtension());
    ep.unregisterExtension(ep.getExtension());
    assertEquals(3, Extensions.getArea(areaInstance1).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions().length);
    assertEquals(54321, ((XMLTestBean)Extensions.getArea(areaInstance1).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions()[2]).getProp1());
    assertEquals(0, Extensions.getArea(areaInstance2).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions().length);
    assertEquals(2, Extensions.getArea(areaInstance3).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions().length);
  }

  private void initExtensionsInCHILD_AREA(final MyAreaInstance childAreaInstance1) {
    initExtensionPoints(PLUGIN_NAME, EXTENSION_POINTS_4_CHILD_AREA, childAreaInstance1);
    initExtensions(EXTENSIONS_4_CHILD_AREA, childAreaInstance1);
  }

  private void initExtensionsInAREA(final AreaInstance areaInstance1) {
    initExtensionPoints(PLUGIN_NAME, EXTENSION_POINTS_4_AREA, areaInstance1);
    initExtensionPoints(PLUGIN_NAME_2, EXTENSION_POINTS_4_AREA_2, areaInstance1);
    initExtensions("  <extensions xmlns=\"the.test.plugin\">\n" +
                   "    <extensionPoint4area area=\"area\"/>\n" +
                   "    <dependentTwo area=\"area\"/>\n" +
                   "  </extensions>", areaInstance1);
    initExtensions(EXTENSIONS_4_AREA_2, areaInstance1);
    initExtensions(EXTENSIONS_4_AREA_2_PLUS, areaInstance1);
  }

  private static void checkAreaInitialized(AreaInstance areaInstance) {
    assertNotNull(Extensions.getArea(areaInstance).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtension());
    assertEquals(2, Extensions.getArea(areaInstance).getExtensionPoint("the.test.plugin.extensionPoint4area").getExtensions().length);
    assertTrue(Extensions.getArea(areaInstance).hasExtensionPoint("another.test.plugin.anotherTestEP4area"));
  }

  private static void initExtensionPoints(@NonNls String pluginName, @NonNls String data, AreaInstance instance) {
    final Element element = ExtensionComponentAdapterTest.readElement(data);
    for (final Object o : element.getChildren()) {
      Element child = (Element)o;
      Extensions.getArea(instance).registerExtensionPoint(pluginName, child);
    }
  }

  private static void initExtensions(@NonNls String data, AreaInstance instance) {
    final Element element = ExtensionComponentAdapterTest.readElement(data);
    for (final Object o : element.getChildren()) {
      Element child = (Element)o;
      Extensions.getArea(instance).registerExtension(element.getNamespaceURI(), child);
    }
  }

  private static class MyAreaInstance implements AreaInstance {}
}


text:
<PackageItem xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.sdltridion.com/ContentManager/ImportExport/Package/2013">
  <Data>
    <tcm:Data>
      <tcm:Title>test-exclude-for-mobile</tcm:Title>
      <tcm:Type>Normal</tcm:Type>
      <tcm:Schema xlink:type="simple" xlink:title="Article" xlink:href="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Modules/Core/Editor/Schemas/Article.xsd" IsMandatory="false" />
      <tcm:Content>
        <Article xmlns="http://www.sdl.com/web/schemas/core">
          <headline>test-exclude-for-mobile-headline</headline>
          <articleBody>
            <subheading>test-exclude-for-mobile-subheading</subheading>
            <content>test-exclude-for-mobile-content</content>
          </articleBody>
        </Article>
      </tcm:Content>
      <tcm:Metadata>
        <Metadata xmlns="http://www.sdl.com/web/schemas/core">
          <standardMeta>
            <dateCreated>2016-06-13T15:01:54</dateCreated>
            <description>test-exclude-for-mobile-meta-description</description>
            <name>test-exclude-for-mobile-short-title</name>
            <introText>test-exclude-for-mobile-intro-text</introText>
          </standardMeta>
        </Metadata>
      </tcm:Metadata>
      <tcm:IsBasedOnTridionWebSchema>true</tcm:IsBasedOnTridionWebSchema>
      <tcm:MultimediaType xlink:type="simple" xlink:title="" xlink:href="tcm:0-0-0" />
    </tcm:Data>
  </Data>
  <Dependencies>
    <Dependency dependencyType="Publication" itemUrl="/webdav/401%20Automated%20Test%20Parent" linkName="LocationInfo/ContextRepository" />
    <Dependency dependencyType="OrganizationalItemFolder" itemUrl="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Content/Test/Smoke/ContextExpression" linkName="LocationInfo/OrganizationalItem" />
    <Dependency dependencyType="Schema" itemUrl="/webdav/401%20Automated%20Test%20Parent/Building%20Blocks/Modules/Core/Editor/Schemas/Article.xsd" linkName="Schema" />
  </Dependencies>
</PackageItem>


text:
package com.android.videoeditor.service;

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

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

/**
 * A pool of Intents
 */
class IntentPool {
    // Logging
    private static final String TAG = "IntentPool";

    // Instance variables
    private final List<Intent> mIntentPool;

    /**
     * Constructor
     *
     * @param initialSize The initial size of the pool
     */
    public IntentPool(int initialSize) {
        mIntentPool = new ArrayList<Intent>(initialSize);
    }

    /**
     * @return The Intent is retrieved from the pool or if the pool is empty
     *      a new Intent is allocated
     */
    public synchronized Intent get(Context context, Class<?> cls) {
        final Intent intent = get();
        intent.setComponent(new ComponentName(context, cls));
        return intent;
    }

    /**
     * @return The Intent is retrieved from the pool or if the pool is empty
     *      a new Intent is allocated
     */
    public synchronized Intent get() {
        if (mIntentPool.size() > 0) {
            final Intent intent = mIntentPool.remove(0);
            // Clear the content of the Intent
            final Bundle extras = intent.getExtras();
            for (String keys : extras.keySet()) {
                intent.removeExtra(keys);
            }
            intent.setComponent(null);
            return intent;
        } else {
            if (Log.isLoggable(TAG, Log.DEBUG)) {
                Log.d(TAG, "Pool enlarged");
            }
            return new Intent();
        }
    }

    /**
     * @param intent Return an Intent to the pool
     */
    public synchronized void put(Intent intent) {
        mIntentPool.add(intent);
    }
}


text:
package main

//
// see directions in pbc.go
//

import "time"
import "viewservice"
import "os"
import "fmt"

func main() {
  if len(os.Args) != 2 {
    fmt.Printf("Usage: viewd port\n")
    os.Exit(1)
  }

  viewservice.StartServer(os.Args[1])

  for { time.Sleep(100 * time.Second) }
}


text:
//-----------------------------------------------------------------------
// <copyright file="DataAnnotationsTests.cs" company="Marimer LLC">
//     Copyright (c) Marimer LLC. All rights reserved.
//     Website: https://cslanet.com
// </copyright>
// <summary>no summary</summary>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Csla;
using Csla.Core.FieldManager;
using Csla.Rules;
using Csla.Serialization;
using UnitDriven;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

#if NUNIT
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestSetup = NUnit.Framework.SetUpAttribute;
#elif MSTEST
using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif

namespace Csla.Test.DataAnnotations
{
#if TESTING
  [System.Diagnostics.DebuggerNonUserCode]
#endif
  [TestClass]
  public class DataAnnotationsTests : TestBase
  {
    [TestMethod]
    public async Task SingleAttribute()
    {
      var context = GetContext();

      var dp = new Csla.DataPortal<Single>();
      var root = await dp.CreateAsync();
      var rules = root.GetRules();

      Assert.AreEqual(1, rules.Length, "Should be 1 rule");
      Assert.IsFalse(root.IsValid, "Obj shouldn't be valid");
      Assert.AreEqual(1, root.BrokenRulesCollection.Count, "Should be 1 broken rule");
      Assert.AreEqual("Name value required", root.BrokenRulesCollection[0].Description, "Desc should match");
      context.Assert.Success();

      context.Complete();
    }

    [TestMethod]
    public async Task MultipleAttributes()
    {
      var context = GetContext();

      var dp = new Csla.DataPortal<Multiple>();
      var root = await dp.CreateAsync();
      var rules = root.GetRules();

      Assert.AreEqual(3, rules.Length, "Should be 3 rules");
      Assert.IsFalse(root.IsValid, "Obj shouldn't be valid");
      Assert.AreEqual(1, root.BrokenRulesCollection.Count, "Should be 1 broken rule");
      root.Name = "xyz";
      Assert.AreEqual(2, root.BrokenRulesCollection.Count, "Should be 2 broken rules after edit");
      context.Assert.Success();

      context.Complete();
    }

    [TestMethod]
    public async Task CustomAttribute()
    {
      var context = GetContext();

      var dp = new Csla.DataPortal<Custom>();
      var root = await dp.CreateAsync();
      var rules = root.GetRules();

      Assert.AreEqual(1, rules.Length, "Should be 1 rule");
      Assert.IsFalse(root.IsValid, "Obj shouldn't be valid");
      Assert.AreEqual(1, root.BrokenRulesCollection.Count, "Should be 1 broken rule");
      Assert.AreEqual("Name must be abc", root.BrokenRulesCollection[0].Description, "Desc should match");
      context.Assert.Success();

      context.Complete();
    }

    [TestMethod]
    public void MultipleMetaRules()
    {
      var obj = new MultipleMeta();

      var typeRules = obj.GetRegisteredRules();
      // 4 rules from metadatacalss and 1 rule from autogenerated class.
      Assert.AreEqual(5, typeRules.Rules.Count);
      Assert.AreEqual(3, typeRules.Rules.Where(p => p.PrimaryProperty == MultipleMeta.AmountProperty).Count());
      Assert.AreEqual(2, typeRules.Rules.Where(p => p.PrimaryProperty == MultipleMeta.QuantityProperty).Count());
    }
	}

  [Serializable]
  public class Single : BusinessBase<Single>
  {
    private static PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
    [Required(ErrorMessage = "Name value required")]
    public string Name
    {
      get { return GetProperty(NameProperty); }
      set { SetProperty(NameProperty, value); }
    }

    public string[] GetRules()
    {
      return BusinessRules.GetRuleDescriptions();
    }
  }

  [Serializable]
  public class Multiple : BusinessBase<Multiple>
  {
    private static PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
    [Required(ErrorMessage = "Name value required")]
    [RegularExpression("[0-9]")]
    [System.ComponentModel.DataAnnotations.Range(typeof(string), "0", "9")]
    public string Name
    {
      get { return GetProperty(NameProperty); }
      set { SetProperty(NameProperty, value); }
    }

    public string[] GetRules()
    {
      return BusinessRules.GetRuleDescriptions();
    }
  }

  [Serializable]
  public class Custom : BusinessBase<Custom>
  {
    private static PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
    [TestRule]
    public string Name
    {
      get { return GetProperty(NameProperty); }
      set { SetProperty(NameProperty, value); }
    }

    public string[] GetRules()
    {
      return BusinessRules.GetRuleDescriptions();
    }
  }

  public class TestRuleAttribute : ValidationAttribute
  {
    protected override ValidationResult IsValid(object value, ValidationContext validationContext)
    {
      if (validationContext.ObjectInstance == null)
        return new ValidationResult("ObjectInstance is null");
      var obj = validationContext.ObjectInstance as Custom;
      if (obj == null)
        return new ValidationResult("ObjectInstance is not the Custom type");
      if (string.IsNullOrEmpty(obj.Name) || obj.Name != "abc")
        return new ValidationResult("Name must be abc");
      return null;
    }
  }

  [Serializable()]
  public partial class MultipleMeta : Csla.BusinessBase<MultipleMeta>
  {
      public static PropertyInfo<decimal> AmountProperty = RegisterProperty<decimal>(p => p.Amount);

      [Required(ErrorMessage="Please enter an amount")]
      public decimal Amount
      {
          get { return GetProperty(AmountProperty); }
          set { SetProperty(AmountProperty, value); }
      }

      public static readonly PropertyInfo<int> QuantityProperty = RegisterProperty<int>(c => c.Quantity);
      public int Quantity
      {
        get { return GetProperty(QuantityProperty); }
        set { SetProperty(QuantityProperty, value); }
      }
  }

  public class MultipleMetaDataClass
  {
      [Required(ErrorMessage = "Amount is required")]
      [Range(typeof(decimal), "1", "100", ErrorMessage = "Please enter a value between 1 and 100")]
      public System.Decimal Amount { get; set; }

      [Required(ErrorMessage = "Quantity is required")]
      [Range(1, 100, ErrorMessage = "Please enter a value between 1 and 100")]
      public System.Int32 Quantity { get; set; }

  }
	  /// <summary>
  /// Non-Generate code that can be modified
  /// </summary>
  [MetadataType(typeof(MultipleMetaDataClass))]
  public partial class MultipleMeta : Csla.BusinessBase<MultipleMeta>
  {
    public new BusinessRuleManager GetRegisteredRules()
    {
      return base.GetRegisteredRules();
    }
  }
}


text:
/**
 *
 */
package com.intelligentsia.dowsers.entity.meta.provider;

import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.intelligentsia.dowsers.core.reflection.ClassInformation;
import org.intelligentsia.dowsers.core.reflection.Reflection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.intelligentsia.dowsers.entity.Entity;
import com.intelligentsia.dowsers.entity.annotation.Attribute;
import com.intelligentsia.dowsers.entity.annotation.DomainEntity;
import com.intelligentsia.dowsers.entity.annotation.IgnoreAttribute;
import com.intelligentsia.dowsers.entity.meta.MetaAttribute;
import com.intelligentsia.dowsers.entity.meta.MetaEntity;
import com.intelligentsia.dowsers.entity.meta.MetaEntityProvider;
import com.intelligentsia.dowsers.entity.meta.MetaModel;
import com.intelligentsia.dowsers.entity.reference.Reference;

/**
 * MetaEntityProviderAnalyzer implements {@link MetaEntityProvider}
 * by analyzing specified {@link Entity} class in {@link Reference}.
 *
 * @author Jerome Guibert
 *
 */
public class MetaEntityProviderAnalyzer implements MetaEntityProvider {

	/**
	 * {@link Logger} instance.
	 */
	private final static Logger logger = LoggerFactory.getLogger(MetaEntityProviderAnalyzer.class);

	/**
	 * Build a new instance of MetaEntityProviderAnalyzer.
	 */
	public MetaEntityProviderAnalyzer() {
		super();
	}

	/**
	 * @see com.intelligentsia.dowsers.entity.meta.MetaEntityProvider#find(com.intelligentsia.dowsers.entity.reference.Reference)
	 */
	@Override
	public Collection<MetaEntity> find(final Reference reference) throws NullPointerException {
		Preconditions.checkNotNull(reference);
		final Collection<MetaEntity> result = Sets.newLinkedHashSet();
		if (reference.isIdentifier()) {
			return result;
		}
		// obtain class information
		final ClassInformation classInformation = ClassInformation.parse(reference.getEntityClassName());
		// analyze
		final MetaEntity metaEntity = analyze(classInformation);
		if (metaEntity != null) {
			if (!metaEntity.metaAttributes().isEmpty()) {
				result.add(metaEntity);
			}
		}
		return result;
	}

	/**
	 * @param classInformation
	 *            class Information to analyze
	 * @return a {@link MetaEntity} instance
	 * @throws NullPointerException
	 *             if classInformation is null
	 */
	@VisibleForTesting
	static MetaEntity analyze(final ClassInformation classInformation) throws NullPointerException {
		Preconditions.checkNotNull(classInformation);
		final Class<?> clazz = classInformation.getType();
		// init builder with class name and MetaModel version.
		final MetaEntity.Builder builder = MetaEntity.builder().name(clazz.getName()).version(MetaModel.VERSION);
		// analyze attributes
		final Iterator<MetaAttribute> iterator = analyzeMetaAttribute(clazz).iterator();
		while (iterator.hasNext()) {
			builder.metaAttribute(iterator.next());
		}
		return builder.build();
	}

	/**
	 * Analyze MetaAttribute on specified class.
	 *
	 * @param clazz
	 * @return an instance of {@link List} of {@link MetaAttribute}
	 * @throws NullPointerException
	 *             if clazz is null
	 * @throws IllegalArgumentException
	 *             if something was wrong with attribute declaration
	 */
	@VisibleForTesting
	static Collection<MetaAttribute> analyzeMetaAttribute(final Class<?> clazz) throws NullPointerException, IllegalArgumentException {
		final Map<String, MetaAttribute> attributes = Maps.newHashMap();
		Preconditions.checkNotNull(clazz);

		// auto discover attributes
		final DomainEntity domainEntity = clazz.getAnnotation(DomainEntity.class);
		final boolean autoDiscovering = domainEntity != null ? domainEntity.autoDiscovering() : Boolean.TRUE;

		// for each method
		for (final Method method : clazz.getMethods()) {
			if (hasAttributeSignature(method, autoDiscovering)) {
				final String name = extractName(method);
				if (!attributes.containsKey(name)) {
					final Class<?> valueClass = extractValueClass(method);
					logger.debug("Find attribute {}:{}", name, valueClass.getName());
					attributes.put(name, MetaAttribute.builder().name(name).valueClass(valueClass).build());
				}
			}
		}

		// check for Identity attribute
		if (!attributes.containsKey(MetaModel.getIdentityAttribute().name())) {
			attributes.put(MetaModel.getIdentityAttribute().name(), MetaModel.getIdentityAttribute());
		} else {
			// check Identity attribute compliance
			if (!attributes.get(MetaModel.getIdentityAttribute().name()).equals(MetaModel.getIdentityAttribute())) {
				throw new IllegalArgumentException("Declared 'identity' attribute must be a Reference type");
			}
		}
		return attributes.values();
	}

	/**
	 * Extract a method name.
	 *
	 * @param method
	 * @return a name
	 */
	@VisibleForTesting
	static String extractName(final Method method) {
		final String name = method.getName();
		if (name.startsWith("get") || name.startsWith("set")) {
			return Reflection.toFieldName(name);
		}
		return Reflection.uncapitalize(name);
	}

	/**
	 * @param method
	 * @return class type
	 */
	@VisibleForTesting
	static Class<?> extractValueClass(final Method method) {
		final Attribute attribute = method.getAnnotation(Attribute.class);
		if (attribute != null) {
			if (null != attribute.type()) {
				if (Void.TYPE != attribute.type()) {
					return attribute.type();
				}
			}
		}
		if (Void.TYPE == method.getReturnType()) {
			return method.getParameterTypes()[0];
		}
		return method.getReturnType();
	}

	/**
	 * Check if the specified method can be an attribute.
	 *
	 * @param method
	 * @return true if specified method can be an attribute, false other else.
	 */
	@VisibleForTesting
	static boolean hasAttributeSignature(final Method method, final boolean autoDiscovering) {
		if (method.getAnnotation(IgnoreAttribute.class) != null) {
			return false;
		}
		if (!autoDiscovering && (method.getAnnotation(Attribute.class) == null)) {
			return false;
		}
		if (Void.TYPE == method.getReturnType()) {
			return method.getParameterTypes().length == 1;
		} else {
			return method.getParameterTypes().length == 0;
		}

	}
}


text:
namespace LoyaltyProgram
{
  using System;
  using System.Collections.Generic;
  using System.Security.Claims;
  using Nancy;
  using Nancy.Bootstrapper;
  using Nancy.TinyIoc;
  using Nancy.Owin;

  public class Bootstrapper : DefaultNancyBootstrapper
  {
    protected override Func<ITypeCatalog, NancyInternalConfiguration> InternalConfiguration
     => NancyInternalConfiguration.WithOverrides(builder => builder.StatusCodeHandlers.Clear());

    protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
    {
      pipelines.OnError += (ctx, ex) =>
      {
        // write to central log store
        return null;
      };
    }
  }

  public class SetUser : IRequestStartup
  {
    public void Initialize(IPipelines pipelines, NancyContext context) =>
      context.CurrentUser = context.GetOwinEnvironment()["pos-end-user"] as ClaimsPrincipal;
  }
}


text:
/**
 * @file   ArgumentParser.hpp
 * @brief  ArgumentParser class prototype.
 * @author zer0
 * @date   2019-10-09
 */

#ifndef __INCLUDE_LIBTBAG__LIBTBAG_STRING_ARGUMENTPARSER_HPP__
#define __INCLUDE_LIBTBAG__LIBTBAG_STRING_ARGUMENTPARSER_HPP__

// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include <libtbag/config.h>
#include <libtbag/predef.hpp>
#include <libtbag/ErrPair.hpp>
#include <libtbag/Type.hpp>
#include <libtbag/string/StringUtils.hpp>

#include <vector>
#include <string>
#include <map>
#include <functional>
#include <memory>
#include <iterator>
#include <type_traits>

// -------------------
NAMESPACE_LIBTBAG_OPEN
// -------------------

namespace string {

/**
 * ArgumentParser class prototype.
 *
 * @author zer0
 * @date   2019-10-09
 */
class TBAG_API ArgumentParser
{
public:
    struct InitParams;
    struct Param;
    struct ArgumentResult;

    using Params = std::vector<Param>;
    using ErrArgumentResult = ErrPair<ArgumentResult>;

    using Optionals = std::multimap<std::string, std::string>;
    using Positionals = std::map<std::string, std::string>;

    struct ArgumentResult
    {
        std::string program_name;
        Optionals optional;
        Positionals positional;
        std::vector<std::string> remain;

        std::size_t countOptional(std::string const & key) const
        { return optional.count(key); }

        std::vector<std::string> getOptionals(std::string const & key) const
        {
            std::vector<std::string> result;
            auto const range = optional.equal_range(key);
            for (auto itr = range.first; itr != range.second; ++itr) {
                result.emplace_back(itr->second);
            }
            return result;
        }

        std::string getOptional(std::string const & key, std::size_t index = 0, Err * code = nullptr) const
        {
            auto const range = optional.equal_range(key);
            auto const size = static_cast<std::size_t>(std::distance(range.first, range.second));
            if (index >= size) {
                if (code) {
                    *code = E_INDEX;
                }
                return {};
            } else {
                if (code) {
                    *code = E_SUCCESS;
                }
                return std::next(range.first, index)->second;
            }
        }

        template <typename ResultT>
        ResultT optOptional(std::string const & key, std::size_t index = 0, ResultT const & def = ResultT{}) const
        {
            Err code = E_UNKNOWN;
            auto const value = getOptional(key, index, &code);
            if (isFailure(code)) {
                return def;
            } else {
                return libtbag::string::toValue<ResultT>(value, def);
            }
        }

        std::string getPositional(std::string const & key) const
        {
            auto itr = positional.find(key);
            if (itr == positional.end()) {
                return {};
            }
            return itr->second;
        }
    };

    struct Formatter
    {
        Formatter() { /* EMPTY. */ }
        virtual ~Formatter() { /* EMPTY. */ }

        virtual std::string print(InitParams const & init, Params const & params) = 0;
    };

    using SharedFormatter = std::shared_ptr<Formatter>;

    struct TBAG_API DefaultFormatter : public Formatter
    {
        int padding_size = 2;

        DefaultFormatter(int p = 2) : padding_size(p) { /* EMPTY. */ }
        virtual ~DefaultFormatter() { /* EMPTY. */ }

        std::string print(InitParams const & init, Params const & params) override;
    };

    TBAG_CONSTEXPR static char const * const ARGUMENT_DELIMITER = " ";
    TBAG_CONSTEXPR static char const * const KEY_VAL_DELIMITER = "=";

    TBAG_CONSTEXPR static char const DEFAULT_PREFIX = '-';
    TBAG_CONSTEXPR static char const DEFAULT_FROM_FILE_PREFIX = '@';

    struct InitParams
    {
        /** The name of the program. */
        std::string program_name;

        /** The string describing the program usage. */
        std::string usage;

        /** Text to display before the argument help. */
        std::string description;

        /** Text to display after the argument help. */
        std::string epilog;

        /** A class for customizing the help output. */
        SharedFormatter formatter;

        /** The set of characters that prefix optional arguments. */
        char prefix = DEFAULT_PREFIX;

        /** The set of characters that prefix files from which additional arguments should be read. */
        char from_file_prefix = DEFAULT_FROM_FILE_PREFIX;

        /** Add a -- option to the parser. */
        bool add_stop_parsing = true;

        /** The first argument is the program name. */
        bool first_argument_is_program_name = true;

        /**
         * Default value to represent 'not entered'.
         *
         * If this value exists, no error is returned if there is empty 'positional value'.
         */
        std::string not_entered_value;
    };

    enum class ActionType
    {
        AT_NONE,

        /** This just stores the argument's value. This is the default action. */
        AT_STORE,

        /** This stores the value specified by the const keyword argument. */
        AT_STORE_CONST,

        /**
         * This stores a list, and appends each argument value to the list.
         * This is useful to allow an option to be specified multiple times.
         */
        AT_APPEND,
    };

    TBAG_CONSTEXPR static char const * const ACTION_TYPE_STORE = "store";
    TBAG_CONSTEXPR static char const * const ACTION_TYPE_STORE_CONST = "store_const";
    TBAG_CONSTEXPR static char const * const ACTION_TYPE_APPEND = "append";
    TBAG_CONSTEXPR static char const * const VAL_TRUE_TEXT = "true";
    TBAG_CONSTEXPR static char const * const VAL_FALSE_TEXT = "false";

    static char const * getActionTypeName(ActionType type) TBAG_NOEXCEPT;
    static ActionType getActionType(std::string const & action_name);

    struct ParamElem
    {
        std::string key;
        std::string val;
    };

    struct ParamKey
    {
        char const * key;

        ParamElem operator =(char const * v) const
        { return ParamElem{key, v}; }
        ParamElem operator =(std::string const & v) const
        { return ParamElem{key, v}; }
        ParamElem operator =(std::string && v) const
        { return ParamElem{key, std::move(v)}; }

        // clang-format off
        ParamElem operator =(bool           v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(char           v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(short          v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(int            v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(long           v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(unsigned char  v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(unsigned short v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(unsigned int   v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(unsigned long  v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(float          v) const { return ParamElem{key, std::to_string(v)}; }
        ParamElem operator =(double         v) const { return ParamElem{key, std::to_string(v)}; }
        // clang-format on
    };

    // clang-format on
    TBAG_CONSTEXPR static char const * const ARG_NAME_KEY = "name";
    TBAG_CONSTEXPR static char const * const ARG_DEST_KEY = "dest";
    TBAG_CONSTEXPR static char const * const ARG_ACTION_KEY = "action";
    TBAG_CONSTEXPR static char const * const ARG_STORE_KEY = "store";
    TBAG_CONSTEXPR static char const * const ARG_STORE_CONST_KEY = "store_const";
    TBAG_CONSTEXPR static char const * const ARG_APPEND = "append";
    TBAG_CONSTEXPR static char const * const ARG_DEFAULT_KEY = "default";
    TBAG_CONSTEXPR static char const * const ARG_CONST_KEY = "const";
    TBAG_CONSTEXPR static char const * const ARG_HELP_KEY = "help";
    TBAG_CONSTEXPR static char const * const ARG_META_KEY = "meta";
    // clang-format off

    /**
     * @defgroup __DOXYGEN_GROUP__ARGUMENT_PARSER_DICTIONARY__ ArgumentParser Dictionary
     * @{
     */
    static ParamKey  const name;
    static ParamKey  const dest;
    static ParamKey  const action;
    static ParamKey  const default_value;
    static ParamKey  const const_value;
    static ParamKey  const help;
    static ParamKey  const meta;
    static ParamElem const store;
    static ParamElem const store_const;
    static ParamElem const append;
    /** @} */

    struct Param TBAG_FINAL
    {
        /**
         * Either a name or a list of option strings,
         * e.g. foo or -f, --foo.
         */
        std::vector<std::string> names;

        /** The basic type of action to be taken when this argument is encountered at the command line. */
        ActionType action = ActionType::AT_STORE;

        /** The name of the attribute to be added. */
        std::string dest;

        /** The value produced if the argument is absent from the command line. */
        std::string default_value;

        /** A constant value required by some action and nargs selections. */
        std::string const_value;

        /** A brief description of what the argument does. */
        std::string help;

        /** A name for the argument in usage messages. */
        std::string meta;

        friend Param & operator << (Param & a, ParamElem const & elem)
        {
            if (elem.key == ARG_NAME_KEY) {
                a.names.emplace_back(elem.val);
            } else if (elem.key == ARG_DEST_KEY) {
                a.dest = elem.val;
            } else if (elem.key == ARG_ACTION_KEY) {
                a.action = getActionType(elem.val);
            } else if (elem.key == ARG_STORE_KEY) {
                a.action = ActionType::AT_STORE;
            } else if (elem.key == ARG_STORE_CONST_KEY) {
                a.action = ActionType::AT_STORE_CONST;
            } else if (elem.key == ARG_APPEND) {
                a.action = ActionType::AT_APPEND;
            } else if (elem.key == ARG_DEFAULT_KEY) {
                a.default_value = elem.val;
            } else if (elem.key == ARG_CONST_KEY) {
                a.const_value = elem.val;
            } else if (elem.key == ARG_HELP_KEY) {
                a.help = elem.val;
            } else if (elem.key == ARG_META_KEY) {
                a.meta = elem.val;
            }
            return a;
        }
    };

private:
    InitParams _init;
    Params _params;

public:
    ArgumentParser();
    ArgumentParser(std::string const & desc);
    ArgumentParser(std::string const & desc, std::string const & epilog);
    explicit ArgumentParser(InitParams const & params);
    explicit ArgumentParser(InitParams && params);
    ArgumentParser(ArgumentParser const & obj);
    ArgumentParser(ArgumentParser && obj) TBAG_NOEXCEPT;
    virtual ~ArgumentParser();

public:
    ArgumentParser & operator =(ArgumentParser const & obj);
    ArgumentParser & operator =(ArgumentParser && obj) TBAG_NOEXCEPT;

public:
    void swap(ArgumentParser & obj) TBAG_NOEXCEPT;
    inline friend void swap(ArgumentParser & lh, ArgumentParser & rh) TBAG_NOEXCEPT
    { lh.swap(rh); }

public:
    inline InitParams       & init()       TBAG_NOEXCEPT { return _init; }
    inline InitParams const & init() const TBAG_NOEXCEPT { return _init; }

    inline Params       & params()       TBAG_NOEXCEPT { return _params; }
    inline Params const & params() const TBAG_NOEXCEPT { return _params; }

public:
    inline bool empty() const TBAG_NOEXCEPT_SP_OP(_params.empty())
    { return _params.empty(); }
    inline std::size_t size() const TBAG_NOEXCEPT_SP_OP(_params.size())
    { return _params.size(); }

public:
    void clear();

public:
    static bool isLongOptional(std::string const & name, char prefix);
    static bool isShortOptional(std::string const & name, char prefix);
    static bool isPositional(std::string const & name, char prefix);
    static std::size_t calcMaxNameSize(Params const & params);
    static std::vector<std::string> normalizeParamNames(std::vector<std::string> const & names, char prefix);
    static void getOptionalsAndPositionals(Params const & params, char prefix,
                                           Params & optionals, Params & positionals);
    static std::string removePrefix(std::string const & text, char prefix);

public:
    Params::iterator findParameter(std::string const & option_name);
    Params::const_iterator findConstantParameter(std::string const & option_name) const;

public:
    Err updateParam(Param & arg);

public:
    bool insertToOptional(Optionals & optional, std::string const & dest_name, std::string const & val) const;

private:
    Err add_param(Param const & arg);
    Err add_param(Param && arg);
    Err add_elems(std::vector<ParamElem> const & elems);

    struct add_param_t { /* EMPTY. */ };
    struct add_first_string_param_t { /* EMPTY. */ };
    struct add_param_elems_t { /* EMPTY. */ };

    template <typename ... ArgsT>
    Err add_select(add_param_elems_t, ArgsT && ... args)
    {
        return add_elems({std::forward<ArgsT>(args) ...});
    }

    template <typename ... ArgsT>
    Err add_select(add_first_string_param_t, std::string const & name, ArgsT && ... args)
    {
        return add_param(Param{{name}, std::forward<ArgsT>(args) ...});
    }

    template <typename ... ArgsT>
    Err add_select(add_param_t, ArgsT && ... args)
    {
        return add_param(Param{std::forward<ArgsT>(args) ...});
    }

    template <typename ... T>
    struct is_all_param_elem;

    template <typename Head, typename ... Tail>
    struct is_all_param_elem
    {
        TBAG_CONSTEXPR static bool const value = is_all_param_elem::value && is_all_param_elem<Tail ...>::value;
    };

    template <typename T>
    struct is_all_param_elem<T>
    {
        TBAG_CONSTEXPR static bool const value = std::is_same<
                typename libtbag::remove_cr<T>::type,
                ParamElem
        >::value;
    };

public:
    template <typename ... ArgsT>
    Err add(ArgsT && ... args)
    {
        using __select_t = typename std::conditional<
                is_all_param_elem<ArgsT ...>::value,
                add_param_elems_t,
                typename std::conditional<
                        is_first_string<ArgsT ...>::value,
                        add_first_string_param_t,
                        add_param_t
                >::type
        >::type;
        static_assert(sizeof...(ArgsT) >= 1u, "Greater one template argument is required.");
        return add_select(__select_t{}, std::forward<ArgsT>(args) ...);
    }

    Err add(Param const & arg)
    {
        return add_param(arg);
    }

    Err add(Param && arg)
    {
        return add_param(std::move(arg));
    }

public:
    ErrArgumentResult parse(int argc, char ** argv) const;
    ErrArgumentResult parse(std::string const & argv) const;
    ErrArgumentResult parse(std::vector<std::string> const & argv) const;

public:
    std::string print() const;

private:
    enum class ParseResultCode
    {
        PRC_ERROR,
        PRC_FROM_FILE_ERROR,
        PRC_SKIP,
        PRC_SINGLE_PREFIX,
        PRC_DOUBLE_PREFIX,
        PRC_KEY_VAL,
        PRC_KEY,
        PRC_VAL,
    };

    struct ParseResult
    {
        ParseResultCode code;
        std::string key;
        std::string value;
    };

    ParseResult parseSingleArgument(std::string const & arg) const;
};

TBAG_CONSTEXPR char const * const TBAG_MAIN_ARGUMENT_PARSER_KEY = "libtbag::string::ArgumentParser";

TBAG_API std::weak_ptr<ArgumentParser> getMainArgumentParser();

} // namespace string

// --------------------
NAMESPACE_LIBTBAG_CLOSE
// --------------------

#endif // __INCLUDE_LIBTBAG__LIBTBAG_STRING_ARGUMENTPARSER_HPP__


text:
<?php

namespace SOSVelo\Bundle\PointBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Demande
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="SOSVelo\Bundle\PointBundle\Entity\DemandeRepository")
 */
class Demande
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    public function __construct()
    {
        // Par défaut, la date de l'annonce est la date d'aujourd'hui
        $this->dateTime = new \Datetime();
    }

    /**
     * @ORM\OneToOne(targetEntity="SOSVelo\Bundle\PointBundle\Entity\Point", cascade={"persist"})
     */
    private $point;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="dateTime", type="datetime")
     */
    private $dateTime;

    /**
     * @var \string
     *
     * @ORM\Column(name="description", type="text")
     */
    private $description;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set dateTime
     *
     * @param \DateTime $dateTime
     * @return Demande
     */
    public function setDateTime($dateTime)
    {
        $this->dateTime = $dateTime;

        return $this;
    }

    /**
     * Get dateTime
     *
     * @return \DateTime
     */
    public function getDateTime()
    {
        return $this->dateTime;
    }

    /**
     * Set point
     *
     * @param \SOSVelo\Bundle\PointBundle\Entity\Point $point
     * @return Demande
     */
    public function setPoint(\SOSVelo\Bundle\PointBundle\Entity\Point $point = null)
    {
        $this->point = $point;

        return $this;
    }

    /**
     * Get point
     *
     * @return \SOSVelo\Bundle\PointBundle\Entity\Point
     */
    public function getPoint()
    {
        return $this->point;
    }

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

        return $this;
    }

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


text:
package types2

import (
	"cmd/compile/internal/syntax"
)

// This file implements a check to validate that a Go package doesn't
// have unbounded recursive instantiation, which is not compatible
// with compilers using static instantiation (such as
// monomorphization).
//
// It implements a sort of "type flow" analysis by detecting which
// type parameters are instantiated with other type parameters (or
// types derived thereof). A package cannot be statically instantiated
// if the graph has any cycles involving at least one derived type.
//
// Concretely, we construct a directed, weighted graph. Vertices are
// used to represent type parameters as well as some defined
// types. Edges are used to represent how types depend on each other:
//
// * Everywhere a type-parameterized function or type is instantiated,
//   we add edges to each type parameter from the vertices (if any)
//   representing each type parameter or defined type referenced by
//   the type argument. If the type argument is just the referenced
//   type itself, then the edge has weight 0, otherwise 1.
//
// * For every defined type declared within a type-parameterized
//   function or method, we add an edge of weight 1 to the defined
//   type from each ambient type parameter.
//
// For example, given:
//
//	func f[A, B any]() {
//		type T int
//		f[T, map[A]B]()
//	}
//
// we construct vertices representing types A, B, and T. Because of
// declaration "type T int", we construct edges T<-A and T<-B with
// weight 1; and because of instantiation "f[T, map[A]B]" we construct
// edges A<-T with weight 0, and B<-A and B<-B with weight 1.
//
// Finally, we look for any positive-weight cycles. Zero-weight cycles
// are allowed because static instantiation will reach a fixed point.

type monoGraph struct {
	vertices []monoVertex
	edges    []monoEdge

	// canon maps method receiver type parameters to their respective
	// receiver type's type parameters.
	canon map[*TypeParam]*TypeParam

	// nameIdx maps a defined type or (canonical) type parameter to its
	// vertex index.
	nameIdx map[*TypeName]int
}

type monoVertex struct {
	weight int // weight of heaviest known path to this vertex
	pre    int // previous edge (if any) in the above path
	len    int // length of the above path

	// obj is the defined type or type parameter represented by this
	// vertex.
	obj *TypeName
}

type monoEdge struct {
	dst, src int
	weight   int

	pos syntax.Pos
	typ Type
}

func (check *Checker) monomorph() {
	// We detect unbounded instantiation cycles using a variant of
	// Bellman-Ford's algorithm. Namely, instead of always running |V|
	// iterations, we run until we either reach a fixed point or we've
	// found a path of length |V|. This allows us to terminate earlier
	// when there are no cycles, which should be the common case.

	again := true
	for again {
		again = false

		for i, edge := range check.mono.edges {
			src := &check.mono.vertices[edge.src]
			dst := &check.mono.vertices[edge.dst]

			// N.B., we're looking for the greatest weight paths, unlike
			// typical Bellman-Ford.
			w := src.weight + edge.weight
			if w <= dst.weight {
				continue
			}

			dst.pre = i
			dst.len = src.len + 1
			if dst.len == len(check.mono.vertices) {
				check.reportInstanceLoop(edge.dst)
				return
			}

			dst.weight = w
			again = true
		}
	}
}

func (check *Checker) reportInstanceLoop(v int) {
	var stack []int
	seen := make([]bool, len(check.mono.vertices))

	// We have a path that contains a cycle and ends at v, but v may
	// only be reachable from the cycle, not on the cycle itself. We
	// start by walking backwards along the path until we find a vertex
	// that appears twice.
	for !seen[v] {
		stack = append(stack, v)
		seen[v] = true
		v = check.mono.edges[check.mono.vertices[v].pre].src
	}

	// Trim any vertices we visited before visiting v the first
	// time. Since v is the first vertex we found within the cycle, any
	// vertices we visited earlier cannot be part of the cycle.
	for stack[0] != v {
		stack = stack[1:]
	}

	// TODO(mdempsky): Pivot stack so we report the cycle from the top?

	var err error_
	obj0 := check.mono.vertices[v].obj
	err.errorf(obj0, "instantiation cycle:")

	qf := RelativeTo(check.pkg)
	for _, v := range stack {
		edge := check.mono.edges[check.mono.vertices[v].pre]
		obj := check.mono.vertices[edge.dst].obj

		switch obj.Type().(type) {
		default:
			panic("unexpected type")
		case *Named:
			err.errorf(edge.pos, "%s implicitly parameterized by %s", obj.Name(), TypeString(edge.typ, qf)) // secondary error, \t indented
		case *TypeParam:
			err.errorf(edge.pos, "%s instantiated as %s", obj.Name(), TypeString(edge.typ, qf)) // secondary error, \t indented
		}
	}
	check.report(&err)
}

// recordCanon records that tpar is the canonical type parameter
// corresponding to method type parameter mpar.
func (w *monoGraph) recordCanon(mpar, tpar *TypeParam) {
	if w.canon == nil {
		w.canon = make(map[*TypeParam]*TypeParam)
	}
	w.canon[mpar] = tpar
}

// recordInstance records that the given type parameters were
// instantiated with the corresponding type arguments.
func (w *monoGraph) recordInstance(pkg *Package, pos syntax.Pos, tparams []*TypeParam, targs []Type, xlist []syntax.Expr) {
	for i, tpar := range tparams {
		pos := pos
		if i < len(xlist) {
			pos = syntax.StartPos(xlist[i])
		}
		w.assign(pkg, pos, tpar, targs[i])
	}
}

// assign records that tpar was instantiated as targ at pos.
func (w *monoGraph) assign(pkg *Package, pos syntax.Pos, tpar *TypeParam, targ Type) {
	// Go generics do not have an analog to C++`s template-templates,
	// where a template parameter can itself be an instantiable
	// template. So any instantiation cycles must occur within a single
	// package. Accordingly, we can ignore instantiations of imported
	// type parameters.
	//
	// TODO(mdempsky): Push this check up into recordInstance? All type
	// parameters in a list will appear in the same package.
	if tpar.Obj().Pkg() != pkg {
		return
	}

	// flow adds an edge from vertex src representing that typ flows to tpar.
	flow := func(src int, typ Type) {
		weight := 1
		if typ == targ {
			weight = 0
		}

		w.addEdge(w.typeParamVertex(tpar), src, weight, pos, targ)
	}

	// Recursively walk the type argument to find any defined types or
	// type parameters.
	var do func(typ Type)
	do = func(typ Type) {
		switch typ := typ.(type) {
		default:
			panic("unexpected type")

		case *TypeParam:
			assert(typ.Obj().Pkg() == pkg)
			flow(w.typeParamVertex(typ), typ)

		case *Named:
			if src := w.localNamedVertex(pkg, typ.Origin()); src >= 0 {
				flow(src, typ)
			}

			targs := typ.TypeArgs()
			for i := 0; i < targs.Len(); i++ {
				do(targs.At(i))
			}

		case *Array:
			do(typ.Elem())
		case *Basic:
			// ok
		case *Chan:
			do(typ.Elem())
		case *Map:
			do(typ.Key())
			do(typ.Elem())
		case *Pointer:
			do(typ.Elem())
		case *Slice:
			do(typ.Elem())

		case *Interface:
			for i := 0; i < typ.NumMethods(); i++ {
				do(typ.Method(i).Type())
			}
		case *Signature:
			tuple := func(tup *Tuple) {
				for i := 0; i < tup.Len(); i++ {
					do(tup.At(i).Type())
				}
			}
			tuple(typ.Params())
			tuple(typ.Results())
		case *Struct:
			for i := 0; i < typ.NumFields(); i++ {
				do(typ.Field(i).Type())
			}
		}
	}
	do(targ)
}

// localNamedVertex returns the index of the vertex representing
// named, or -1 if named doesn't need representation.
func (w *monoGraph) localNamedVertex(pkg *Package, named *Named) int {
	obj := named.Obj()
	if obj.Pkg() != pkg {
		return -1 // imported type
	}

	root := pkg.Scope()
	if obj.Parent() == root {
		return -1 // package scope, no ambient type parameters
	}

	if idx, ok := w.nameIdx[obj]; ok {
		return idx
	}

	idx := -1

	// Walk the type definition's scope to find any ambient type
	// parameters that it's implicitly parameterized by.
	for scope := obj.Parent(); scope != root; scope = scope.Parent() {
		for _, elem := range scope.elems {
			if elem, ok := elem.(*TypeName); ok && !elem.IsAlias() && elem.Pos().Cmp(obj.Pos()) < 0 {
				if tpar, ok := elem.Type().(*TypeParam); ok {
					if idx < 0 {
						idx = len(w.vertices)
						w.vertices = append(w.vertices, monoVertex{obj: obj})
					}

					w.addEdge(idx, w.typeParamVertex(tpar), 1, obj.Pos(), tpar)
				}
			}
		}
	}

	if w.nameIdx == nil {
		w.nameIdx = make(map[*TypeName]int)
	}
	w.nameIdx[obj] = idx
	return idx
}

// typeParamVertex returns the index of the vertex representing tpar.
func (w *monoGraph) typeParamVertex(tpar *TypeParam) int {
	if x, ok := w.canon[tpar]; ok {
		tpar = x
	}

	obj := tpar.Obj()

	if idx, ok := w.nameIdx[obj]; ok {
		return idx
	}

	if w.nameIdx == nil {
		w.nameIdx = make(map[*TypeName]int)
	}

	idx := len(w.vertices)
	w.vertices = append(w.vertices, monoVertex{obj: obj})
	w.nameIdx[obj] = idx
	return idx
}

func (w *monoGraph) addEdge(dst, src, weight int, pos syntax.Pos, typ Type) {
	// TODO(mdempsky): Deduplicate redundant edges?
	w.edges = append(w.edges, monoEdge{
		dst:    dst,
		src:    src,
		weight: weight,

		pos: pos,
		typ: typ,
	})
}


text:
<?php

namespace TMPHP\RestApiGenerators\Support;

use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;

/**
 * Class SchemaManager
 * @package TMPHP\RestApiGenerators\Support
 */
class SchemaManager
{
    /**
     * @var AbstractSchemaManager
     */
    private $schema;

    /**
     * SchemaManager constructor.
     */
    public function __construct()
    {
        $this->schema = DB::getDoctrineSchemaManager();
    }

    /**
     * Forwarding function calling to AbstractSchemaManager instance
     *
     * @param $name
     * @param $arguments
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        return call_user_func_array(array($this->schema, $name), $arguments);
    }

    /**
     * List of all foreign keys
     *
     * @return array
     */
    public function listForeignKeys()
    {
        $tables = $this->schema->listTables();
        $foreignKeys = [];
        foreach ($tables as $table) {
            foreach ($table->getForeignKeys() as $foreignKey) {
                array_push($foreignKeys, $foreignKey);
            }
        }

        return $foreignKeys;
    }

    /**
     * List of foreign keys, which have foreign table equal to $tableName
     *
     * @param string $tableName
     * @return ForeignKeyConstraint[]
     */
    public function listForeignKeysOnTable(string $tableName)
    {
        $allForeignKeys = $this->listForeignKeys();

        $foreignKeysOnTable = [];

        foreach ($allForeignKeys as $foreignKey) {
            if ($foreignKey->getForeignTableName() === $tableName) {
                array_push($foreignKeysOnTable, $foreignKey);
            }
        }

        return $foreignKeysOnTable;
    }

    /**
     * Check whether all table from $tableNames exists in db schema
     *
     * @param array $tableNames Names of tables, which need to check on existence in
     * @return bool
     */
    public function existsTables(array $tableNames)
    {
        //get all tables names
        $allTableNames = $this->schema->listTableNames();

        return empty(array_diff($tableNames, $allTableNames));
    }

    /**
     * Get all foreign keys, which have "belongs to many" nature
     *
     * @param string $tableName
     * @return ForeignKeyConstraint[]
     */
    public function listBelongsToManyForeignKeys(string $tableName)
    {
        //get all foreign keys
        $tables = $this->schema->listTables();
        $foreignKeys = [];
        foreach ($tables as $table) {
            if (count($table->getForeignKeys()) > 1 && $this->hasTableKeysToForeignTable($table->getName(),
                    $tableName)
            ) {
                foreach ($table->getForeignKeys() as $foreignKey) {
                    $foreignKey->setLocalTable($table);
                    if ($foreignKey->getForeignTableName() !== $tableName) {
                        array_push($foreignKeys, $foreignKey);
                    }
                }
            }
        }

        return $foreignKeys;
    }

    /**
     * Check whether $localTableName has foreign keys to $foreignTableName
     *
     * @param string $localTableName
     * @param string $foreignTableName
     * @return bool
     */
    private function hasTableKeysToForeignTable(string $localTableName, string $foreignTableName)
    {
        $foreignKeys = $this->schema->listTableForeignKeys($localTableName);

        foreach ($foreignKeys as $foreignKey) {
            if ($foreignKey->getForeignTableName() === $foreignTableName) {
                return true;
            }
        }

        return false;
    }

    /**
     * Get a foreign key in $inTable, which leads to $toTable
     *
     * @param string $inTable
     * @param string $toTable
     * @return ForeignKeyConstraint
     * @throws \Exception
     */
    public function getKeyInTableWhichPointsToTable(string $inTable, string $toTable)
    {
        $foreignKeys = $this->schema->listTableForeignKeys($inTable);

        foreach ($foreignKeys as $foreignKey){
            if ($foreignKey->getForeignTableName() === $toTable){
                return $foreignKey;
            }
        }

        throw new \Exception('No foreign key exists in table, which points to table');
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class io.github.hhromic.uimr.twitter.SimpleUser (UIMR Java Toolbox: Twitter 4.0-SNAPSHOT API)</title>
<meta name="date" content="2018-05-02">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
io.github.hhromic.uimr.twitter.SimpleUser

Uses of SimpleUser in io.github.hhromic.uimr.twitter

Fields in io.github.hhromic.uimr.twitter declared as SimpleUser

Modifier and Type
Field and Description

protected SimpleUser
SimpleTweet.user

Methods in io.github.hhromic.uimr.twitter that return SimpleUser

Modifier and Type
Method and Description

SimpleUser
SimpleTweet.getUser()

Gets the user (author) of this Tweet.

Methods in io.github.hhromic.uimr.twitter with parameters of type SimpleUser

Modifier and Type
Method and Description

void
SimpleTweet.setUser(SimpleUser user)

Sets the user (author) of this Tweet.

Constructors in io.github.hhromic.uimr.twitter with parameters of type SimpleUser

Constructor and Description

SimpleTweet(Long id,
           Long timestamp,
           SimpleUser user,
           String text)

Creates a simple Tweet instance.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2018. All rights reserved.


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

<title>Patient</title>
<meta name="date" content="2014-12-11">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.compsci408.rxcore.datatypes

Class Patient

java.lang.Object

com.compsci408.rxcore.datatypes.Patient

public class Patient
extends java.lang.Object

Class describing the attributes of a patient.
 Includes name, pharmacy, login credentials, ID,
 and ID of associated provider.

Author:

Evan

Constructor Summary

Constructors

Constructor and Description

Patient()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.lang.String
getDrug_allergies()

java.lang.String
getLogin()

java.lang.String
getName()

java.lang.String
getPassword()

int
getPatientID()

java.lang.String
getPharmacy()

int
getPhysicianID()

void
setDrug_allergies(java.lang.String drug_allergies)

void
setLogin(java.lang.String login)

void
setName(java.lang.String name)

void
setPassword(java.lang.String password)

void
setPatientID(int patientID)

void
setPharmacy(java.lang.String pharmacy)

void
setPhysicianID(int physicianID)

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Patient

public Patient()

Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getPharmacy

public java.lang.String getPharmacy()

setPharmacy

public void setPharmacy(java.lang.String pharmacy)

getDrug_allergies

public java.lang.String getDrug_allergies()

setDrug_allergies

public void setDrug_allergies(java.lang.String drug_allergies)

getLogin

public java.lang.String getLogin()

setLogin

public void setLogin(java.lang.String login)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

getPatientID

public int getPatientID()

setPatientID

public void setPatientID(int patientID)

getPhysicianID

public int getPhysicianID()

setPhysicianID

public void setPhysicianID(int physicianID)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package gr.gnostix.freeswitch.utilities

import java.io.File

import gr.gnostix.freeswitch.actors.ServletProtocol.{ApiReplyError, ApiResponse, ApiReplyData, ApiReply}
import org.scalatra.servlet.FileItem
import org.slf4j.LoggerFactory

/**
 * Created by rebel on 10/10/15.
 */
object FileUtilities {

  val log =  LoggerFactory.getLogger(getClass)

  def processCsvFileItem(fileName: String, file: FileItem): ApiResponse = {
    var dialCodesMap = scala.collection.SortedMap.empty[String, String]
    val csv = io.Source.createBufferedSource(file.getInputStream)
    val (itr1, itr2) = csv.getLines().duplicate
    val chkFile = checkFile(itr1)

    chkFile.size match {
      case 0 =>
        // without header ,proccess file  country,code
        itr2.toList.map {
          l => val cols = if (l.contains(";")) l.split(";").map(_.trim) else l.split(",").map(_.trim)
            dialCodesMap += (cols(1) -> cols(0))
        }
        csv.close()
        ApiReplyData(200, "File uploaded successfully", Map(fileName -> dialCodesMap))

      case 1 if(chkFile.head == 1) =>
        // with header ,proccess file  country,code
      itr2.toList.tail.map {
          l => val cols = if (l.contains(";")) l.split(";").map(_.trim) else l.split(",").map(_.trim)
            dialCodesMap += (cols(1) -> cols(0))
        }
        csv.close()
        ApiReplyData(200, "File uploaded successfully", Map(fileName -> dialCodesMap))

      case _ => // errors in file
        csv.close()
        chkFile.head match {
          case 1 => ApiReplyError(400, s"Error in lines: ${chkFile.tail.mkString(",")}")
          case _ => ApiReplyError(400, s"Error in lines: ${chkFile.mkString(",")}")
        }

    }

  }

  def processResourcesCsvFile(): ApiResponse = {
    val csv = io.Source.fromURL(getClass.getResource("/dialcodes.csv")) //io.Source.fromFile("resources/dialcodes.csv")
    var dialCodesMap = scala.collection.SortedMap.empty[String, String]
    val (itr1, itr2) = csv.getLines().duplicate
    val chkFile = checkFile(itr1)    //log.debug("----------> " + csv.getLines().size)

    chkFile.size match {
      case 0 =>
        // proccess file  country,code
        itr2.toList.map {
          l => val cols = if (l.contains(";")) l.split(";").map(_.trim) else l.split(",").map(_.trim)
            dialCodesMap += (cols(1) -> cols(0))
        }
        csv.close()
        ApiReplyData(200, "File resources/dialcodes.csv uploaded successfully", Map("default" -> dialCodesMap))
      case _ => // errors in file
        csv.close()
        ApiReplyError(400, s"Error uploading the default dialcodes.csv file from resources in lines: ${chkFile.mkString}")
    }

  }

  private def checkFile(itr: Iterator[String]) = {
    // country,code
    var errorLines: List[Int] = List()
    itr.toList.zipWithIndex.map {
      case (l, i) => val cols = if (l.contains(";")) l.split(";").map(_.trim) else l.split(",").map(_.trim)
        try {
          cols(1).toLong
        } catch {
          case e: Exception => errorLines ::= i + 1
        }
    }

    errorLines.reverse
  }
}