text:
"use strict";
var specialElHandlers = require("./specialElHandlers");
var KeySequence = require("../../components/KeySequence");
var componentsUtil = require("../../components/util");
var existingComponentLookup = componentsUtil.___componentLookup;
var destroyNodeRecursive = componentsUtil.___destroyNodeRecursive;
var addComponentRootToKeyedElements =
  componentsUtil.___addComponentRootToKeyedElements;
var normalizeComponentKey = componentsUtil.___normalizeComponentKey;
var VElement = require("../vdom").___VElement;
var virtualizeElement = VElement.___virtualize;
var morphAttrs = VElement.___morphAttrs;
var eventDelegation = require("../../components/event-delegation");
var fragment = require("./fragment");
var helpers = require("./helpers");
var domData = require("../../components/dom-data");
var keysByDOMNode = domData.___keyByDOMNode;
var componentByDOMNode = domData.___componentByDOMNode;
var vElementByDOMNode = domData.___vElementByDOMNode;
var detachedByDOMNode = domData.___detachedByDOMNode;

var insertBefore = helpers.___insertBefore;
var insertAfter = helpers.___insertAfter;
var nextSibling = helpers.___nextSibling;
var firstChild = helpers.___firstChild;
var removeChild = helpers.___removeChild;
var createFragmentNode = fragment.___createFragmentNode;
var beginFragmentNode = fragment.___beginFragmentNode;

var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COMMENT_NODE = 8;
var COMPONENT_NODE = 2;
var FRAGMENT_NODE = 12;
var DOCTYPE_NODE = 10;

// var FLAG_SIMPLE_ATTRS = 1;
// var FLAG_CUSTOM_ELEMENT = 2;
// var FLAG_SPREAD_ATTRS = 4;

function isAutoKey(key) {
  return key[0] !== "@";
}

function compareNodeNames(fromEl, toEl) {
  return fromEl.___nodeName === toEl.___nodeName;
}

function caseInsensitiveCompare(a, b) {
  return a.toLowerCase() === b.toLowerCase();
}

function onNodeAdded(node, componentsContext) {
  if (node.nodeType === ELEMENT_NODE) {
    eventDelegation.___handleNodeAttach(node, componentsContext);
  }
}

function morphdom(fromNode, toNode, host, componentsContext) {
  var globalComponentsContext;
  var isHydrate = false;
  var keySequences = Object.create(null);

  if (componentsContext) {
    globalComponentsContext = componentsContext.___globalContext;
    isHydrate = globalComponentsContext.___isHydrate;
  }

  function insertVirtualNodeBefore(
    vNode,
    key,
    referenceEl,
    parentEl,
    ownerComponent,
    parentComponent
  ) {
    var realNode = vNode.___actualize(host, parentEl.namespaceURI);
    insertBefore(realNode, referenceEl, parentEl);

    if (
      vNode.___nodeType === ELEMENT_NODE ||
      vNode.___nodeType === FRAGMENT_NODE
    ) {
      if (key) {
        keysByDOMNode.set(realNode, key);
        (isAutoKey(key) ? parentComponent : ownerComponent).___keyedElements[
          key
        ] = realNode;
      }

      if (vNode.___nodeName !== "textarea") {
        morphChildren(realNode, vNode, parentComponent);
      }

      onNodeAdded(realNode, componentsContext);
    }
  }

  function insertVirtualComponentBefore(
    vComponent,
    referenceNode,
    referenceNodeParentEl,
    component,
    key,
    ownerComponent,
    parentComponent
  ) {
    var rootNode = (component.___rootNode = insertBefore(
      createFragmentNode(),
      referenceNode,
      referenceNodeParentEl
    ));
    componentByDOMNode.set(rootNode, component);

    if (key && ownerComponent) {
      key = normalizeComponentKey(key, parentComponent.id);
      addComponentRootToKeyedElements(
        ownerComponent.___keyedElements,
        key,
        rootNode,
        component.id
      );
      keysByDOMNode.set(rootNode, key);
    }

    morphComponent(component, vComponent);
  }

  function morphComponent(component, vComponent) {
    morphChildren(component.___rootNode, vComponent, component);
  }

  var detachedNodes = [];

  function detachNode(node, parentNode, ownerComponent) {
    if (node.nodeType === ELEMENT_NODE || node.nodeType === FRAGMENT_NODE) {
      detachedNodes.push(node);
      detachedByDOMNode.set(node, ownerComponent || true);
    } else {
      destroyNodeRecursive(node);
      removeChild(node);
    }
  }

  function destroyComponent(component) {
    component.destroy();
  }

  function morphChildren(fromNode, toNode, parentComponent) {
    var curFromNodeChild = firstChild(fromNode);
    var curToNodeChild = toNode.___firstChild;

    var curToNodeKey;
    var curFromNodeKey;
    var curToNodeType;

    var fromNextSibling;
    var toNextSibling;
    var matchingFromEl;
    var matchingFromComponent;
    var curVFromNodeChild;
    var fromComponent;

    outer: while (curToNodeChild) {
      toNextSibling = curToNodeChild.___nextSibling;
      curToNodeType = curToNodeChild.___nodeType;
      curToNodeKey = curToNodeChild.___key;

      // Skip <!doctype>
      if (curFromNodeChild && curFromNodeChild.nodeType === DOCTYPE_NODE) {
        curFromNodeChild = nextSibling(curFromNodeChild);
      }

      var ownerComponent = curToNodeChild.___ownerComponent || parentComponent;
      var referenceComponent;

      if (curToNodeType === COMPONENT_NODE) {
        var component = curToNodeChild.___component;
        if (
          (matchingFromComponent = existingComponentLookup[component.id]) ===
          undefined
        ) {
          if (isHydrate === true) {
            var rootNode = beginFragmentNode(curFromNodeChild, fromNode);
            component.___rootNode = rootNode;
            componentByDOMNode.set(rootNode, component);

            if (ownerComponent && curToNodeKey) {
              curToNodeKey = normalizeComponentKey(
                curToNodeKey,
                parentComponent.id
              );
              addComponentRootToKeyedElements(
                ownerComponent.___keyedElements,
                curToNodeKey,
                rootNode,
                component.id
              );

              keysByDOMNode.set(rootNode, curToNodeKey);
            }

            morphComponent(component, curToNodeChild);

            curFromNodeChild = nextSibling(rootNode);
          } else {
            insertVirtualComponentBefore(
              curToNodeChild,
              curFromNodeChild,
              fromNode,
              component,
              curToNodeKey,
              ownerComponent,
              parentComponent
            );
          }
        } else {
          if (matchingFromComponent.___rootNode !== curFromNodeChild) {
            if (
              curFromNodeChild &&
              (fromComponent = componentByDOMNode.get(curFromNodeChild)) &&
              globalComponentsContext.___renderedComponentsById[
                fromComponent.id
              ] === undefined
            ) {
              // The component associated with the current real DOM node was not rendered
              // so we should just remove it out of the real DOM by destroying it
              curFromNodeChild = nextSibling(fromComponent.___rootNode);
              destroyComponent(fromComponent);
              continue;
            }

            // We need to move the existing component into
            // the correct location
            insertBefore(
              matchingFromComponent.___rootNode,
              curFromNodeChild,
              fromNode
            );
          } else {
            curFromNodeChild =
              curFromNodeChild && nextSibling(curFromNodeChild);
          }

          if (!curToNodeChild.___preserve) {
            morphComponent(component, curToNodeChild);
          }
        }

        curToNodeChild = toNextSibling;
        continue;
      } else if (curToNodeKey) {
        curVFromNodeChild = undefined;
        curFromNodeKey = undefined;
        var curToNodeKeyOriginal = curToNodeKey;

        if (isAutoKey(curToNodeKey)) {
          if (ownerComponent !== parentComponent) {
            curToNodeKey += ":" + ownerComponent.id;
          }
          referenceComponent = parentComponent;
        } else {
          referenceComponent = ownerComponent;
        }

        // We have a keyed element. This is the fast path for matching
        // up elements
        curToNodeKey = (
          keySequences[referenceComponent.id] ||
          (keySequences[referenceComponent.id] = new KeySequence())
        ).___nextKey(curToNodeKey);

        if (curFromNodeChild) {
          curFromNodeKey = keysByDOMNode.get(curFromNodeChild);
          curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);
          fromNextSibling = nextSibling(curFromNodeChild);
        }

        if (curFromNodeKey === curToNodeKey) {
          // Elements line up. Now we just have to make sure they are compatible
          if (!curToNodeChild.___preserve) {
            // We just skip over the fromNode if it is preserved

            if (compareNodeNames(curToNodeChild, curVFromNodeChild)) {
              morphEl(
                curFromNodeChild,
                curVFromNodeChild,
                curToNodeChild,
                parentComponent
              );
            } else {
              // Remove the old node
              detachNode(curFromNodeChild, fromNode, ownerComponent);

              // Incompatible nodes. Just move the target VNode into the DOM at this position
              insertVirtualNodeBefore(
                curToNodeChild,
                curToNodeKey,
                curFromNodeChild,
                fromNode,
                ownerComponent,
                parentComponent
              );
            }
          }
        } else {
          matchingFromEl = referenceComponent.___keyedElements[curToNodeKey];
          if (
            matchingFromEl === undefined ||
            matchingFromEl === curFromNodeChild
          ) {
            if (isHydrate === true && curFromNodeChild) {
              if (
                curFromNodeChild.nodeType === ELEMENT_NODE &&
                (curToNodeChild.___preserve ||
                  caseInsensitiveCompare(
                    curFromNodeChild.nodeName,
                    curToNodeChild.___nodeName || ""
                  ))
              ) {
                curVFromNodeChild = virtualizeElement(curFromNodeChild);
                curVFromNodeChild.___nodeName = curToNodeChild.___nodeName;
                keysByDOMNode.set(curFromNodeChild, curToNodeKey);
                referenceComponent.___keyedElements[curToNodeKey] =
                  curFromNodeChild;

                if (curToNodeChild.___preserve) {
                  vElementByDOMNode.set(curFromNodeChild, curVFromNodeChild);
                } else {
                  morphEl(
                    curFromNodeChild,
                    curVFromNodeChild,
                    curToNodeChild,
                    parentComponent
                  );
                }

                curToNodeChild = toNextSibling;
                curFromNodeChild = fromNextSibling;
                continue;
              } else if (
                curToNodeChild.___nodeType === FRAGMENT_NODE &&
                curFromNodeChild.nodeType === COMMENT_NODE
              ) {
                var content = curFromNodeChild.nodeValue;
                if (content == "F#" + curToNodeKeyOriginal) {
                  var endNode = curFromNodeChild.nextSibling;
                  var depth = 0;
                  var nodeValue;

                  // eslint-disable-next-line no-constant-condition
                  while (true) {
                    if (endNode.nodeType === COMMENT_NODE) {
                      nodeValue = endNode.nodeValue;
                      if (nodeValue === "F/") {
                        if (depth === 0) {
                          break;
                        } else {
                          depth--;
                        }
                      } else if (nodeValue.indexOf("F#") === 0) {
                        depth++;
                      }
                    }
                    endNode = endNode.nextSibling;
                  }

                  var fragment = createFragmentNode(
                    curFromNodeChild,
                    endNode.nextSibling,
                    fromNode
                  );
                  keysByDOMNode.set(fragment, curToNodeKey);
                  vElementByDOMNode.set(fragment, curToNodeChild);
                  referenceComponent.___keyedElements[curToNodeKey] = fragment;
                  removeChild(curFromNodeChild);
                  removeChild(endNode);

                  if (!curToNodeChild.___preserve) {
                    morphChildren(fragment, curToNodeChild, parentComponent);
                  }

                  curToNodeChild = toNextSibling;
                  curFromNodeChild = fragment.nextSibling;
                  continue;
                }
              }
            }

            insertVirtualNodeBefore(
              curToNodeChild,
              curToNodeKey,
              curFromNodeChild,
              fromNode,
              ownerComponent,
              parentComponent
            );
            fromNextSibling = curFromNodeChild;
          } else {
            if (detachedByDOMNode.get(matchingFromEl) !== undefined) {
              detachedByDOMNode.set(matchingFromEl, undefined);
            }

            if (!curToNodeChild.___preserve) {
              curVFromNodeChild = vElementByDOMNode.get(matchingFromEl);

              if (compareNodeNames(curVFromNodeChild, curToNodeChild)) {
                if (fromNextSibling === matchingFromEl) {
                  // Single element removal:
                  // A <-> A
                  // B <-> C <-- We are here
                  // C     D
                  // D
                  //
                  // Single element swap:
                  // A <-> A
                  // B <-> C <-- We are here
                  // C     B

                  if (
                    toNextSibling &&
                    toNextSibling.___key === curFromNodeKey
                  ) {
                    // Single element swap

                    // We want to stay on the current real DOM node
                    fromNextSibling = curFromNodeChild;

                    // But move the matching element into place
                    insertBefore(matchingFromEl, curFromNodeChild, fromNode);
                  } else {
                    // Single element removal

                    // We need to remove the current real DOM node
                    // and the matching real DOM node will fall into
                    // place. We will continue diffing with next sibling
                    // after the real DOM node that just fell into place
                    fromNextSibling = nextSibling(fromNextSibling);

                    if (curFromNodeChild) {
                      detachNode(curFromNodeChild, fromNode, ownerComponent);
                    }
                  }
                } else {
                  // A <-> A
                  // B <-> D <-- We are here
                  // C
                  // D

                  // We need to move the matching node into place
                  insertAfter(matchingFromEl, curFromNodeChild, fromNode);

                  if (curFromNodeChild) {
                    detachNode(curFromNodeChild, fromNode, ownerComponent);
                  }
                }

                morphEl(
                  matchingFromEl,
                  curVFromNodeChild,
                  curToNodeChild,
                  parentComponent
                );
              } else {
                insertVirtualNodeBefore(
                  curToNodeChild,
                  curToNodeKey,
                  curFromNodeChild,
                  fromNode,
                  ownerComponent,
                  parentComponent
                );
                detachNode(matchingFromEl, fromNode, ownerComponent);
              }
            } else {
              // preserve the node
              // but still we need to diff the current from node
              insertBefore(matchingFromEl, curFromNodeChild, fromNode);
              fromNextSibling = curFromNodeChild;
            }
          }
        }

        curToNodeChild = toNextSibling;
        curFromNodeChild = fromNextSibling;
        continue;
      }

      // The know the target node is not a VComponent node and we know
      // it is also not a preserve node. Let's now match up the HTML
      // element, text node, comment, etc.
      while (curFromNodeChild) {
        fromNextSibling = nextSibling(curFromNodeChild);

        if ((fromComponent = componentByDOMNode.get(curFromNodeChild))) {
          // The current "to" element is not associated with a component,
          // but the current "from" element is associated with a component

          // Even if we destroy the current component in the original
          // DOM or not, we still need to skip over it since it is
          // not compatible with the current "to" node
          curFromNodeChild = fromNextSibling;

          if (
            !globalComponentsContext.___renderedComponentsById[fromComponent.id]
          ) {
            destroyComponent(fromComponent);
          }

          continue; // Move to the next "from" node
        }

        var curFromNodeType = curFromNodeChild.nodeType;

        var isCompatible = undefined;

        if (curFromNodeType === curToNodeType) {
          if (curFromNodeType === ELEMENT_NODE) {
            // Both nodes being compared are Element nodes
            curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);
            if (curVFromNodeChild === undefined) {
              if (isHydrate === true) {
                curVFromNodeChild = virtualizeElement(curFromNodeChild);

                if (
                  caseInsensitiveCompare(
                    curVFromNodeChild.___nodeName,
                    curToNodeChild.___nodeName
                  )
                ) {
                  curVFromNodeChild.___nodeName = curToNodeChild.___nodeName;
                }
              } else {
                // Skip over nodes that don't look like ours...
                curFromNodeChild = fromNextSibling;
                continue;
              }
            } else if ((curFromNodeKey = curVFromNodeChild.___key)) {
              // We have a keyed element here but our target VDOM node
              // is not keyed so this not doesn't belong
              isCompatible = false;
            }

            isCompatible =
              isCompatible !== false &&
              compareNodeNames(curVFromNodeChild, curToNodeChild) === true;

            if (isCompatible === true) {
              // We found compatible DOM elements so transform
              // the current "from" node to match the current
              // target DOM node.
              morphEl(
                curFromNodeChild,
                curVFromNodeChild,
                curToNodeChild,
                parentComponent
              );
            }
          } else if (
            curFromNodeType === TEXT_NODE ||
            curFromNodeType === COMMENT_NODE
          ) {
            // Both nodes being compared are Text or Comment nodes
            isCompatible = true;
            // Simply update nodeValue on the original node to
            // change the text value

            if (
              isHydrate === true &&
              toNextSibling &&
              curFromNodeType === TEXT_NODE &&
              toNextSibling.___nodeType === TEXT_NODE
            ) {
              fromNextSibling = curFromNodeChild.splitText(
                curToNodeChild.___nodeValue.length
              );
            }
            if (curFromNodeChild.nodeValue !== curToNodeChild.___nodeValue) {
              curFromNodeChild.nodeValue = curToNodeChild.___nodeValue;
            }
          }
        }

        if (isCompatible === true) {
          // Advance both the "to" child and the "from" child since we found a match
          curToNodeChild = toNextSibling;
          curFromNodeChild = fromNextSibling;
          continue outer;
        }

        detachNode(curFromNodeChild, fromNode, ownerComponent);
        curFromNodeChild = fromNextSibling;
      } // END: while (curFromNodeChild)

      // If we got this far then we did not find a candidate match for
      // our "to node" and we exhausted all of the children "from"
      // nodes. Therefore, we will just append the current "to" node
      // to the end
      insertVirtualNodeBefore(
        curToNodeChild,
        curToNodeKey,
        curFromNodeChild,
        fromNode,
        ownerComponent,
        parentComponent
      );

      curToNodeChild = toNextSibling;
      curFromNodeChild = fromNextSibling;
    }

    // We have processed all of the "to nodes".
    if (fromNode.___finishFragment) {
      // If we are in an unfinished fragment, we have reached the end of the nodes
      // we were matching up and need to end the fragment
      fromNode.___finishFragment(curFromNodeChild);
    } else {
      // If curFromNodeChild is non-null then we still have some from nodes
      // left over that need to be removed
      var fragmentBoundary =
        fromNode.nodeType === FRAGMENT_NODE ? fromNode.endNode : null;

      while (curFromNodeChild && curFromNodeChild !== fragmentBoundary) {
        fromNextSibling = nextSibling(curFromNodeChild);

        if ((fromComponent = componentByDOMNode.get(curFromNodeChild))) {
          curFromNodeChild = fromNextSibling;
          if (
            !globalComponentsContext.___renderedComponentsById[fromComponent.id]
          ) {
            destroyComponent(fromComponent);
          }
          continue;
        }

        curVFromNodeChild = vElementByDOMNode.get(curFromNodeChild);
        curFromNodeKey = keysByDOMNode.get(fromNode);

        // For transcluded content, we need to check if the element belongs to a different component
        // context than the current component and ensure it gets removed from its key index.
        if (!curFromNodeKey || isAutoKey(curFromNodeKey)) {
          referenceComponent = parentComponent;
        } else {
          referenceComponent =
            curVFromNodeChild && curVFromNodeChild.___ownerComponent;
        }

        detachNode(curFromNodeChild, fromNode, referenceComponent);

        curFromNodeChild = fromNextSibling;
      }
    }
  }

  function morphEl(fromEl, vFromEl, toEl, parentComponent) {
    var nodeName = toEl.___nodeName;

    var constId = toEl.___constId;
    if (constId !== undefined && vFromEl.___constId === constId) {
      return;
    }

    morphAttrs(fromEl, vFromEl, toEl);

    if (toEl.___preserveBody) {
      return;
    }

    if (nodeName !== "textarea") {
      morphChildren(fromEl, toEl, parentComponent);
    }

    var specialElHandler = specialElHandlers[nodeName];
    if (specialElHandler !== undefined) {
      specialElHandler(fromEl, toEl);
    }
  } // END: morphEl(...)

  // eslint-disable-next-line no-constant-condition
  if ("MARKO_DEBUG") {
    componentsUtil.___stopDOMManipulationWarning(host);
  }

  morphChildren(fromNode, toNode, toNode.___component);

  detachedNodes.forEach(function (node) {
    var detachedFromComponent = detachedByDOMNode.get(node);

    if (detachedFromComponent !== undefined) {
      detachedByDOMNode.set(node, undefined);

      var componentToDestroy = componentByDOMNode.get(node);
      if (componentToDestroy) {
        componentToDestroy.destroy();
      } else if (node.parentNode) {
        destroyNodeRecursive(
          node,
          detachedFromComponent !== true && detachedFromComponent
        );

        if (eventDelegation.___handleNodeDetach(node) != false) {
          removeChild(node);
        }
      }
    }
  });

  // eslint-disable-next-line no-constant-condition
  if ("MARKO_DEBUG") {
    componentsUtil.___startDOMManipulationWarning(host);
  }
}

module.exports = morphdom;


text:
*SenshiGroup* via **BushidoCode**
Named after the man,the myth, the legend…[Oda Nobunaga](http://en.wikipedia.org/wiki/Oda_Nobunaga).
Content Management System authored by the brave warriors listed in the commits.

For install instructions, read the [INSTALL.md](INSTALL.md)

## Stack
## Front-End
+ **AngularJS** : Together with the list of packages below:
``` "angular-bootstrap": "~0.13.0",
    "angular-chart.js": "0.3.19",
    "angular-moment": "0.9.0",
    "angular-smart-table": "1.4.9",
    "angular-ui-router": "0.2.13",
"restangular": "1.4.0",
"textAngular": "1.3.3",
"ngtoast": "~1.4.0",
"angular-md5": "~0.1.7" ```

### Angular Packages
All packages have a link for further reading.
#### 1. angular-bootstrap
URL: [Link to Github Page](https://github.com/angular-ui/bootstrap)
#### 2. angular-chart.js
URL: [Link to Github Page](https://github.com/jtblin/angular-chart.js)
#### 3. angular-moment
URL: [Link to Github Page](https://github.com/urish/angular-moment)
#### 4. angular-smart-table
URL: [Link to Github Page](https://github.com/lorenzofox3/Smart-Table)
#### 5. angular-ui-router
URL: [Link to Github Page](https://github.com/angular-ui/ui-router)
#### 6. restangular
URL: [Link to Github Page](https://github.com/mgonto/restangular)
#### 7. textAngular
URL: [Link to Github Page](https://github.com/fraywing/textAngular)
#### 8. ngtoast
URL: [Link to Github Page](https://github.com/tameraydin/ngToast)
#### 9. angular-md5
URL: [Link to Github Page](https://github.com/gdi2290/angular-md5)

## Back-end
+ **Codeigniter 3**  : The MVC of choice, build on PHP.

+ **MySQL 5+**  : Our choice for Database Management. Working on making it agnostic.

## Package Managers
### Bower
*Front-End Package Manager*
URL : [Bower Site](bower.io)
### Grunt
*Javascript Task Runner*
URL : [Grunt Site](bower.io)
### Composer
*Dependency Manager for PHP*
URL : [Composer Site](https://getcomposer.org)

redpajama_set_name: RedPajamaGithub


text:
from rest_framework import permissions

class AdminWritePermission(permissions.BasePermission):
    def has_permission(self, request, view):
        if view.action in ['list', 'retrieve']:
            return request.user.is_authenticated()
        elif view.action in ['create', 'update', 'partial_update', 'destroy']:
            return request.user.is_authenticated() and request.user.is_staff
        else:
            return False

class EventoPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        if view.action in ['list', 'retrieve']:
            return True
        elif view.action in ['create', 'update', 'partial_update', 'destroy']:
            return request.user.is_authenticated() and request.user.is_staff
        else:
            return False

class ProyectoPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        return request.user.is_authenticated()

    def has_object_permission(self, request, view, obj):
        return request.user.is_authenticated()

class AlumnoPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        return request.user.is_authenticated()

    def has_object_permission(self, request, view, obj):
        if view.action in ['list','retrieve', 'create']:
            return request.user.is_authenticated()
        elif view.action in ['update', 'partial_update', 'destroy']:
            return request.user.is_authenticated() and (obj.user == request.user or request.user.is_staff)
        else:
            return False

class EquipoPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        return request.user.is_authenticated()

    #def has_object_permission(self, request, view, obj): Este es el que mencionaba, sobre cual es el uso de usuario ahora
        #return request.user.is_authenticated() and (obj.usuario == request.user or request.user.is_staff) usuario no se usa creo, se filtra por integrantes
    def has_object_permission(self, request, view, obj):
        return request.user.is_authenticated()

class UserPermission(permissions.BasePermission):
    def has_permission(self, request, view):
        if view.action == 'create':
            return True
        return request.user.is_authenticated()

    def has_object_permission(self, request, view, obj):
        return request.user.is_authenticated() and (obj == request.user or request.user.is_staff)


text:
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

package com.microsoft.windowsazure.management.network.models;

/**
* Parameters supplied to the Create Network Security Group operation.
*/
public class NetworkSecurityGroupCreateParameters {
    private String label;

    /**
    * Optional. Gets or sets description for the Network Security Group. The
    * description can be up to 1024 characters in length.
    * @return The Label value.
    */
    public String getLabel() {
        return this.label;
    }

    /**
    * Optional. Gets or sets description for the Network Security Group. The
    * description can be up to 1024 characters in length.
    * @param labelValue The Label value.
    */
    public void setLabel(final String labelValue) {
        this.label = labelValue;
    }

    private String location;

    /**
    * Required. Gets or sets the data center location where the Network
    * Security Group will be created.
    * @return The Location value.
    */
    public String getLocation() {
        return this.location;
    }

    /**
    * Required. Gets or sets the data center location where the Network
    * Security Group will be created.
    * @param locationValue The Location value.
    */
    public void setLocation(final String locationValue) {
        this.location = locationValue;
    }

    private String name;

    /**
    * Required. Gets or sets name for the Network Security Group that is unique
    * to the subscription.
    * @return The Name value.
    */
    public String getName() {
        return this.name;
    }

    /**
    * Required. Gets or sets name for the Network Security Group that is unique
    * to the subscription.
    * @param nameValue The Name value.
    */
    public void setName(final String nameValue) {
        this.name = nameValue;
    }

    /**
    * Initializes a new instance of the NetworkSecurityGroupCreateParameters
    * class.
    *
    */
    public NetworkSecurityGroupCreateParameters() {
    }

    /**
    * Initializes a new instance of the NetworkSecurityGroupCreateParameters
    * class with required arguments.
    *
    * @param name Gets or sets name for the Network Security Group that is
    * unique to the subscription.
    * @param location Gets or sets the data center location where the Network
    * Security Group will be created.
    */
    public NetworkSecurityGroupCreateParameters(String name, String location) {
        if (name == null) {
            throw new NullPointerException("name");
        }
        if (location == null) {
            throw new NullPointerException("location");
        }
        this.setName(name);
        this.setLocation(location);
    }
}


text:
package org.apache.pulsar.broker.admin;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import org.apache.bookkeeper.mledger.LedgerOffloader;
import org.apache.bookkeeper.mledger.ManagedLedgerInfo;
import org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest;
import org.apache.pulsar.broker.service.persistent.PersistentTopic;
import org.apache.pulsar.client.admin.LongRunningProcessStatus;
import org.apache.pulsar.client.admin.PulsarAdminException.ConflictException;
import org.apache.pulsar.client.api.MessageId;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.impl.MessageIdImpl;
import org.apache.pulsar.common.naming.NamespaceName;
import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.common.policies.data.ClusterData;
import org.apache.pulsar.common.policies.data.OffloadPolicies;
import org.apache.pulsar.common.policies.data.OffloadPoliciesImpl;
import org.apache.pulsar.common.policies.data.OffloadedReadPriority;
import org.apache.pulsar.common.policies.data.TenantInfoImpl;
import org.awaitility.Awaitility;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

@Test(groups = "broker-admin")
public class AdminApiOffloadTest extends MockedPulsarServiceBaseTest {

    private final String testTenant = "prop-xyz";
    private final String testNamespace = "ns1";
    private final String myNamespace = testTenant + "/" + testNamespace;
    private final String testTopic = "persistent://" + myNamespace + "/test-";

    @BeforeMethod
    @Override
    public void setup() throws Exception {
        conf.setManagedLedgerMaxEntriesPerLedger(10);
        conf.setManagedLedgerMinLedgerRolloverTimeMinutes(0);

        super.internalSetup();

        // Setup namespaces
        admin.clusters().createCluster("test", ClusterData.builder().serviceUrl(pulsar.getWebServiceAddress()).build());
        TenantInfoImpl tenantInfo = new TenantInfoImpl(Set.of("role1", "role2"), Set.of("test"));
        admin.tenants().createTenant(testTenant, tenantInfo);
        admin.namespaces().createNamespace(myNamespace, Set.of("test"));
    }

    @AfterMethod(alwaysRun = true)
    @Override
    public void cleanup() throws Exception {
        super.internalCleanup();
    }

    private void testOffload(String topicName, String mlName) throws Exception {
        LedgerOffloader offloader = mock(LedgerOffloader.class);
        when(offloader.getOffloadDriverName()).thenReturn("mock");

        doReturn(offloader).when(pulsar).getManagedLedgerOffloader(any(), any());

        CompletableFuture<Void> promise = new CompletableFuture<>();
        doReturn(promise).when(offloader).offload(any(), any(), any());

        MessageId currentId = MessageId.latest;
        try (Producer<byte[]> p = pulsarClient.newProducer().topic(topicName).enableBatching(false).create()) {
            for (int i = 0; i < 15; i++) {
                currentId = p.send("Foobar".getBytes());
            }
        }

        ManagedLedgerInfo info = pulsar.getManagedLedgerFactory().getManagedLedgerInfo(mlName);
        assertEquals(info.ledgers.size(), 2);

        assertEquals(admin.topics().offloadStatus(topicName).getStatus(),
                            LongRunningProcessStatus.Status.NOT_RUN);

        admin.topics().triggerOffload(topicName, currentId);

        assertEquals(admin.topics().offloadStatus(topicName).getStatus(),
                            LongRunningProcessStatus.Status.RUNNING);

        try {
            admin.topics().triggerOffload(topicName, currentId);
            Assert.fail("Should have failed");
        } catch (ConflictException e) {
            // expected
        }

        // fail first time
        promise.completeExceptionally(new Exception("Some random failure"));

        assertEquals(admin.topics().offloadStatus(topicName).getStatus(),
                            LongRunningProcessStatus.Status.ERROR);
        Assert.assertTrue(admin.topics().offloadStatus(topicName).getLastError().contains("Some random failure"));

        // Try again
        doReturn(CompletableFuture.completedFuture(null))
            .when(offloader).offload(any(), any(), any());

        admin.topics().triggerOffload(topicName, currentId);

        Awaitility.await().untilAsserted(() ->
                assertEquals(admin.topics().offloadStatus(topicName).getStatus(),
                LongRunningProcessStatus.Status.SUCCESS));
        MessageId firstUnoffloaded = admin.topics().offloadStatus(topicName).getFirstUnoffloadedMessage();
        assertTrue(firstUnoffloaded instanceof MessageIdImpl);
        MessageIdImpl firstUnoffloadedMessage = (MessageIdImpl) firstUnoffloaded;
        // First unoffloaded is the first entry of current ledger
        assertEquals(firstUnoffloadedMessage.getLedgerId(), info.ledgers.get(1).ledgerId);
        assertEquals(firstUnoffloadedMessage.getEntryId(), 0);

        verify(offloader, times(2)).offload(any(), any(), any());
    }

    @Test
    public void testOffloadV2() throws Exception {
        String topicName = "persistent://prop-xyz/ns1/topic1";
        String mlName = "prop-xyz/ns1/persistent/topic1";
        testOffload(topicName, mlName);
    }

    @Test
    public void testOffloadV1() throws Exception {
        String topicName = "persistent://prop-xyz/test/ns1/topic2";
        String mlName = "prop-xyz/test/ns1/persistent/topic2";
        testOffload(topicName, mlName);
    }

    @Test
    public void testOffloadPolicies() throws Exception {
        String namespaceName = "prop-xyz/ns1";
        String driver = "aws-s3";
        String region = "test-region";
        String bucket = "test-bucket";
        String endpoint = "test-endpoint";
        long offloadThresholdInBytes = 0;
        long offloadDeletionLagInMillis = 100L;
        OffloadedReadPriority priority = OffloadedReadPriority.TIERED_STORAGE_FIRST;

        OffloadPolicies offload1 = OffloadPoliciesImpl.create(
                driver, region, bucket, endpoint, null, null, null, null,
                100, 100, offloadThresholdInBytes, offloadDeletionLagInMillis, priority);
        admin.namespaces().setOffloadPolicies(namespaceName, offload1);
        OffloadPolicies offload2 = admin.namespaces().getOffloadPolicies(namespaceName);
        assertEquals(offload1, offload2);

        admin.namespaces().removeOffloadPolicies(namespaceName);
        OffloadPolicies offload3 = admin.namespaces().getOffloadPolicies(namespaceName);
        assertNull(offload3);
    }

    @Test
    public void testOffloadPoliciesApi() throws Exception {
        final String topicName = testTopic + UUID.randomUUID().toString();
        admin.topics().createPartitionedTopic(topicName, 3);
        pulsarClient.newProducer().topic(topicName).create().close();
        OffloadPoliciesImpl offloadPolicies = (OffloadPoliciesImpl) admin.topics().getOffloadPolicies(topicName);
        assertNull(offloadPolicies);
        OffloadPoliciesImpl offload = new OffloadPoliciesImpl();
        String path = "fileSystemPath";
        offload.setFileSystemProfilePath(path);
        admin.topics().setOffloadPolicies(topicName, offload);
        Awaitility.await().untilAsserted(()
                -> assertNotNull(admin.topics().getOffloadPolicies(topicName)));
        assertEquals(admin.topics().getOffloadPolicies(topicName), offload);
        assertEquals(admin.topics().getOffloadPolicies(topicName).getFileSystemProfilePath(), path);
        admin.topics().removeOffloadPolicies(topicName);
        Awaitility.await().untilAsserted(()
                -> assertNull(admin.topics().getOffloadPolicies(topicName)));
        assertNull(admin.topics().getOffloadPolicies(topicName));
    }

    @Test
    public void testOffloadPoliciesAppliedApi() throws Exception {
        final String topicName = testTopic + UUID.randomUUID().toString();
        admin.topics().createPartitionedTopic(topicName, 3);
        pulsarClient.newProducer().topic(topicName).create().close();
        OffloadPoliciesImpl offloadPolicies = (OffloadPoliciesImpl) admin.topics().getOffloadPolicies(topicName, true);
        OffloadPoliciesImpl brokerPolicies = OffloadPoliciesImpl
                .mergeConfiguration(null,null, pulsar.getConfiguration().getProperties());

        assertEquals(offloadPolicies, brokerPolicies);
        //Since off loader is not really set, avoid code exceptions
        LedgerOffloader topicOffloaded = mock(LedgerOffloader.class);
        when(topicOffloaded.getOffloadDriverName()).thenReturn("mock");
        doReturn(topicOffloaded).when(pulsar).createManagedLedgerOffloader(any());

        OffloadPoliciesImpl namespacePolicies = new OffloadPoliciesImpl();
        namespacePolicies.setManagedLedgerOffloadThresholdInBytes(100L);
        namespacePolicies.setManagedLedgerOffloadDeletionLagInMillis(200L);
        namespacePolicies.setManagedLedgerOffloadDriver("s3");
        namespacePolicies.setManagedLedgerOffloadBucket("buck");
        admin.namespaces().setOffloadPolicies(myNamespace, namespacePolicies);
        Awaitility.await().untilAsserted(() ->
                assertEquals(admin.namespaces().getOffloadPolicies(myNamespace), namespacePolicies));
        assertEquals(
                admin.topics().getOffloadPolicies(topicName, true), namespacePolicies);

        OffloadPoliciesImpl topicPolicies = new OffloadPoliciesImpl();
        topicPolicies.setManagedLedgerOffloadThresholdInBytes(200L);
        topicPolicies.setManagedLedgerOffloadDeletionLagInMillis(400L);
        topicPolicies.setManagedLedgerOffloadDriver("s3");
        topicPolicies.setManagedLedgerOffloadBucket("buck2");

        admin.topics().setOffloadPolicies(topicName, topicPolicies);
        Awaitility.await().untilAsserted(()
                -> assertEquals(admin.topics().getOffloadPolicies(topicName, true), topicPolicies));

        admin.topics().removeOffloadPolicies(topicName);
        Awaitility.await().untilAsserted(()
                -> assertEquals(admin.topics().getOffloadPolicies(topicName, true), namespacePolicies));

        admin.namespaces().removeOffloadPolicies(myNamespace);
        Awaitility.await().untilAsserted(()
                -> assertEquals(admin.topics().getOffloadPolicies(topicName, true), brokerPolicies));
    }

    @Test
    public void testTopicLevelOffloadPartitioned() throws Exception {
        testOffload(true);
    }

    @Test
    public void testTopicLevelOffloadNonPartitioned() throws Exception {
        testOffload(false);
    }

    private void testOffload(boolean isPartitioned) throws Exception {
        String topicName = testTopic + UUID.randomUUID().toString();
        int partitionNum = 3;
        //1 create topic
        if (isPartitioned) {
            admin.topics().createPartitionedTopic(topicName, partitionNum);
        } else {
            admin.topics().createNonPartitionedTopic(topicName);
        }
        pulsarClient.newProducer().topic(topicName).enableBatching(false).create().close();
        //2 namespace level policy should use NullLedgerOffloader by default
        if (isPartitioned) {
            for (int i = 0; i < partitionNum; i++) {
                PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService()
                        .getTopicIfExists(TopicName.get(topicName).getPartition(i).toString()).get().get();
                assertNotNull(topic.getManagedLedger().getConfig().getLedgerOffloader());
                assertEquals(topic.getManagedLedger().getConfig().getLedgerOffloader().getOffloadDriverName()
                        , "NullLedgerOffloader");
            }
        } else {
            PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService()
                    .getTopic(topicName, false).get().get();
            assertNotNull(topic.getManagedLedger().getConfig().getLedgerOffloader());
            assertEquals(topic.getManagedLedger().getConfig().getLedgerOffloader().getOffloadDriverName()
                    , "NullLedgerOffloader");
        }
        //3 construct a topic level offloadPolicies
        OffloadPoliciesImpl offloadPolicies = new OffloadPoliciesImpl();
        offloadPolicies.setOffloadersDirectory(".");
        offloadPolicies.setManagedLedgerOffloadDriver("mock");
        offloadPolicies.setManagedLedgerOffloadPrefetchRounds(10);
        offloadPolicies.setManagedLedgerOffloadThresholdInBytes(1024L);

        LedgerOffloader topicOffloader = mock(LedgerOffloader.class);
        when(topicOffloader.getOffloadDriverName()).thenReturn("mock");
        doReturn(topicOffloader).when(pulsar).createManagedLedgerOffloader(any());

        //4 set topic level offload policies
        admin.topics().setOffloadPolicies(topicName, offloadPolicies);
        Awaitility.await().untilAsserted(()
                -> assertNotNull(admin.topics().getOffloadPolicies(topicName)));
        //5 name of offload should become "mock"
        if (isPartitioned) {
            for (int i = 0; i < partitionNum; i++) {
                PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService()
                        .getTopic(TopicName.get(topicName).getPartition(i).toString(), false).get().get();
                assertNotNull(topic.getManagedLedger().getConfig().getLedgerOffloader());
                assertEquals(topic.getManagedLedger().getConfig().getLedgerOffloader().getOffloadDriverName()
                        , "mock");
            }
        } else {
            PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService()
                    .getTopic(topicName, false).get().get();
            assertNotNull(topic.getManagedLedger().getConfig().getLedgerOffloader());
            assertEquals(topic.getManagedLedger().getConfig().getLedgerOffloader().getOffloadDriverName()
                    , "mock");
        }
        //6 remove topic level offload policy, offloader should become namespaceOffloader
        LedgerOffloader namespaceOffloader = mock(LedgerOffloader.class);
        when(namespaceOffloader.getOffloadDriverName()).thenReturn("s3");
        Map<NamespaceName, LedgerOffloader> map = new HashMap<>();
        map.put(TopicName.get(topicName).getNamespaceObject(), namespaceOffloader);
        doReturn(map).when(pulsar).getLedgerOffloaderMap();
        doReturn(namespaceOffloader).when(pulsar)
                .getManagedLedgerOffloader(TopicName.get(topicName).getNamespaceObject(), null);

        admin.topics().removeOffloadPolicies(topicName);
        Awaitility.await().untilAsserted(()
                -> assertNull(admin.topics().getOffloadPolicies(topicName)));
        if (isPartitioned) {
            for (int i = 0; i < partitionNum; i++) {
                PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService()
                        .getTopicIfExists(TopicName.get(topicName).getPartition(i).toString()).get().get();
                assertNotNull(topic.getManagedLedger().getConfig().getLedgerOffloader());
                assertEquals(topic.getManagedLedger().getConfig().getLedgerOffloader().getOffloadDriverName()
                        , "s3");
            }
        } else {
            PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService()
                    .getTopic(topicName, false).get().get();
            assertNotNull(topic.getManagedLedger().getConfig().getLedgerOffloader());
            assertEquals(topic.getManagedLedger().getConfig().getLedgerOffloader().getOffloadDriverName()
                    , "s3");
        }
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!--
 Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

   - Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

   - Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.

   - Neither the name of Oracle nor the names of its
     contributors may be used to endorse or promote products derived
     from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<project xmlns="http://www.netbeans.org/ns/project/1">
    <type>org.netbeans.modules.ant.freeform</type>
    <configuration>
        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
            <name>JDK Samples</name>
            <view>
                <items/>
            </view>
            <subprojects>
                <project>jmx/jmx-scandir</project>
                <project>scripting/scriptpad</project>
                <project>webservices/EbayClient</project>
                <project>webservices/EbayServer</project>
            </subprojects>
        </general-data>
    </configuration>
</project>


text:
cask 'amadine' do
  version '1.0.8'
  sha256 'cb02e58a577eca830ccbf22076bb93921d59532e54f6bba40343fefb536531be'

  # belightsoft.s3.amazonaws.com/ was verified as official when first introduced to the cask
  url 'https://belightsoft.s3.amazonaws.com/Amadine.dmg'
  appcast 'https://www.belightsoft.com/download/updates/appcast_Amadine.xml'
  name 'Amadine'
  homepage 'https://amadine.com/'

  depends_on macos: '>= :sierra'

  app 'Amadine.app'
end


text:
@interface ZFLoadSharedFavoritesSetsHttpPostIn : FLModelObject {
@private
}

+ (ZFLoadSharedFavoritesSetsHttpPostIn*) loadSharedFavoritesSetsHttpPostIn;

@end


text:
require 'rubygems'
require 'net/http'
require 'uri'
require 'nokogiri'
require 'json'
require 'elasticsearch'

class Crawler
  class NoUrlSpecified < StandardError; end

  def self.start_crawling(options={})
    crawler = new(options)
    crawler.start_crawler
    crawler.start_fetchers
  end

  def initialize(options={})
    @url           = options[:url]
    @max_depth     = options[:depth] || 1
    @mutex         = Mutex.new
    @queue         = []
    @fetcher_count = 3

    raise NoUrlSpecified unless @url
    # puts "We're going to crawl: #{@url} with a max depth of #{@max_depth}"
  end

  def queue
    @mutex.synchronize do
      @queue
    end
  end

  def start_crawler
    queue.push([@url, 0])
  end

  def start_fetchers
    @fetcher_threads ||= @fetcher_count.times.map do
      Thread.new do
        loop do
          if item = queue.shift
            crawl(*item)
          end

          next unless queue.empty?
          sleep 0.5
        end
      end
    end
    @fetcher_threads.each{|t| t.join}
  end

  def crawl(url, depth = 0)
    begin
      response = fetch(url)
    rescue Exception
      log("FAILED: #{url}", depth)
    end
    return unless response

    page = Nokogiri::HTML(response.body)
    index url, response, page
    return true if depth+1 > @max_depth

    page.css('a').each do |link|
      new_url = link['href']
      next unless valid_url?(new_url)
      queue.push([new_url, depth+1])
    end
  end

  def indexer
    return @indexer if @indexer
    @indxer = ElasticSearch.new('127.0.0.1:9200', :index => base_uri.host, :type => "docs")
  end

  def search query
    indexer.search query
  end

  def get guid
    indexer.get guid
  end

  def self.search site, query
    Crawler.new(:url => site).search query
  end

  def self.get site, guid
    Crawler.new(:url => site).get guid
  end

  def index url, response, page
    hash = {
      'url'   => url,
      'title' => page.css('title').first.content,
      # we need to parse out valuable text here leave JS on the floor
      'body'  => page.css('body').first.inner_text,
      'page'  => response.body
    }
    response.each_header{ |k,v| hash[k] = v }
    indexer.index(hash)
    log("INDEXED: #{url} - #{hash['title']}")
  end

  def fetch(uri_str, limit = 10)
    raise ArgumentError, 'HTTP redirect too deep' if limit == 0

    case response = Net::HTTP.get_response(URI.parse(uri_str))
    when Net::HTTPSuccess     then response
    when Net::HTTPRedirection then fetch(response['location'], limit - 1)
    else
      response.error!
    end
  end

  def log(message, depth=0)
    puts "#{"\t"*depth}#{Thread.current.object_id} - #{message}"
  end

  def base_uri
    @uri ||= URI.parse @url
  end

  def valid_url?(url)
    return false if url.nil? || url =~ /^#/ || url =~ /^javascript/
    begin
      base_uri.host.eql? URI.parse(url).host
    rescue URI::InvalidURIError
      false
    end
  end
end

if __FILE__ == $0
  Crawler.start_crawling :url => ARGV[0], :depth => 2
end


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>
类 java.lang.NumberFormatException 的使用 (Java Platform SE 6)
</TITLE>

<META NAME="date" CONTENT="2007-03-19">

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

      概述
      软件包
      类
    使用
      树
      已过时
      索引
      帮助

JavaTM Platform
Standard Ed. 6

 上一个
 下一个

  框架
 无框架

  所有类

类 java.lang.NumberFormatException
的使用

使用 NumberFormatException 的软件包

java.awt
包含用于创建用户界面和绘制图形图像的所有类。

java.lang
提供利用 Java 编程语言进行程序设计的基础类。

java.awt 中 NumberFormatException 的使用

抛出 NumberFormatException 的 java.awt 中的方法

static Color
Color.decode(String nm)

          将 String 转换成整数,并返回指定的不透明 Color。

java.lang 中 NumberFormatException 的使用

抛出 NumberFormatException 的 java.lang 中的方法

static Long
Long.decode(String nm)

          将 String 解码成 Long。

static Integer
Integer.decode(String nm)

          将 String 解码为 Integer。

static Short
Short.decode(String nm)

          将 String 解码为 Short。

static Byte
Byte.decode(String nm)

          将 String 解码为 Byte。

 boolean
Package.isCompatibleWith(String desired)

          比较此包的规范版本和所需版本。

static byte
Byte.parseByte(String s)

          将 string 参数解析为有符号的十进制 byte。

static byte
Byte.parseByte(String s,
          int radix)

          将 string 参数解析为一个有符号的 byte,其基数由第二个参数指定。

static double
Double.parseDouble(String s)

          返回一个新的 double 值,该值被初始化为用指定 String 表示的值,这与 Double 类的 valueOf 方法一样。

static float
Float.parseFloat(String s)

          返回一个新的 float 值,该值被初始化为用指定 String 表示的值,这与 Float 类的 valueOf 方法一样。

static int
Integer.parseInt(String s)

          将字符串参数作为有符号的十进制整数进行解析。

static int
Integer.parseInt(String s,
         int radix)

          使用第二个参数指定的基数,将字符串参数解析为有符号的整数。

static long
Long.parseLong(String s)

          将 string 参数解析为有符号十进制 long。

static long
Long.parseLong(String s,
          int radix)

          将 string 参数解析为有符号的 long,基数由第二个参数指定。

static short
Short.parseShort(String s)

          将字符串参数解析为有符号的十进制 short。

static short
Short.parseShort(String s,
           int radix)

          将字符串参数解析为由第二个参数指定的基数中的有符号的 short。

static Long
Long.valueOf(String s)

          返回保持指定 String 的值的 Long 对象。

static Integer
Integer.valueOf(String s)

          返回保存指定的 String 的值的 Integer 对象。

static Short
Short.valueOf(String s)

          返回一个保持指定 String 所给出的值的 Short 对象。

static Byte
Byte.valueOf(String s)

          返回一个保持指定 String 所给出的值的 Byte 对象。

static Double
Double.valueOf(String s)

          返回保存用参数字符串 s 表示的 double 值的 Double 对象。

static Float
Float.valueOf(String s)

          返回保存用参数字符串 s 表示的 float 值的 Float 对象。

static Long
Long.valueOf(String s,
        int radix)

          当使用第二个参数给出的基数进行解析时,返回保持从指定 String 中提取的值的 Long 对象。

static Integer
Integer.valueOf(String s,
        int radix)

          返回一个 Integer 对象,该对象中保存了用第二个参数提供的基数进行解析时从指定的 String 中提取的值。

static Short
Short.valueOf(String s,
        int radix)

          返回一个 Short 对象,该对象保持从指定的 String 中提取的值,该值是在使用第二个参数给出的基数对指定字符串进行解析时提取的。

static Byte
Byte.valueOf(String s,
        int radix)

          返回一个 Byte 对象,该对象保持从指定的 String 中提取的值,该值是在用第二个参数所给定的基数对指定字符串进行解析时提取的。

抛出 NumberFormatException 的 java.lang 中的构造方法

Byte(String s)

          构造一个新分配的 Byte 对象,以表示 String 参数所指示的 byte 值。

Double(String s)

          构造一个新分配的 Double 对象,表示用字符串表示的 double 类型的浮点值。

Float(String s)

          构造一个新分配的 Float 对象,它表示用字符串表示的 float 类型的浮点值。

Integer(String s)

          构造一个新分配的 Integer 对象,它表示 String 参数所指示的 int 值。

Long(String s)

          构造新分配的 Long 对象,表示由 String 参数指示的 long 值。

Short(String s)

          构造一个新分配的 Short 对象,用来表示 String 参数所指示的 short 值。

      概述
      软件包
      类
    使用
      树
      已过时
      索引
      帮助

JavaTM Platform
Standard Ed. 6

 上一个
 下一个

  框架
 无框架

  所有类

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。


text:
package cn.rongcloud.demo_imlib_basic_android;

import android.content.Context;
import android.widget.Toast;

import cn.rongcloud.demo_imlib_basic_android.logger.Log;
import cn.rongcloud.demo_imlib_basic_android.message.CustomizeMessage;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Message;
import io.rong.message.FileMessage;
import io.rong.message.ImageMessage;
import io.rong.message.TextMessage;
import io.rong.message.VoiceMessage;

/**
 * Created by Beyond on 27/10/2016.
 */

class AppContext{
    private static final String TAG = "AppContext";
    private int mMessageId;

    private static AppContext appContext = new AppContext();
    private Context mContext;

    private AppContext() {
    }

    static AppContext getInstance() {
        return appContext;
    }

    public int getMessageId() {
        return mMessageId;
    }

    private void setMessageId(int mMessageId) {
        this.mMessageId = mMessageId;
    }

    void init(Context context) {
        mContext = context.getApplicationContext();
    }

    void registerReceiveMessageListener() {
        RongIMClient.setOnReceiveMessageListener(onReceiveMessageListener);
    }

    /**
     * 设置接收消息的监听器
     */
    private RongIMClient.OnReceiveMessageListener onReceiveMessageListener = new RongIMClient.OnReceiveMessageListener() {
        @Override
        public boolean onReceived(Message message, int i) {
            if (message.getContent() instanceof TextMessage) {
                Log.d(TAG, "收到文本消息: " + ((TextMessage) message.getContent()).getContent());
                Log.d(TAG, "文本消息的附加信息: " + ((TextMessage) message.getContent()).getExtra() + '\n');
//                setMessageRead(message); //设置收到的消息为已读消息
            } else if (message.getContent() instanceof ImageMessage) {
                Log.d(TAG, "收到图片消息, Uri --> " + ((ImageMessage) message.getContent()).getThumUri() + '\n');
            } else if (message.getContent() instanceof VoiceMessage) {
                Log.d(TAG, "收到语音消息,Uri --> " + ((VoiceMessage)message.getContent()).getUri());
                Log.d(TAG, "语音消息时长: " + ((VoiceMessage)message.getContent()).getDuration() + '\n');
            } else if (message.getContent() instanceof FileMessage) {
                Log.d(TAG, "服务端 Uri --> " + ((FileMessage)message.getContent()).getFileUrl() + '\n');
            } else if (message.getContent() instanceof CustomizeMessage) {
                Log.d(TAG, "成功发送自定义消息,它的时间戳: " + ((CustomizeMessage) message.getContent()).getSendTime());
                Log.d(TAG, "自定义消息的内容: " + ((CustomizeMessage) message.getContent()).getContent() + '\n');
            }
            setMessageId(message.getMessageId());
            return false;
        }
    };

    /**
     * 设置消息为已读消息
     */
    private void setMessageRead(Message message) {
        if (message.getMessageId() > 0) {
            io.rong.imlib.model.Message.ReceivedStatus status = message.getReceivedStatus();
            status.setRead();
            message.setReceivedStatus(status);
            RongIMClient.getInstance().setMessageReceivedStatus(message.getMessageId(), status, null);
            Toast.makeText(mContext, "该条消息已设置为已读", Toast.LENGTH_LONG).show();
        }
    }
}


text:
{% for i in site.data.urls %}
	{% assign current = nil %}
	{% assign pageurl = page.url | split:'/' | last %}
	{% assign menuurl = i.url | split:'/' | last %}
	{% assign linkurl = nil %}
	{% if i.url contains '://' %}
	{% assign linkurl = i.url %}
	{% else %}
	{% assign linkurl = i.url | prepend: site.baseurl %}
	{% endif %}
	{% assign target = i.target %}
    {% unless target %} {% assign target = '_self' %} {% endunless %}
	{% if pageurl == menuurl or page.menuId == i.id %} {% assign current = 'current-menu-item' %} {% endif %}

 {{ i.text }}

{% endfor %}


text:
package net.teamfruit.factorioforge.mod;

import java.util.List;

public class ModListBean {

	public List<ModBean> mods;

	public static class ModBean {
		public String name;
		public boolean enabled;
	}
}


text:
export interface AmPolicyDecision {
  resource: string;
  actions: { [ action: string ]: boolean; };
  attributes: { [ attribute: string ]: string[]; };
  advices: any;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <title>

    Horizontal Sharding
 —
    SQLAlchemy 1.3 Documentation

        </title>

                <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
                <link rel="stylesheet" href="../../_static/docs.css" type="text/css" />
                <link rel="stylesheet" href="../../_static/changelog.css" type="text/css" />
                <link rel="stylesheet" href="../../_static/sphinx_paramlinks.css" type="text/css" />

    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
        <link rel="copyright" title="Copyright" href="../../copyright.html" />
    <link rel="top" title="SQLAlchemy 1.3 Documentation" href="../../index.html" />
        <link rel="up" title="ORM Extensions" href="index.html" />
        <link rel="next" title="Hybrid Attributes" href="hybrid.html" />
        <link rel="prev" title="Ordering List" href="orderinglist.html" />

        Release: 1.3.17

        | Release Date: May 13, 2020

SQLAlchemy 1.3 Documentation

SQLAlchemy 1.3 Documentation

                Contents |
                Index

                <form class="search" action="../../search.html" method="get">

                  Search terms:
                  <input type="text" placeholder="search..." name="q" size="12" />

                  <input type="hidden" name="check_keywords" value="yes" />
                  <input type="hidden" name="area" value="default" />
                </form>

            SQLAlchemy ORM

Object Relational Tutorial

Mapper Configuration

Relationship Configuration

Loading Objects

Using the Session

Events and Internals

ORM Extensions

Association Proxy

Automap

Baked Queries

Declarative

Mutation Tracking

Ordering List

Horizontal Sharding¶

API Documentation

Hybrid Attributes

Indexable

Alternate Class Instrumentation

ORM Examples

Horizontal Sharding¶

Horizontal sharding support.

Defines a rudimental 'horizontal sharding' system which allows a Session to
distribute queries and persistence operations across multiple databases.

For a usage example, see the Horizontal Sharding example included in
the source distribution.

API Documentation¶

class sqlalchemy.ext.horizontal_shard.ShardedSession(shard_chooser, id_chooser, query_chooser, shards=None, query_cls=<class 'sqlalchemy.ext.horizontal_shard.ShardedQuery'>, **kwargs)¶

Bases: sqlalchemy.orm.session.Session

method sqlalchemy.ext.horizontal_shard.ShardedSession.__init__(shard_chooser, id_chooser, query_chooser, shards=None, query_cls=<class 'sqlalchemy.ext.horizontal_shard.ShardedQuery'>, **kwargs)¶

Construct a ShardedSession.

Parameters

shard_chooser¶ – A callable which, passed a Mapper, a mapped
instance, and possibly a SQL clause, returns a shard ID.  This id
may be based off of the attributes present within the object, or on
some round-robin scheme. If the scheme is based on a selection, it
should set whatever state on the instance to mark it in the future as
participating in that shard.

id_chooser¶ – A callable, passed a query and a tuple of identity
values, which should return a list of shard ids where the ID might
reside.  The databases will be queried in the order of this listing.

query_chooser¶ – For a given Query, returns the list of shard_ids
where the query should be issued.  Results from all shards returned
will be combined together into a single listing.

shards¶ – A dictionary of string shard names
to Engine objects.

method sqlalchemy.ext.horizontal_shard.ShardedSession.connection(mapper=None, instance=None, shard_id=None, **kwargs)¶

Return a Connection object corresponding to this
Session object's transactional state.

If this Session is configured with autocommit=False,
either the Connection corresponding to the current
transaction is returned, or if no transaction is in progress, a new
one is begun and the Connection
returned (note that no
transactional state is established with the DBAPI until the first
SQL statement is emitted).

Alternatively, if this Session is configured with
autocommit=True, an ad-hoc Connection is returned
using Engine.connect() on the underlying
Engine.

Ambiguity in multi-bind or unbound Session objects can be
resolved through any of the optional keyword arguments.   This
ultimately makes usage of the get_bind() method for resolution.

Parameters

bind¶ – Optional Engine to be used as the bind.  If
this engine is already involved in an ongoing transaction,
that connection will be used.  This argument takes precedence
over mapper, clause.

mapper¶ – Optional mapper() mapped class, used to identify
the appropriate bind.  This argument takes precedence over
clause.

clause¶ – A ClauseElement (i.e.
select(),
text(),
etc.) which will be used to locate a bind, if a bind
cannot otherwise be identified.

close_with_result¶ – Passed to Engine.connect(),
indicating the Connection should be considered
"single use", automatically closing when the first result set is
closed.  This flag only has an effect if this Session is
configured with autocommit=True and does not already have a
transaction in progress.

execution_options¶ –
a dictionary of execution options that will
be passed to Connection.execution_options(), when the
connection is first procured only.   If the connection is already
present within the Session, a warning is emitted and
the arguments are ignored.

New in version 0.9.9.

See also

Setting Transaction Isolation Levels

**kw¶ – Additional keyword arguments are sent to get_bind(),
allowing additional arguments to be passed to custom
implementations of get_bind().

method sqlalchemy.ext.horizontal_shard.ShardedSession.get_bind(mapper, shard_id=None, instance=None, clause=None, **kw)¶

Return a "bind" to which this Session is bound.

The "bind" is usually an instance of Engine,
except in the case where the Session has been
explicitly bound directly to a Connection.

For a multiply-bound or unbound Session, the
mapper or clause arguments are used to determine the
appropriate bind to return.

Note that the "mapper" argument is usually present
when Session.get_bind() is called via an ORM
operation such as a Session.query(), each
individual INSERT/UPDATE/DELETE operation within a
Session.flush(), call, etc.

The order of resolution is:

if mapper given and session.binds is present,
locate a bind based first on the mapper in use, then
on the mapped class in use, then on any base classes that are
present in the __mro__ of the mapped class, from more specific
superclasses to more general.

if clause given and session.binds is present,
locate a bind based on Table objects
found in the given clause present in session.binds.

if session.bind is present, return that.

if clause given, attempt to return a bind
linked to the MetaData ultimately
associated with the clause.

if mapper given, attempt to return a bind
linked to the MetaData ultimately
associated with the Table or other
selectable to which the mapper is mapped.

No bind can be found, UnboundExecutionError
is raised.

Note that the Session.get_bind() method can be overridden on
a user-defined subclass of Session to provide any kind
of bind resolution scheme.  See the example at
Custom Vertical Partitioning.

Parameters

mapper¶ – Optional mapper() mapped class or instance of
Mapper.   The bind can be derived from a
Mapper
first by consulting the "binds" map associated with this
Session, and secondly by consulting the
MetaData
associated with the Table to which the
Mapper
is mapped for a bind.

clause¶ – A ClauseElement (i.e.
select(),
text(),
etc.).  If the mapper argument is not present or could not
produce a bind, the given expression construct will be searched
for a bound element, typically a Table
associated with
bound MetaData.

See also

Partitioning Strategies (e.g. multiple database backends per Session)

Session.binds

Session.bind_mapper()

Session.bind_table()

class sqlalchemy.ext.horizontal_shard.ShardedQuery(*args, **kwargs)¶

Bases: sqlalchemy.orm.query.Query

method sqlalchemy.ext.horizontal_shard.ShardedQuery.set_shard(shard_id)¶

return a new query, limited to a single shard ID.

all subsequent operations with the returned query will
be against the single shard regardless of other state.

        Previous:
        Ordering List
        Next:
        Hybrid Attributes

        © Copyright 2007-2020, the SQLAlchemy authors and contributors.
        Created using Sphinx 3.0.3.


text:
#ifndef CPPDEVTK_BASE_IOS_HPP_INCLUDED_
#define CPPDEVTK_BASE_IOS_HPP_INCLUDED_

#include "config.hpp"
#include "ios_failure_exception.hpp"

#include <ios>

namespace cppdevtk {
namespace base {

}	// namespace base
}	// namespace cppdevtk

#endif	// CPPDEVTK_BASE_IOS_HPP_INCLUDED_


text:
import praw
from prawoauth2 import PrawOAuth2Server

from tokens import app_key, app_secret
from settings import user_agent, scopes

reddit_client = praw.Reddit(user_agent=user_agent)
oauthserver = PrawOAuth2Server(reddit_client, app_key=app_key,
                               app_secret=app_secret, state=user_agent,
                               scopes=scopes)

# start the server, this will open default web browser
# asking you to authenticate
oauthserver.start()
tokens = oauthserver.get_access_codes()
print(tokens)

# may be set the env variables here only?
# os.environ['HL3_ACCESS_TOKEN'] = tokens['access_token']
# os.environ['HL3_REFRESH_TOKEN'] = tokens['refresh_token']


text:
package edu.danc.newEngine;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JTextArea;

import edu.danc.gui.Controls;

/** Main class - starts the application **/
public class Application {

	/** This is going to be a command line app. I.e. all information will be asked
	using a terminal **/
	public static void main(String[] args) {
		//First ask for a list of rules

		//Then ask for a list of classes

		//What semester is it?
		//What is order of blocks?
	}
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 4/2/2017
 * Time: 6:20 PM
 */

namespace backend\controllers;
use backend\models\BudgetMonitoringDetail;
use backend\models\Smk3Detail;
use Yii;
use yii\filters\VerbFilter;
use yii\web\NotFoundHttpException;
use yii\helpers\Json;

class Smk3DetailController extends AppController
{
    public function behaviors() {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    public function beforeAction($action) {
        parent::beforeAction($action);
        return $this->rbac();
    }

    /**
     * Finds the Smk3Detail model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Smk3Detail the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id) {
        if (($model = Smk3Detail::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }

    /**
     * Deletes an existing Smk3Detail model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionAjaxDelete() {
        $requestData = Yii::$app->request->post();
        $id = $requestData['id'];
        if ($this->findModel($id)->delete()) {
            return Json::encode(true);
        }

        return Json::encode(false);
    }
}


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

<TITLE>
org.apache.hadoop.mapred (Hadoop 0.2.0 API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.hadoop.mapred package">

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

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.apache.hadoop.mapred

A system for scalable, fault-tolerant, distributed computation over
large data collections.

See:

          Description

Interface Summary

InputFormat
An input data format.

JobConfigurable
That what may be configured.

Mapper
Maps input key/value pairs to a set of intermediate key/value pairs.

MapRunnable
Expert: Permits greater control of map processing.

OutputCollector
Passed to Mapper and Reducer implementations to collect
 output data.

OutputFormat
An output data format.

Partitioner
Partitions the key space.

RecordReader
Reads key/value pairs from an input file FileSplit.

RecordWriter
Writes key/value pairs to an output file.

Reducer
Reduces a set of intermediate values which share a key to a smaller set of
 values.

Reporter
Passed to application code to permit alteration of status.

RunningJob
Includes details on a running MapReduce job.

Class Summary

ClusterStatus
Summarizes the size and current state of the cluster.

FileSplit
A section of an input file.

InputFormatBase
A base class for InputFormat.

JobClient
JobClient interacts with the JobTracker network interface.

JobConf
A map/reduce job configuration.

JobTracker
JobTracker is the central location for submitting and
 tracking MR jobs in a network environment.

MapFileOutputFormat
An OutputFormat that writes MapFiles.

MapReduceBase
Base class for Mapper and Reducer implementations.

MapRunner
Default MapRunnable implementation.

OutputFormatBase
A base class for OutputFormat.

SequenceFileInputFormat
An InputFormat for SequenceFiles.

SequenceFileOutputFormat
An OutputFormat that writes SequenceFiles.

SequenceFileRecordReader
An RecordReader for SequenceFiles.

TaskReport
A report on the state of a task.

TaskTracker
TaskTracker is a process that starts and tracks MR Tasks
 in a networked environment.

TaskTracker.Child
The main() for child processes.

TextInputFormat
An InputFormat for plain text files.

TextOutputFormat
An OutputFormat that writes plain text files.

Package org.apache.hadoop.mapred Description

A system for scalable, fault-tolerant, distributed computation over
large data collections.

Applications implement Mapper and
Reducer interfaces.  These are submitted
as a JobConf and are applied to data
stored in a FileSystem.

See Google's
original Map/Reduce paper for background information.

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2006 The Apache Software Foundation


text:
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
using Xunit;

namespace System.Reflection.Emit.Tests
{
    public class EnumBuilderAssembly
    {
        private AssemblyBuilder _myAssemblyBuilder;
        private ModuleBuilder _myModuleBuilder;
        private EnumBuilder _myEnumBuilder;
        private void CreateCallee()
        {
            AssemblyName myAssemblyName = new AssemblyName();
            myAssemblyName.Name = "EnumAssembly";
            _myAssemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(myAssemblyName, AssemblyBuilderAccess.Run);
            _myModuleBuilder = TestLibrary.Utilities.GetModuleBuilder(_myAssemblyBuilder, "EnumModule.mod");
        }

        [Fact]
        public void TestAssemblyProperty()
        {
            CreateCallee();
            _myEnumBuilder = _myModuleBuilder.DefineEnum("myEnum", TypeAttributes.Public, typeof(int));
            _myEnumBuilder.AsType();
            Assembly myAssem = _myEnumBuilder.Assembly;
            Assert.Equal(_myAssemblyBuilder.FullName, myAssem.FullName);
        }
    }
}


text:
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreatePaypalOrderTransactionTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('paypal_order_transaction', function(Blueprint $table)
		{
			$table->increments('paypal_order_transaction_id');
			$table->integer('paypal_order_id')->unsigned();
			$table->char('transaction_id', 20);
			$table->char('parent_transaction_id', 20);
			$table->dateTime('date_added');
			$table->string('note');
			$table->char('msgsubid', 38);
			$table->char('receipt_id', 20);
			$table->enum('payment_type', array('none','echeck','instant','refund','void'))->nullable();
			$table->char('payment_status', 20);
			$table->char('pending_reason', 50);
			$table->char('transaction_entity', 50);
			$table->decimal('amount', 10)->unsigned();
			$table->text('debug_data', 65535);
			$table->text('call_data', 65535);
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('paypal_order_transaction');
	}

}


text:
{% extends "layout.html" %}
{% block body %}

Twitter Wall

Just enter what do you want to see from Twitter in form above and press Go!

{% endblock %}


text:
from gettext import gettext as _

from django.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError

import datetime
import re

from cyder.base.constants import IP_TYPE_6
from cyder.base.eav.constants import (ATTRIBUTE_OPTION, ATTRIBUTE_STATEMENT,
                                      ATTRIBUTE_INVENTORY)
from cyder.base.eav.fields import EAVAttributeField
from cyder.base.eav.models import Attribute, EAVBase
from cyder.base.fields import MacAddrField
from cyder.base.models import ExpirableMixin
from cyder.base.utils import transaction_atomic
from cyder.core.system.models import System
from cyder.cydhcp.constants import (STATIC, DEFAULT_WORKGROUP)
from cyder.cydhcp.range.utils import find_range
from cyder.cydhcp.utils import format_mac, join_dhcp_args
from cyder.cydhcp.workgroup.models import Workgroup
from cyder.cydhcp.validation import validate_system_static_ctnr
from cyder.cydns.address_record.models import AddressRecord, BaseAddressRecord
from cyder.cydns.domain.models import Domain
from cyder.cydns.ip.utils import ip_to_reverse_name
from cyder.cydns.ptr.models import BasePTR, PTR

class StaticInterface(BaseAddressRecord, BasePTR, ExpirableMixin):
    # Keep in mind that BaseAddressRecord will have it's methods called before
    # BasePTR
    """The StaticInterface Class.

        >>> s = StaticInterface(label=label, domain=domain, ip_str=ip_str,
        ... ip_type=ip_type, dhcp_enabled=True, dns_enabled=True)
        >>> s.save()

    This class is the main interface to DNS and DHCP. A static
    interface consists of three key pieces of information: IP address, MAC
    address, and hostname (the hostname is comprised of a label and a domain).
    From these three pieces of information, three things are ensured: An A or
    AAAA DNS record, a PTR record, and a `host` statement in the DHCP builds
    that grants the MAC address of the interface the correct IP address and
    hostname.

    If you want an A/AAAA, PTR, and a DHCP lease, create one of these objects.

    In terms of DNS, a static interface represents a PTR and A record and must
    adhere to the requirements of those classes. The interface inherits from
    BaseAddressRecord.
    """

    pretty_type = 'static interface'

    id = models.AutoField(primary_key=True)
    mac = MacAddrField(dhcp_enabled='dhcp_enabled', verbose_name='MAC address',
                       help_text='(required if DHCP is enabled)')
    reverse_domain = models.ForeignKey(Domain, null=True, blank=True,
                                       related_name='reverse_staticintr_set')
    system = models.ForeignKey(
        System, help_text='System to associate the interface with')

    workgroup = models.ForeignKey(Workgroup, null=False, blank=False,
                                  default=DEFAULT_WORKGROUP)

    dhcp_enabled = models.BooleanField(verbose_name='Enable DHCP?',
                                       default=True)
    dns_enabled = models.BooleanField(verbose_name='Enable DNS?',
                                      default=True)

    last_seen = models.DateTimeField(null=True, blank=True)

    search_fields = ('mac', 'ip_str', 'fqdn', 'description')

    class Meta:
        app_label = 'cyder'
        db_table = 'static_interface'
        unique_together = (('fqdn',),
                           ('ip_str',))

    @staticmethod
    def filter_by_ctnr(ctnr, objects=None):
        objects = objects or StaticInterface.objects
        return objects.filter(system__ctnr=ctnr)

    def __unicode__(self):
        return self.fqdn

    @property
    def range(self):
        if self.ip_str:
            return find_range(self.ip_str)

    @property
    def ctnr(self):
        return self.system.ctnr

    def details(self):
        data = super(StaticInterface, self).details()
        data['data'] = (
            ('Name', 'fqdn', self),
            ('System', 'system', self.system),
            ('IP', 'ip_lower', str(self.ip_str)),
            ('MAC', 'mac', self.mac),
            ('Workgroup', 'workgroup', self.workgroup),
            ('DHCP', 'dhcp_enabled',
                'True' if self.dhcp_enabled else 'False'),
            ('DNS', 'dns_enabled',
                'True' if self.dns_enabled else 'False'),
        )
        return data

    @staticmethod
    def eg_metadata():
        """EditableGrid metadata."""
        return {'metadata': [
            {'name': 'fqdn', 'datatype': 'string', 'editable': False},
        ]}

    @property
    def rdtype(self):
        return 'INTR'

    def get_related_systems(self):
        related_interfaces = StaticInterface.objects.filter(mac=self.mac)
        related_interfaces = related_interfaces.select_related('system')
        related_systems = set()
        for interface in related_interfaces:
            related_systems.update([interface.system])
        return related_systems

    @transaction_atomic
    def save(self, *args, **kwargs):
        self.full_clean()

        update_range_usage = kwargs.pop('update_range_usage', True)
        old_range = None
        if self.id is not None:
            old_range = StaticInterface.objects.get(id=self.id).range

        super(StaticInterface, self).save(*args, **kwargs)
        self.schedule_zone_rebuild()
        if update_range_usage:
            new_range = self.range
            if new_range:
                new_range.save(commit=False)
            if old_range:
                old_range.save(commit=False)

    @transaction_atomic
    def delete(self, *args, **kwargs):
        rng = self.range
        update_range_usage = kwargs.pop('update_range_usage', True)
        delete_system = kwargs.pop('delete_system', True)

        if delete_system:
            if(not self.system.staticinterface_set.exclude(
                    id=self.id).exists() and
                    not self.system.dynamicinterface_set.exists()):
                self.system.delete(commit=False)

        super(StaticInterface, self).delete(*args, **kwargs)
        if rng and update_range_usage:
            rng.save(commit=False)

    def schedule_zone_rebuild(self):
        if self.domain.soa is not None:
            self.domain.soa.schedule_rebuild()
        if self.reverse_domain.soa is not None:
            self.reverse_domain.soa.schedule_rebuild()

    def check_A_PTR_collision(self):
        if PTR.objects.filter(ip_str=self.ip_str).exists():
            raise ValidationError("A PTR already uses '%s'." % self.ip_str)
        if AddressRecord.objects.filter(fqdn=self.fqdn,
                                        ip_type=self.ip_type).exists():
            raise ValidationError("An address record already "
                                  "uses '%s'." % self.fqdn)

    def format_host_option(self, option):
        s = str(option)
        s = s.replace('%h', self.label)
        s = s.replace('%i', self.ip_str)
        s = s.replace('%m', self.mac.replace(':', ''))
        s = s.replace('%6m', self.mac.replace(':', '')[0:6])
        return s

    def build_host(self, options=None):
        build_str = '\thost {0} {{\n'.format(self.fqdn)
        build_str += '\t\thardware ethernet {0};\n'.format(self.mac)
        if self.ip_type == IP_TYPE_6:
            build_str += '\t\tfixed-address6 {0};\n'.format(self.ip_str)
        else:
            build_str += '\t\tfixed-address {0};\n'.format(self.ip_str)
        build_str += join_dhcp_args(map(self.format_host_option, options),
                                    depth=2)
        build_str += '\t}\n'
        return build_str

    def build_subclass(self, classname):
        return 'subclass "{0}" 1:{1};\n'.format(classname, self.mac)

    def clean(self, *args, **kwargs):
        validate_glue = kwargs.pop('validate_glue', True)

        super(StaticInterface, self).clean(validate_glue=False,
                                           ignore_intr=True)

        if self.dhcp_enabled or self.dns_enabled:
            if not self.range:
                raise ValidationError("An appropriate static range can not be "
                                      "found for this IP address.")
            if self.ctnr not in self.range.ctnr_set.all():
                raise ValidationError("Can't create interface because %s is "
                                      "not in its container." % self.ip_str)

        self.check_A_PTR_collision()

        if (self.workgroup.pk != DEFAULT_WORKGROUP
                and self.ctnr not in self.workgroup.ctnr_set.all()):
            raise ValidationError("Workgroup is not in this static "
                                  "interface's container.")

        if validate_glue:
            self.check_glue_status()

        if self.dhcp_enabled:
            if not (self.range and self.range.range_type == STATIC):
                raise ValidationError('DHCP is enabled for this interface, so '
                                      'its IP must be in a static range.')

        validate_system_static_ctnr(self.system, self)

    def check_glue_status(self):
        """If this interface is a 'glue' record for a Nameserver instance,
        do not allow modifications to this record. The Nameserver will
        need to point to a different record before this record can
        be updated.
        """
        if self.pk is None:
            return
        # First get this object from the database and compare it to the
        # Nameserver object about to be saved.
        db_self = StaticInterface.objects.get(pk=self.pk)
        if db_self.label == self.label and db_self.domain == self.domain:
            return
        # The label of the domain changed. Make sure it's not a glue record.
        from cyder.cydns.nameserver.models import Nameserver
        if Nameserver.objects.filter(intr_glue=self).exists():
            raise ValidationError(
                "This Interface represents a glue record for a "
                "Nameserver. Change the Nameserver to edit this record.")

    a_template = _("{bind_name:$lhs_just} {ttl:$ttl_just}  "
                   "{rdclass:$rdclass_just}"
                   " {rdtype_clob:$rdtype_just} {ip_str:$rhs_just}")
    ptr_template = _("{dns_ip:$lhs_just} {ttl:$ttl_just}  "
                     "{rdclass:$rdclass_just}"
                     " {rdtype_clob:$rdtype_just} {fqdn:1}.")

    def bind_render_record(self, pk=False, **kwargs):
        self.rdtype_clob = kwargs.pop('rdtype', 'INTR')
        if kwargs.pop('reverse', False):
            self.template = self.ptr_template
            self.dns_ip = ip_to_reverse_name(self.ip_str) + '.'
        else:
            self.template = self.a_template
        return super(StaticInterface, self).bind_render_record(pk=pk, **kwargs)


text:
sap.ui.define(['jquery.sap.global', 'sap/ui/core/Renderer', 'sap/ui/unified/calendar/CalendarUtils', './MonthRenderer', './DatesRowRenderer'],
	function(jQuery, Renderer, CalendarUtils, MonthRenderer, DatesRowRenderer) {
		"use strict";

		/**
		 * OneMonthDatesRowRenderer renderer.
		 * @namespace
		 */
		var OneMonthDatesRowRenderer = Renderer.extend(DatesRowRenderer);

		OneMonthDatesRowRenderer.getClass = function(oDatesRow){
			if (oDatesRow.iMode < 2) {
				return MonthRenderer.getClass(oDatesRow);
			} else {
				return DatesRowRenderer.getClass(oDatesRow);
			}
		};

		/**
		 * @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
		 * @param {sap.ui.unified.DatesRow} oDatesRow The DatesRow to be rendered
		 * @param {sap.ui.unified.calendar.CalendarDate} oDate The start date
		 */
		OneMonthDatesRowRenderer.renderDays = function(oRm, oDatesRow, oDate) {
			if (oDatesRow.iMode < 2) {
				MonthRenderer.renderDays(oRm, oDatesRow, oDate);
			} else {
				DatesRowRenderer.renderDays(oRm, oDatesRow, oDate);
			}
		};

		return OneMonthDatesRowRenderer;

	}, /* bExport=  */ true);


text:
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import style from './EntityTreeButton.scss'

class EntityTreeButton extends Component {
  render () {
    const { onClick, active } = this.props

    return (
      <button
        className={style.entityTreeButton + ' ' + (active ? style.active : '')}
        onClick={onClick}
      >
        {this.props.children}
      </button>
    )
  }
}

EntityTreeButton.propTypes = {
  onClick: PropTypes.func,
  active: PropTypes.bool
}

export default EntityTreeButton


text:
package exception;

/**
 * Exceptions related to errors while inspecting data loaded into Piazza.
 *
 * @author Patrick.Doody
 *
 */
@SuppressWarnings("serial")
public class DataInspectException extends Exception {
	public DataInspectException(String message) {
		super(message);
	}
}


text:
using System;
using static System.FormattableString;

namespace HarshPoint.Provisioning
{
    public abstract class HarshProvisionerRecord
    {
        public String Context { get; internal set; }

        public String Identifier { get; internal set; }

        public virtual Type ObjectType { get; } = null;

        public virtual HarshProvisionerRecordType RecordType { get; }
            = HarshProvisionerRecordType.Other;

        public DateTimeOffset Timestamp { get; internal set; }

        public override String ToString()
            => Invariant($"{RecordType} {Identifier}");
    }
}