text:
#include <linux/kernel.h>
#include <linux/of_platform.h>

#include "wsp.h"

/*
 * Find chip-id by walking up device tree looking for ibm,wsp-chip-id property.
 * Won't work for nodes that are not a descendant of a wsp node.
 */
int wsp_get_chip_id(struct device_node *dn)
{
	const u32 *p;
	int rc;

	/* Start looking at the specified node, not its parent */
	dn = of_node_get(dn);
	while (dn && !(p = of_get_property(dn, "ibm,wsp-chip-id", NULL)))
		dn = of_get_next_parent(dn);

	if (!dn)
		return -1;

	rc = *p;
	of_node_put(dn);

	return rc;
}


text:
inline constexpr bool IsWhitespace(wchar_t ch) {
  return ch == L' ' || ch == L'\t' || ch == L'\r' || ch == L'\n';
}

inline constexpr bool IsRequireEscape(wchar_t ch) {
  return ch == L' ' || ch == L'\t' || ch == L'\r' || ch == L'\n' ||
         ch == L'\v' || ch == L'\"';
}

inline constexpr size_t StringLength(const wchar_t *s) {
  const wchar_t *a = s;
  for (; *a != 0; a++) {
    ;
  }
  return a - s;
}

inline constexpr bool StringEqual(const wchar_t *a, const wchar_t *b,
                                  size_t n) {
  for (size_t i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      return false;
    }
  }
  return true;
}

inline wchar_t *StringAllocate(size_t count) {
  return reinterpret_cast<wchar_t *>(
      HeapAlloc(GetProcessHeap(), 0, sizeof(wchar_t) * count));
}

inline void StringFree(wchar_t *p) {
  //
  HeapFree(GetProcessHeap(), 0, p);
}

inline void StringZero(wchar_t *p, size_t len) {
  for (size_t i = 0; i < len; i++) {
    p[i] = 0;
  }
}

inline void *StringCopy(wchar_t *dest, const wchar_t *src, size_t n) {
  auto d = dest;
  for (; n; n--) {
    *d++ = *src++;
  }
  return dest;
}

class StringView {
public:
  typedef wchar_t *pointer;
  typedef const wchar_t *const_pointer;
  typedef wchar_t &reference;
  typedef const wchar_t &const_reference;
  typedef const wchar_t *const_iterator;
  typedef size_t size_type;
  static constexpr size_type npos = size_type(-1);
  StringView() noexcept : data_(nullptr), size_(0) {}
  constexpr StringView(const wchar_t *str) noexcept
      : data_(str), size_(str == nullptr ? 0 : StringLength(str)) {}
  constexpr StringView(const wchar_t *str, size_type len) noexcept
      : data_(str), size_(len) {}
  constexpr const_iterator begin() const noexcept { return data_; }
  constexpr auto end() const noexcept { return data_ + size_; }
  constexpr auto size() const noexcept { return size_; }
  constexpr auto length() const noexcept { return size_; }
  [[nodiscard]] constexpr bool empty() const noexcept { return size_ == 0; }
  constexpr const_reference operator[](size_type i) const { return data_[i]; }
  constexpr const_pointer data() const noexcept { return data_; }

  constexpr StringView substr(size_type pos = 0, size_type n = npos) const {
    if (pos > size_) {
      pos = size_;
    }
    if (n > size_ - pos) {
      n = size_ - pos;
    }
    return StringView(data_ + pos, n);
  }

  constexpr const_reference front() const { return data_[0]; }
  constexpr const_reference back() const { return data_[size_ - 1]; }

  void remove_prefix(size_type n) {
    data_ += n;
    size_ -= n;
  }
  void remove_suffix(size_type n) { size_ -= n; }

  constexpr bool starts_with(const StringView &x) const noexcept {
    return x.empty() ||
           (size() >= x.size() && StringEqual(data(), x.data(), x.size()));
  }

  // Does "this" end with "x"?
  constexpr bool ends_with(const StringView &x) const noexcept {
    return x.empty() ||
           (size() >= x.size() &&
            StringEqual(data() + (size() - x.size()), x.data(), x.size()));
  }
  constexpr size_type find(wchar_t c, size_t pos) const noexcept {
    if (size_ == 0 || pos >= size_) {
      return npos;
    }
    for (size_t index = pos; index < size_; index++) {
      if (c == data_[index]) {
        return index;
      }
    }
    return npos;
  }

private:
  const_pointer data_;
  size_type size_;
};

inline constexpr bool operator==(const StringView &x, const StringView &y) {
  StringView::size_type len = x.size();
  if (len != y.size()) {
    return false;
  }
  return x.data() == y.data() || len == 0 ||
         StringEqual(x.data(), y.data(), len);
}

inline constexpr bool operator!=(const StringView &x, const StringView &y) {
  return !(x == y);
}

inline constexpr bool IsEscapeArg0(StringView str) {
  for (auto c : str) {
    if (IsRequireEscape(c)) {
      return true;
    }
  }
  return false;
}

inline constexpr StringView StripTrailingWhitespace(StringView str) {
  for (size_t i = 0; i < str.size(); i++) {
    if (!IsWhitespace(str[i])) {
      return str.substr(i, str.size() - i);
    }
  }
  return StringView();
}

inline constexpr StringView StripArg0(StringView cmdline) {
  cmdline = StripTrailingWhitespace(cmdline);
  if (cmdline.empty()) {
    return StringView();
  }
  if (cmdline.front() != L'"') {
    auto pos = cmdline.find(L' ', 0);
    if (pos == StringView::npos) {
      return StringView();
    }
    return cmdline.substr(pos + 1);
  }
  return StringView();
}

inline bool EscapeArgv(StringView cmdline, StringView target, wchar_t **saver) {
  if (saver == nullptr) {
    return false;
  }
  auto args = StripArg0(cmdline);
  size_t n = args.size() + target.size() + 4; // "" args
  auto p = StringAllocate(n);
  if (p == nullptr) {
    return false;
  }
  StringZero(p, n);
  auto it = p;
  if (IsEscapeArg0(target)) {
    *p++ = L'"';
    StringCopy(p, target.data(), target.size());
    p += target.size();
    *p++ = L'"';
  } else {
    StringCopy(p, target.data(), target.size());
    p += target.size();
  }
  if (!args.empty()) {
    *p++ = L' ';
    StringCopy(p, args.data(), args.size());
  }
  *saver = p;
  return true;
}

#endif

redpajama_set_name: RedPajamaGithub


text:
package hydrograph.engine.jaxb.straightpulltypes;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import hydrograph.engine.jaxb.sort.TypePrimaryKeyFields;
import hydrograph.engine.jaxb.sort.TypeSecondaryKeyFields;
import hydrograph.engine.jaxb.sort.TypeSortBase;

/**
 *
Java class for sort complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="sort">
 *   <complexContent>
 *     <extension base="{hydrograph/engine/jaxb/sort}type-sort-base">
 *       <sequence>
 *         <element name="primaryKeys" type="{hydrograph/engine/jaxb/sort}type-primary-key-fields"/>
 *         <element name="secondaryKeys" type="{hydrograph/engine/jaxb/sort}type-secondary-key-fields" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sort", namespace = "hydrograph/engine/jaxb/straightpulltypes", propOrder = {
    "primaryKeys",
    "secondaryKeys"
})
public class Sort
    extends TypeSortBase
{

    @XmlElement(required = true)
    protected TypePrimaryKeyFields primaryKeys;
    protected TypeSecondaryKeyFields secondaryKeys;

    /**
     * Gets the value of the primaryKeys property.
     *
     * @return
     *     possible object is
     *     {@link TypePrimaryKeyFields }
     *
     */
    public TypePrimaryKeyFields getPrimaryKeys() {
        return primaryKeys;
    }

    /**
     * Sets the value of the primaryKeys property.
     *
     * @param value
     *     allowed object is
     *     {@link TypePrimaryKeyFields }
     *
     */
    public void setPrimaryKeys(TypePrimaryKeyFields value) {
        this.primaryKeys = value;
    }

    /**
     * Gets the value of the secondaryKeys property.
     *
     * @return
     *     possible object is
     *     {@link TypeSecondaryKeyFields }
     *
     */
    public TypeSecondaryKeyFields getSecondaryKeys() {
        return secondaryKeys;
    }

    /**
     * Sets the value of the secondaryKeys property.
     *
     * @param value
     *     allowed object is
     *     {@link TypeSecondaryKeyFields }
     *
     */
    public void setSecondaryKeys(TypeSecondaryKeyFields value) {
        this.secondaryKeys = value;
    }

}


text:
import sbt._
import Keys._

object Builds extends Build {
  lazy val buildSettings = Defaults.defaultSettings ++ Seq(
    version := "0.1-SNAPSHOT",
    organization := "com.example",
    scalaVersion := "2.10.1"
  )
  lazy val rootSettings = buildSettings ++ Seq(
    name := "fi.helsinki.cs"
    )
  lazy val librarySettings = buildSettings ++ Seq(
    name := "fi.helsinki.cs-library"
    )
  lazy val appSettings = buildSettings ++
    sbtassembly.Plugin.assemblySettings ++ Seq(
    name := "fi.helsinki.cs-app"
    )
  lazy val root = Project("root", file("."), settings = rootSettings) aggregate(app)
  lazy val library = Project("library", file("library"), settings = librarySettings)
  lazy val app = Project("app", file("app"), settings = appSettings) dependsOn(library)
}


text:
require 'hitnmiss/repository/cache_management'
require 'thread'

module Hitnmiss
  module BackgroundRefreshRepository
    class RefreshIntervalRequired < StandardError; end

    def self.included(mod)
      mod.include(OptionalLogger::LoggerManagement)
      mod.include(Repository::CacheManagement)
      mod.extend(ClassMethods)
      mod.include(InstanceMethods)
    end

    module ClassMethods
      def refresh_interval(interval_in_seconds=nil)
        if interval_in_seconds
          @refresh_interval = interval_in_seconds
        else
          @refresh_interval
        end
      end
    end

    module InstanceMethods
      def initialize
        if self.class.refresh_interval.nil?
          raise RefreshIntervalRequired, 'the refresh_interval must be set'
        end
      end

      def stale?(*args)
        true
      end

      def refresh(*args, swallow_exceptions: [])
        logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) called")
        if swallow_exceptions.empty?
          logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
          if stale?(*args)
            logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
            prime(*args)
          end
        else
          begin
            logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) about to check stale?")
            if stale?(*args)
              logger.debug("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) is stale, about to prime")
              prime(*args)
            end
          rescue *swallow_exceptions => e
            logger.error("hitnmiss: refresh(#{args.inspect}, swallow_exceptions: #{swallow_exceptions.inspect}) swallowed exception: #{e.inspect}")
            logger.error(e.backtrace.join("\n"))
          end
        end
      end

      def background_refresh(*args, swallow_exceptions: [])
        logger.debug("hitnmiss: background_refresh(#{args.inspect}) called")
        @refresh_thread = Thread.new(self, args) do |repository, args|
          while(true) do
            repository.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to call refresh()")
            refresh(*args, swallow_exceptions: swallow_exceptions)
            repository.logger.debug("hitnmiss: background_refresh(#{args.inspect}): about to sleep for #{repository.class.refresh_interval}")
            sleep repository.class.refresh_interval
          end
        end
        @refresh_thread.abort_on_exception = true
        logger.debug("hitnmiss: background_refresh(#{args.inspect}) enabled abort on exception")
      end

      private

      def strip_expiration(unstripped_entity)
        if unstripped_entity.expiration
          return Hitnmiss::Entity.new(unstripped_entity.value,
                                      fingerprint: unstripped_entity.fingerprint,
                                      last_modified: unstripped_entity.last_modified)
        else
          return unstripped_entity
        end
      end

      def cache_entity(args, cacheable_entity)
        entity = strip_expiration(cacheable_entity)
        super(args, entity)
      end
    end
  end
end


text:
#ifndef RenderLayerCompositor_h
#define RenderLayerCompositor_h

#if USE(ACCELERATED_COMPOSITING)

#include "ChromeClient.h"
#include "Frame.h"
#include "GraphicsLayerClient.h"
#include "GraphicsLayerUpdater.h"
#include "RenderLayer.h"
#include <wtf/HashMap.h>

namespace WebCore {

class FixedPositionViewportConstraints;
class GraphicsLayer;
class GraphicsLayerUpdater;
class RenderEmbeddedObject;
class RenderPart;
class ScrollingCoordinator;
class StickyPositionViewportConstraints;
#if ENABLE(VIDEO)
class RenderVideo;
#endif
class TiledBacking;

enum CompositingUpdateType {
    CompositingUpdateAfterStyleChange,
    CompositingUpdateAfterLayout,
    CompositingUpdateOnHitTest,
    CompositingUpdateOnScroll,
    CompositingUpdateOnCompositedScroll
};

enum {
    CompositingReasonNone                                   = 0,
    CompositingReason3DTransform                            = 1 << 0,
    CompositingReasonVideo                                  = 1 << 1,
    CompositingReasonCanvas                                 = 1 << 2,
    CompositingReasonPlugin                                 = 1 << 3,
    CompositingReasonIFrame                                 = 1 << 4,
    CompositingReasonBackfaceVisibilityHidden               = 1 << 5,
    CompositingReasonClipsCompositingDescendants            = 1 << 6,
    CompositingReasonAnimation                              = 1 << 7,
    CompositingReasonFilters                                = 1 << 8,
    CompositingReasonPositionFixed                          = 1 << 9,
    CompositingReasonPositionSticky                         = 1 << 10,
    CompositingReasonOverflowScrollingTouch                 = 1 << 11,
    CompositingReasonStacking                               = 1 << 12,
    CompositingReasonOverlap                                = 1 << 13,
    CompositingReasonNegativeZIndexChildren                 = 1 << 14,
    CompositingReasonTransformWithCompositedDescendants     = 1 << 15,
    CompositingReasonOpacityWithCompositedDescendants       = 1 << 16,
    CompositingReasonMaskWithCompositedDescendants          = 1 << 17,
    CompositingReasonReflectionWithCompositedDescendants    = 1 << 18,
    CompositingReasonFilterWithCompositedDescendants        = 1 << 19,
    CompositingReasonBlendingWithCompositedDescendants      = 1 << 20,
    CompositingReasonPerspective                            = 1 << 21,
    CompositingReasonPreserve3D                             = 1 << 22,
    CompositingReasonRoot                                   = 1 << 23
};
typedef unsigned CompositingReasons;

// RenderLayerCompositor manages the hierarchy of
// composited RenderLayers. It determines which RenderLayers
// become compositing, and creates and maintains a hierarchy of
// GraphicsLayers based on the RenderLayer painting order.
//
// There is one RenderLayerCompositor per RenderView.

class RenderLayerCompositor : public GraphicsLayerClient, public GraphicsLayerUpdaterClient {
    WTF_MAKE_FAST_ALLOCATED;
public:
    explicit RenderLayerCompositor(RenderView*);
    ~RenderLayerCompositor();

    // Return true if this RenderView is in "compositing mode" (i.e. has one or more
    // composited RenderLayers)
    bool inCompositingMode() const { return m_compositing; }
    // This will make a compositing layer at the root automatically, and hook up to
    // the native view/window system.
    void enableCompositingMode(bool enable = true);

    bool inForcedCompositingMode() const { return m_forceCompositingMode; }

    // Returns true if the accelerated compositing is enabled
    bool hasAcceleratedCompositing() const { return m_hasAcceleratedCompositing; }

    bool canRender3DTransforms() const;

    // Copy the accelerated compositing related flags from Settings
    void cacheAcceleratedCompositingFlags();

    // Called when the layer hierarchy needs to be updated (compositing layers have been
    // created, destroyed or re-parented).
    void setCompositingLayersNeedRebuild(bool needRebuild = true);
    bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRebuild; }

    // GraphicsLayers buffer state, which gets pushed to the underlying platform layers
    // at specific times.
    void scheduleLayerFlush(bool canThrottle);
    void flushPendingLayerChanges(bool isFlushRoot = true);

    // flushPendingLayerChanges() flushes the entire GraphicsLayer tree, which can cross frame boundaries.
    // This call returns the rootmost compositor that is being flushed (including self).
    RenderLayerCompositor* enclosingCompositorFlushingLayers() const;

    // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges().
    void didFlushChangesForLayer(RenderLayer*, const GraphicsLayer*);

    // Called when something outside WebKit affects the visible rect (e.g. delegated scrolling). Might schedule a layer flush.
    void didChangeVisibleRect();

    // Rebuild the tree of compositing layers
    void updateCompositingLayers(CompositingUpdateType, RenderLayer* updateRoot = 0);
    // This is only used when state changes and we do not exepect a style update or layout to happen soon (e.g. when
    // we discover that an iframe is overlapped during painting).
    void scheduleCompositingLayerUpdate();

    // Update the compositing state of the given layer. Returns true if that state changed.
    enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChangeWillRepaintLater };
    bool updateLayerCompositingState(RenderLayer*, CompositingChangeRepaint = CompositingChangeRepaintNow);

    // Update the geometry for compositing children of compositingAncestor.
    void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, RenderLayer*, bool compositedChildrenOnly);

    // Whether layer's backing needs a graphics layer to do clipping by an ancestor (non-stacking-context parent with overflow).
    bool clippedByAncestor(RenderLayer*) const;
    // Whether layer's backing needs a graphics layer to clip z-order children of the given layer.
    bool clipsCompositingDescendants(const RenderLayer*) const;

    // Whether the given layer needs an extra 'contents' layer.
    bool needsContentsCompositingLayer(const RenderLayer*) const;

    bool supportsFixedRootBackgroundCompositing() const;
    bool needsFixedRootBackgroundLayer(const RenderLayer*) const;
    GraphicsLayer* fixedRootBackgroundLayer() const;

    // Return the bounding box required for compositing layer and its childern, relative to ancestorLayer.
    // If layerBoundingBox is not 0, on return it contains the bounding box of this layer only.
    LayoutRect calculateCompositedBounds(const RenderLayer*, const RenderLayer* ancestorLayer) const;

    // Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
    void repaintOnCompositingChange(RenderLayer*);

    void repaintInCompositedAncestor(RenderLayer*, const LayoutRect&);

    // Notify us that a layer has been added or removed
    void layerWasAdded(RenderLayer* parent, RenderLayer* child);
    void layerWillBeRemoved(RenderLayer* parent, RenderLayer* child);

    // Get the nearest ancestor layer that has overflow or clip, but is not a stacking context
    RenderLayer* enclosingNonStackingClippingLayer(const RenderLayer* layer) const;

    // Repaint parts of all composited layers that intersect the given absolute rectangle (or the entire layer if the pointer is null).
    void repaintCompositedLayers(const IntRect* = 0);

    // Returns true if the given layer needs it own backing store.
    bool requiresOwnBackingStore(const RenderLayer*, const RenderLayer* compositingAncestorLayer, const IntRect& layerCompositedBoundsInAncestor, const IntRect& ancestorCompositedBounds) const;

    RenderLayer* rootRenderLayer() const;
    GraphicsLayer* rootGraphicsLayer() const;
    GraphicsLayer* scrollLayer() const;

#if ENABLE(RUBBER_BANDING)
    GraphicsLayer* headerLayer() const;
    GraphicsLayer* footerLayer() const;
#endif

    enum RootLayerAttachment {
        RootLayerUnattached,
        RootLayerAttachedViaChromeClient,
        RootLayerAttachedViaEnclosingFrame
    };

    RootLayerAttachment rootLayerAttachment() const { return m_rootLayerAttachment; }
    void updateRootLayerAttachment();
    void updateRootLayerPosition();

    void setIsInWindow(bool);

    void clearBackingForAllLayers();

    void layerBecameComposited(const RenderLayer*) { ++m_compositedLayerCount; }
    void layerBecameNonComposited(const RenderLayer*);

#if ENABLE(VIDEO)
    // Use by RenderVideo to ask if it should try to use accelerated compositing.
    bool canAccelerateVideoRendering(RenderVideo*) const;
#endif

    // Walk the tree looking for layers with 3d transforms. Useful in case you need
    // to know if there is non-affine content, e.g. for drawing into an image.
    bool has3DContent() const;

    // Most platforms connect compositing layer trees between iframes and their parent document.
    // Some (currently just Mac) allow iframes to do their own compositing.
    static bool allowsIndependentlyCompositedFrames(const FrameView*);
    bool shouldPropagateCompositingToEnclosingFrame() const;

    static RenderLayerCompositor* frameContentsCompositor(RenderPart*);
    // Return true if the layers changed.
    static bool parentFrameContentLayers(RenderPart*);

    // Update the geometry of the layers used for clipping and scrolling in frames.
    void frameViewDidChangeLocation(const IntPoint& contentsOffset);
    void frameViewDidChangeSize();
    void frameViewDidScroll();
    void frameViewDidLayout();
    void rootFixedBackgroundsChanged();

    void scrollingLayerDidChange(RenderLayer*);
    void fixedRootBackgroundLayerChanged();

    String layerTreeAsText(LayerTreeFlags);

    virtual float deviceScaleFactor() const OVERRIDE;
    virtual float pageScaleFactor() const OVERRIDE;
    virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE;
    virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) OVERRIDE;

    void layerTiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/);

    bool keepLayersPixelAligned() const;
    bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; }

    void deviceOrPageScaleFactorChanged();

    void windowScreenDidChange(PlatformDisplayID);

    GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
    GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
    GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
#if ENABLE(RUBBER_BANDING)
    GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }

    GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer);
    GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer);
    GraphicsLayer* updateLayerForHeader(bool wantsLayer);
    GraphicsLayer* updateLayerForFooter(bool wantsLayer);
#endif

    void updateViewportConstraintStatus(RenderLayer*);
    void removeViewportConstrainedLayer(RenderLayer*);

    void resetTrackedRepaintRects();
    void setTracksRepaints(bool);

    void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAfterLayout = true; }

    bool viewHasTransparentBackground(Color* backgroundColor = 0) const;

    bool hasNonMainLayersWithTiledBacking() const { return m_layersWithTiledBackingCount; }

    CompositingReasons reasonsForCompositing(const RenderLayer*) const;

    void setLayerFlushThrottlingEnabled(bool);
    void disableLayerFlushThrottlingTemporarilyForInteraction();

    void didPaintBacking(RenderLayerBacking*);

private:
    class OverlapMap;

    // GraphicsLayerClient implementation
    virtual void notifyAnimationStarted(const GraphicsLayer*, double) OVERRIDE { }
    virtual void notifyFlushRequired(const GraphicsLayer*) OVERRIDE;
    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&) OVERRIDE;

    virtual bool isTrackingRepaints() const OVERRIDE;

    // GraphicsLayerUpdaterClient implementation
    virtual void flushLayers(GraphicsLayerUpdater*) OVERRIDE;
    virtual void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const OVERRIDE;

    // Whether the given RL needs a compositing layer.
    bool needsToBeComposited(const RenderLayer*, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
    // Whether the layer has an intrinsic need for compositing layer.
    bool requiresCompositingLayer(const RenderLayer*, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
    // Whether the layer could ever be composited.
    bool canBeComposited(const RenderLayer*) const;

    // Make or destroy the backing for this layer; returns true if backing changed.
    bool updateBacking(RenderLayer*, CompositingChangeRepaint shouldRepaint);

    void clearBackingForLayerIncludingDescendants(RenderLayer*);

    // Repaint the given rect (which is layer's coords), and regions of child layers that intersect that rect.
    void recursiveRepaintLayer(RenderLayer*, const IntRect* = 0);

    void addToOverlapMap(OverlapMap&, RenderLayer*, IntRect& layerBounds, bool& boundsComputed);
    void addToOverlapMapRecursive(OverlapMap&, RenderLayer*, RenderLayer* ancestorLayer = 0);

    void updateCompositingLayersTimerFired(Timer<RenderLayerCompositor>*);

    // Returns true if any layer's compositing changed
    void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*, OverlapMap*, struct CompositingState&, bool& layersChanged, bool& descendantHas3DTransform);

    // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
    void rebuildCompositingLayerTree(RenderLayer*, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth);

    // Recurses down the tree, updating layer geometry only.
    void updateLayerTreeGeometry(RenderLayer*, int depth);

    // Hook compositing layers together
    void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer);
    void removeCompositedChildren(RenderLayer*);

    bool layerHas3DContent(const RenderLayer*) const;
    bool isRunningAcceleratedTransformAnimation(RenderObject*) const;

    bool hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const;

    void ensureRootLayer();
    void destroyRootLayer();

    void attachRootLayer(RootLayerAttachment);
    void detachRootLayer();

    void rootLayerAttachmentChanged();

    void updateOverflowControlsLayers();

    void notifyIFramesOfCompositingChange();

    bool isFlushingLayers() const { return m_flushingLayers; }

    Page* page() const;
    TiledBacking* pageTiledBacking() const;

    GraphicsLayerFactory* graphicsLayerFactory() const;
    ScrollingCoordinator* scrollingCoordinator() const;

    // Whether a running transition or animation enforces the need for a compositing layer.
    bool requiresCompositingForAnimation(RenderObject*) const;
    bool requiresCompositingForTransform(RenderObject*) const;
    bool requiresCompositingForVideo(RenderObject*) const;
    bool requiresCompositingForCanvas(RenderObject*) const;
    bool requiresCompositingForPlugin(RenderObject*) const;
    bool requiresCompositingForFrame(RenderObject*) const;
    bool requiresCompositingForFilters(RenderObject*) const;
    bool requiresCompositingForBlending(RenderObject* renderer) const;
    bool requiresCompositingForScrollableFrame() const;
    bool requiresCompositingForPosition(RenderObject*, const RenderLayer*, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
    bool requiresCompositingForOverflowScrolling(const RenderLayer*) const;
    bool requiresCompositingForIndirectReason(RenderObject*, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason&) const;

    void addViewportConstrainedLayer(RenderLayer*);
    void registerOrUpdateViewportConstrainedLayer(RenderLayer*);
    void unregisterViewportConstrainedLayer(RenderLayer*);

    FixedPositionViewportConstraints computeFixedViewportConstraints(RenderLayer*) const;
    StickyPositionViewportConstraints computeStickyViewportConstraints(RenderLayer*) const;

    bool requiresScrollLayer(RootLayerAttachment) const;
    bool requiresHorizontalScrollbarLayer() const;
    bool requiresVerticalScrollbarLayer() const;
    bool requiresScrollCornerLayer() const;
#if ENABLE(RUBBER_BANDING)
    bool requiresOverhangAreasLayer() const;
    bool requiresContentShadowLayer() const;
#endif

    bool hasCoordinatedScrolling() const;
    bool shouldCompositeOverflowControls() const;

    void scheduleLayerFlushNow();
    bool isThrottlingLayerFlushes() const;
    void startLayerFlushTimerIfNeeded();
    void layerFlushTimerFired(Timer<RenderLayerCompositor>*);

    void paintRelatedMilestonesTimerFired(Timer<RenderLayerCompositor>*);

#if !LOG_DISABLED
    const char* logReasonsForCompositing(const RenderLayer*);
    void logLayerInfo(const RenderLayer*, int depth);
#endif

private:
    RenderView* m_renderView;
    OwnPtr<GraphicsLayer> m_rootContentLayer;
    Timer<RenderLayerCompositor> m_updateCompositingLayersTimer;

    bool m_hasAcceleratedCompositing;
    ChromeClient::CompositingTriggerFlags m_compositingTriggers;

    int m_compositedLayerCount;
    bool m_showDebugBorders;
    bool m_showRepaintCounter;
    bool m_acceleratedDrawingEnabled;

    // When true, we have to wait until layout has happened before we can decide whether to enter compositing mode,
    // because only then do we know the final size of plugins and iframes.
    mutable bool m_reevaluateCompositingAfterLayout;

    bool m_compositing;
    bool m_compositingLayersNeedRebuild;
    bool m_flushingLayers;
    bool m_shouldFlushOnReattach;
    bool m_forceCompositingMode;
    bool m_inPostLayoutUpdate; // true when it's OK to trust layout information (e.g. layer sizes and positions)

    bool m_isTrackingRepaints; // Used for testing.

    unsigned m_layersWithTiledBackingCount;

    RootLayerAttachment m_rootLayerAttachment;

    // Enclosing clipping layer for iframe content
    OwnPtr<GraphicsLayer> m_clipLayer;
    OwnPtr<GraphicsLayer> m_scrollLayer;

    HashSet<RenderLayer*> m_viewportConstrainedLayers;
    HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate;

    // Enclosing layer for overflow controls and the clipping layer
    OwnPtr<GraphicsLayer> m_overflowControlsHostLayer;

    // Layers for overflow controls
    OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
    OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
    OwnPtr<GraphicsLayer> m_layerForScrollCorner;
#if ENABLE(RUBBER_BANDING)
    OwnPtr<GraphicsLayer> m_layerForOverhangAreas;
    OwnPtr<GraphicsLayer> m_contentShadowLayer;
    OwnPtr<GraphicsLayer> m_layerForTopOverhangArea;
    OwnPtr<GraphicsLayer> m_layerForBottomOverhangArea;
    OwnPtr<GraphicsLayer> m_layerForHeader;
    OwnPtr<GraphicsLayer> m_layerForFooter;
#endif

    OwnPtr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running.

    Timer<RenderLayerCompositor> m_layerFlushTimer;
    bool m_layerFlushThrottlingEnabled;
    bool m_layerFlushThrottlingTemporarilyDisabledForInteraction;
    bool m_hasPendingLayerFlush;

    Timer<RenderLayerCompositor> m_paintRelatedMilestonesTimer;

#if !LOG_DISABLED
    int m_rootLayerUpdateCount;
    int m_obligateCompositedLayerCount; // count of layer that have to be composited.
    int m_secondaryCompositedLayerCount; // count of layers that have to be composited because of stacking or overlap.
    double m_obligatoryBackingStoreBytes;
    double m_secondaryBackingStoreBytes;
#endif
};

} // namespace WebCore

#endif // USE(ACCELERATED_COMPOSITING)

#endif // RenderLayerCompositor_h


text:
@implementation SibleTransactionState

- (id) initWithTransaction:(SibleTransaction *)transaction AndHandler:(void (^)(SibleTransaction *, NSError *))handler {
    self = [super init];

    if (self) {
        self.transaction = transaction;
        self.handler = handler;
    }

    return self;
}

@end


text:
JNIEXPORT jlong JNICALL Java_info_shibafu528_yukari_exvoice_diva_ModelFactory_newInstanceNative(JNIEnv *env, jclass clazz, jlong jMRubyPointer, jstring jModelClassName, jobject valuesMap) {
    mrb_state *mrb = (mrb_state *) jMRubyPointer;
    const char *modelClassName = (*env)->GetStringUTFChars(env, jModelClassName, NULL);

    // valuesMap -> Ruby Hash
    mrb_value rValuesHash = convertJavaToMrbValue(env, mrb, valuesMap);

    // Hash Keys -> Symbol
    mrb_value rKeys = mrb_hash_keys(mrb, rValuesHash);
    for (int i = 0; i < RARRAY_LEN(rKeys); i++) {
        mrb_value rKey = mrb_ary_ref(mrb, rKeys, i);
        mrb_sym rKeySym = mrb_intern_str(mrb, rKey);

        mrb_value rValue = mrb_hash_get(mrb, rValuesHash, rKey);
        mrb_hash_delete_key(mrb, rValuesHash, rKey);
        mrb_hash_set(mrb, rValuesHash, mrb_symbol_value(rKeySym), rValue);
    }

    // Initialize Model
    mrb_value rModelInstance = mrb_obj_new(mrb, mrb_class_get(mrb, modelClassName), 1, &rValuesHash);

    // Keep from GC
    mrb_gc_register(mrb, rModelInstance);

    (*env)->ReleaseStringUTFChars(env, jModelClassName, modelClassName);

    return (jlong) mrb_ptr(rModelInstance);
}


text:
/**
 */
package CIM.IEC61970.Informative.InfWork;

import CIM.IEC61968.Common.Location;

import CIM.IEC61970.Core.IdentifiedObject;

import CIM.IEC61970.Informative.InfAssets.ToolInfo;
import CIM.IEC61970.Informative.InfAssets.VehicleInfo;
import CIM.IEC61970.Informative.InfAssets.WorkEquipmentInfo;

import CIM.IEC61970.Informative.InfERPSupport.ErpOrganisation;
import CIM.IEC61970.Informative.InfERPSupport.ErpPerson;

import CIM.IEC61970.Informative.InfLocations.Route;

import CIM.IEC61970.Informative.InfOperations.OutageStep;
import CIM.IEC61970.Informative.InfOperations.SwitchingSchedule;

import org.eclipse.emf.common.util.EList;

/**
 *
 * A representation of the model object 'Crew'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getWorkTasks Work Tasks}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getAssignments Assignments}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getShiftPatterns Shift Patterns}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getRoute Route}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getTools Tools}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getVehicles Vehicles}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getCategory Category}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getCrewMembers Crew Members}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getWorkEquipmentAssets Work Equipment Assets}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getLocations Locations}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getOrganisations Organisations}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getSwitchingSchedules Switching Schedules}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getCapabilities Capabilities}

 *
{@link CIM.IEC61970.Informative.InfWork.Crew#getOutageSteps Outage Steps}

 *

 *
 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew()
 * @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='A crew is a group of people (ErpPersons) with specific skills, tools, and vehicles.'"
 *        annotation="http://langdale.com.au/2005/UML Profile\040documentation='A crew is a group of people (ErpPersons) with specific skills, tools, and vehicles.'"
 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='A crew is a group of people (ErpPersons) with specific skills, tools, and vehicles.' Profile\040documentation='A crew is a group of people (ErpPersons) with specific skills, tools, and vehicles.'"
 * @generated
 */
public interface Crew extends IdentifiedObject {
	/**
	 * Returns the value of the 'Work Tasks' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfWork.WorkTask}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfWork.WorkTask#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Work Tasks' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Work Tasks' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_WorkTasks()
	 * @see CIM.IEC61970.Informative.InfWork.WorkTask#getCrews
	 * @model opposite="Crews"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All WorkTasks this Crew participates in.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All WorkTasks this Crew participates in.'"
	 * @generated
	 */
	EList<WorkTask> getWorkTasks();

	/**
	 * Returns the value of the 'Assignments' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfWork.Assignment}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfWork.Assignment#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Assignments' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Assignments' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Assignments()
	 * @see CIM.IEC61970.Informative.InfWork.Assignment#getCrews
	 * @model opposite="Crews"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All Assignments for this Crew.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All Assignments for this Crew.'"
	 * @generated
	 */
	EList<Assignment> getAssignments();

	/**
	 * Returns the value of the 'Shift Patterns' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfWork.ShiftPattern}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfWork.ShiftPattern#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Shift Patterns' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Shift Patterns' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_ShiftPatterns()
	 * @see CIM.IEC61970.Informative.InfWork.ShiftPattern#getCrews
	 * @model opposite="Crews"
	 * @generated
	 */
	EList<ShiftPattern> getShiftPatterns();

	/**
	 * Returns the value of the 'Route' reference.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfLocations.Route#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Route' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Route' reference.
	 * @see #setRoute(Route)
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Route()
	 * @see CIM.IEC61970.Informative.InfLocations.Route#getCrews
	 * @model opposite="Crews"
	 * @generated
	 */
	Route getRoute();

	/**
	 * Sets the value of the '{@link CIM.IEC61970.Informative.InfWork.Crew#getRoute Route}' reference.
	 *
	 *
	 * @param value the new value of the 'Route' reference.
	 * @see #getRoute()
	 * @generated
	 */
	void setRoute(Route value);

	/**
	 * Returns the value of the 'Tools' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfAssets.ToolInfo}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfAssets.ToolInfo#getCrew Crew}'.
	 *
	 *

	 * If the meaning of the 'Tools' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Tools' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Tools()
	 * @see CIM.IEC61970.Informative.InfAssets.ToolInfo#getCrew
	 * @model opposite="Crew"
	 * @generated
	 */
	EList<ToolInfo> getTools();

	/**
	 * Returns the value of the 'Vehicles' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfAssets.VehicleInfo}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfAssets.VehicleInfo#getCrew Crew}'.
	 *
	 *

	 * If the meaning of the 'Vehicles' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Vehicles' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Vehicles()
	 * @see CIM.IEC61970.Informative.InfAssets.VehicleInfo#getCrew
	 * @model opposite="Crew"
	 * @generated
	 */
	EList<VehicleInfo> getVehicles();

	/**
	 * Returns the value of the 'Category' attribute.
	 *
	 *

	 * If the meaning of the 'Category' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Category' attribute.
	 * @see #setCategory(String)
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Category()
	 * @model required="true"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Category by utility\'s work management standards and practices.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Category by utility\'s work management standards and practices.'"
	 * @generated
	 */
	String getCategory();

	/**
	 * Sets the value of the '{@link CIM.IEC61970.Informative.InfWork.Crew#getCategory Category}' attribute.
	 *
	 *
	 * @param value the new value of the 'Category' attribute.
	 * @see #getCategory()
	 * @generated
	 */
	void setCategory(String value);

	/**
	 * Returns the value of the 'Crew Members' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfERPSupport.ErpPerson}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfERPSupport.ErpPerson#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Crew Members' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Crew Members' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_CrewMembers()
	 * @see CIM.IEC61970.Informative.InfERPSupport.ErpPerson#getCrews
	 * @model opposite="Crews"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All ErpPersons that are members of this Crew.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All ErpPersons that are members of this Crew.'"
	 * @generated
	 */
	EList<ErpPerson> getCrewMembers();

	/**
	 * Returns the value of the 'Work Equipment Assets' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfAssets.WorkEquipmentInfo}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfAssets.WorkEquipmentInfo#getCrew Crew}'.
	 *
	 *

	 * If the meaning of the 'Work Equipment Assets' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Work Equipment Assets' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_WorkEquipmentAssets()
	 * @see CIM.IEC61970.Informative.InfAssets.WorkEquipmentInfo#getCrew
	 * @model opposite="Crew"
	 * @generated
	 */
	EList<WorkEquipmentInfo> getWorkEquipmentAssets();

	/**
	 * Returns the value of the 'Locations' reference list.
	 * The list contents are of type {@link CIM.IEC61968.Common.Location}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61968.Common.Location#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Locations' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Locations' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Locations()
	 * @see CIM.IEC61968.Common.Location#getCrews
	 * @model opposite="Crews"
	 * @generated
	 */
	EList<Location> getLocations();

	/**
	 * Returns the value of the 'Organisations' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfERPSupport.ErpOrganisation}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfERPSupport.ErpOrganisation#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Organisations' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Organisations' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Organisations()
	 * @see CIM.IEC61970.Informative.InfERPSupport.ErpOrganisation#getCrews
	 * @model opposite="Crews"
	 * @generated
	 */
	EList<ErpOrganisation> getOrganisations();

	/**
	 * Returns the value of the 'Switching Schedules' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfOperations.SwitchingSchedule}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfOperations.SwitchingSchedule#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Switching Schedules' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Switching Schedules' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_SwitchingSchedules()
	 * @see CIM.IEC61970.Informative.InfOperations.SwitchingSchedule#getCrews
	 * @model opposite="Crews"
	 *        annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='All SwitchingSchedules executed by this Crew.'"
	 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='All SwitchingSchedules executed by this Crew.'"
	 * @generated
	 */
	EList<SwitchingSchedule> getSwitchingSchedules();

	/**
	 * Returns the value of the 'Capabilities' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfWork.Capability}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfWork.Capability#getCrew Crew}'.
	 *
	 *

	 * If the meaning of the 'Capabilities' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Capabilities' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_Capabilities()
	 * @see CIM.IEC61970.Informative.InfWork.Capability#getCrew
	 * @model opposite="Crew"
	 * @generated
	 */
	EList<Capability> getCapabilities();

	/**
	 * Returns the value of the 'Outage Steps' reference list.
	 * The list contents are of type {@link CIM.IEC61970.Informative.InfOperations.OutageStep}.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfOperations.OutageStep#getCrews Crews}'.
	 *
	 *

	 * If the meaning of the 'Outage Steps' reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Outage Steps' reference list.
	 * @see CIM.IEC61970.Informative.InfWork.InfWorkPackage#getCrew_OutageSteps()
	 * @see CIM.IEC61970.Informative.InfOperations.OutageStep#getCrews
	 * @model opposite="Crews"
	 * @generated
	 */
	EList<OutageStep> getOutageSteps();

} // Crew


text:
class CreateEventLocations < ActiveRecord::Migration
  def self.up
    create_table :event_locations do |t|
      t.column :event_id, :integer
      t.column :location_id, :integer
      t.column :exclusive, :boolean, :default => true
    end
  end

  def self.down
    drop_table :event_locations
  end
end


text:
namespace AE
{

DescriptorSetHandle::DescriptorSetHandle( Engine * engine, DescriptorPoolManager * descriptor_pool, DescriptorSubPoolInfo * descriptor_pool_info, VkDescriptorSet descriptor_set )
{
	p_engine				= engine;
	pool					= descriptor_pool;
	pool_info				= descriptor_pool_info;
	set						= descriptor_set;
	assert( p_engine );
	assert( pool );
	assert( pool_info );
	assert( set );
}

DescriptorSetHandle::DescriptorSetHandle()
{
}

DescriptorSetHandle::DescriptorSetHandle( nullptr_t )
{
}

DescriptorSetHandle::DescriptorSetHandle( DescriptorSetHandle && other )
{
	Swap( std::forward<DescriptorSetHandle>( other ) );
}

DescriptorSetHandle::~DescriptorSetHandle()
{
	if( set ) {
		pool->FreeDescriptorSet( pool_info, set );
		pool_info			= nullptr;
	}
}

DescriptorSetHandle & DescriptorSetHandle::operator=( DescriptorSetHandle && other )
{
	Swap( std::forward<DescriptorSetHandle>( other ) );
	return *this;
}

DescriptorSetHandle::operator bool()
{
	return set;
}

DescriptorSetHandle::operator VkDescriptorSet()
{
	return set;
}

void DescriptorSetHandle::Swap( DescriptorSetHandle && other )
{
	std::swap( p_engine, other.p_engine );
	std::swap( pool, other.pool );
	std::swap( pool_info, other.pool_info );
	std::swap( set, other.set );
}

}


text:
cask "vscodium" do
  arch = Hardware::CPU.intel? ? "x64" : "arm64"

  version "1.67.1"

  if Hardware::CPU.intel?
    sha256 "535cdd4ac90f8fef8692cb080950ab8d50943cf252ba32e9234f497af24d841b"
  else
    sha256 "4b8f05054ee332b290861d461db82ea12004d01d7a5c7c80409bd0cf14f5befe"
  end

  url "https://github.com/VSCodium/vscodium/releases/download/#{version}/VSCodium.#{arch}.#{version}.dmg"
  name "VSCodium"
  desc "Binary releases of VS Code without MS branding/telemetry/licensing"
  homepage "https://github.com/VSCodium/vscodium"

  auto_updates true

  app "VSCodium.app"
  binary "#{appdir}/VSCodium.app/Contents/Resources/app/bin/codium"

  zap trash: [
    "~/.vscode-oss",
    "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.visualstudio.code.oss.sfl*",
    "~/Library/Application Support/VSCodium",
    "~/Library/Logs/VSCodium",
    "~/Library/Preferences/com.visualstudio.code.oss.helper.plist",
    "~/Library/Preferences/com.visualstudio.code.oss.plist",
    "~/Library/Saved Application State/com.visualstudio.code.oss.savedState",
  ]
end


text:
Kondico.not = Formi.map(function(val) {
  return !val;
});


text:
build:
	docker run --rm --user $(shell id -u):$(shell id -g) --volume /etc/passwd:/etc/passwd:ro --volume /etc/group:/etc/group:ro --volume $(shell pwd):/app composer install
	docker-compose build

lint:
	docker-compose run -w "/var/www/html/" php phpcs

clearlog:
	echo "" > storage/logs/lumen.log

test: clearlog
	docker-compose run -w "/var/www/html/" php phpunit --coverage-html coverage --coverage-clover clover.xml --coverage-text

neo4j:
	docker-compose up neo4j


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.alfresco.integrations</groupId>
   <artifactId>alfresco-common-jivetoolkit</artifactId>
   <version>1.1.0</version>
   <name>alfresco-common-jivetoolkit</name>
   <packaging>pom</packaging>

   <modules>
      <module>encryption</module>
      <module>jiveopenclient</module>
      <module>opencmisauth</module>
   </modules>

</project>


text:
sudo apt-get update

# Install library
#pip3 install --upgrade cython
#sudo apt-get -y install libopenblas-dev
#sudo apt-get -y install liblapacke-dev
#sudo apt-get -y install gfortran
#sudo apt-get -y install llvm-7*
#echo 'export PATH="/usr/lib/llvm-7/bin:$PATH"' >> ~/.bashrc
#source ~/.bashrc
sudo apt-get -y install python3-scipy
#sudo apt-get -y install python3-matplotlib

pip3 install tqdm
pip3 install slidingwindow
pip3 install pycocotools

# Setup tf-pose-estimation
cd && git clone --depth 1 https://github.com/ildoonet/tf-pose-estimation.git
cd ~/tf-pose-estimation
git remote add karaage0703 https://github.com/karaage0703/tf-pose-estimation
git fetch karaage0703
git checkout -b raspi_buster karaage0703/raspi_buster
cd ~/tf-pose-estimation/tf_pose/pafprocess
sudo apt-get -y install swig
swig -python -c++ pafprocess.i && python3 setup.py build_ext --inplace
cd ~/tf-pose-estimation/
./download_100_224_pinto_model_zoo.sh

#sudo pip3 install scipy==1.1.0

# Reference site
# https://toramamma.blogspot.com/2019/04/jetson-nano-tensorflowopenpose.html


text:
import CDP from 'chrome-remote-interface';
import express from 'express';
import path from 'path';
import morgan from 'morgan';

const app = express();

app.use(morgan('combined'));
app.use('/', express.static(path.resolve(__dirname + '/../../build')));

const port = process.argv[2];

async function fetchScreenshot(url, viewport, imageHandler) {
    const client = await CDP();
    console.log("got client");

    const { Emulation, Page } = client;

    await Page.enable();

    const deviceMetrics = {
        width: viewport.width,
        height: viewport.height,
        deviceScaleFactor: 0,
        mobile: false,
        fitWindow: false,
    };
    await Emulation.setDeviceMetricsOverride(deviceMetrics);
    await Emulation.setVisibleSize({width: viewport.width, height: viewport.height});

    await Page.navigate({url});

    console.log("navigated to ", url);

    Page.loadEventFired(async () => {
        console.log("load event fired");

        const delay = 200;
        setTimeout(async () => {
            const screenshot = await Page.captureScreenshot({ format: "png", fromSurface: true });
            const img = Buffer.from(screenshot.data, "base64");
            console.log("created image");

            imageHandler(img);
            console.log("passed image");

            client.close();
            console.log("closed client");
        }, delay);
    });
}

app.get('/preview.png', async (req, res) => {
    const url = (req.hostname === "localhost") ?
        ("http://" + req.hostname + ":" + port + "/") : ("http://" + req.hostname + "/");
    console.log("url: ", url);

    await fetchScreenshot(url, { width: 400, height: 400 }, (img) => {
        res.writeHead(200, {
            'Content-Type': 'image/png',
            'Content-Length': img.length
        });
        res.end(img);
    });
});

app.listen(port, () => {
    console.log('listening on: ', port);
});


text:
package com.ibm.bi.dml.parser;

import java.util.ArrayList;
import java.util.HashMap;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ibm.bi.dml.hops.Hop.FileFormatTypes;

public abstract class Expression
{

	public enum Kind {
		UnaryOp, BinaryOp, BooleanOp, BuiltinFunctionOp, ParameterizedBuiltinFunctionOp, DataOp, Data, Literal, RelationalOp, ExtBuiltinFunctionOp, FunctionCallOp
	};

	public enum BinaryOp {
		PLUS, MINUS, MULT, DIV, MODULUS, INTDIV, MATMULT, POW, INVALID
	};

	public enum RelationalOp {
		LESSEQUAL, LESS, GREATEREQUAL, GREATER, EQUAL, NOTEQUAL, INVALID
	};

	public enum BooleanOp {
		CONDITIONALAND, CONDITIONALOR, LOGICALAND, LOGICALOR, NOT, INVALID
	};

	public enum BuiltinFunctionOp {
		ABS,
		ACOS,
		ASIN,
		ATAN,
		AVG,
		CAST_AS_MATRIX,
		CAST_AS_SCALAR,
		CAST_AS_DOUBLE,
		CAST_AS_INT,
		CAST_AS_BOOLEAN,
		COLMEAN,
		COLMAX,
		COLMIN,
		COLSUM,
		COS,
		COV,
		CUMMAX,
		CUMMIN,
		CUMPROD,
		CUMSUM,
		DIAG,
		EXP,
		INTERQUANTILE,
		IQM,
		LENGTH,
		LOG,
		MAX,
		MEAN,
		MIN,
		MOMENT,
		NCOL,
		NROW,
		OUTER,
		PPRED,
		PROD,
		QUANTILE,
		RANGE,
		ROUND,
		ROWINDEXMAX,
		ROWMAX,
		ROWMEAN,
		ROWMIN,
		ROWINDEXMIN,
		ROWSUM,
		SEQ,
		SIN,
		SQRT,
		SUM,
		TABLE,
		TAN,
		TRACE,
		TRANS,
		QR,
		LU,
		EIGEN,
		SOLVE,
		CEIL,
		FLOOR,
		CBIND, //previously APPEND
		RBIND,
		MEDIAN,
		INVERSE,
		SAMPLE
	};

	public enum ParameterizedBuiltinFunctionOp {
		GROUPEDAGG, RMEMPTY, REPLACE, ORDER,
		// Distribution Functions
		CDF, INVCDF, PNORM, QNORM, PT, QT, PF, QF, PCHISQ, QCHISQ, PEXP, QEXP,
		TRANSFORM,
		INVALID
	};

	public enum DataOp {
		READ, WRITE, RAND, MATRIX, INVALID
	}

	public enum FunctCallOp {
		INTERNAL, EXTERNAL
	};

	public enum ExtBuiltinFunctionOp {
		EIGEN, CHOLESKY
	};

	public enum AggOp {
		SUM, MIN, MAX, INVALID
	};

	public enum ReorgOp {
		TRANSPOSE, DIAG
	};

	//public enum DataOp {
	//	READ, WRITE
	//};

	public enum DataType {
		MATRIX, SCALAR, FRAME, OBJECT, UNKNOWN;

		public boolean isMatrix() {
			return (this == MATRIX);
		}
		public boolean isScalar() {
			return (this == SCALAR);
		}
	};

	public enum ValueType {
		INT, DOUBLE, STRING, BOOLEAN, OBJECT, UNKNOWN
	};

	public enum FormatType {
		TEXT, BINARY, MM, CSV, UNKNOWN
	};

	protected static final Log LOG = LogFactory.getLog(Expression.class.getName());

	public abstract Expression rewriteExpression(String prefix) throws LanguageException;

	protected Kind _kind;
	protected Identifier[] _outputs;

	private static int _tempId;

	public Expression() {
		_outputs = null;
	}

	public void setOutput(Identifier output) {
		if ( _outputs == null) {
			_outputs = new Identifier[1];
		}
		_outputs[0] = output;
	}

	public Kind getKind() {
		return _kind;
	}

	public Identifier getOutput() {
		if (_outputs != null && _outputs.length > 0)
			return _outputs[0];
		else
			return null;
	}

	public Identifier[] getOutputs() {
		return _outputs;
	}

	public void validateExpression(HashMap<String, DataIdentifier> ids, HashMap<String, ConstIdentifier> currConstVars, boolean conditional)
		throws LanguageException
	{
		raiseValidateError("Should never be invoked in Baseclass 'Expression'", false);
	}

	public void validateExpression(MultiAssignmentStatement mas, HashMap<String, DataIdentifier> ids, HashMap<String, ConstIdentifier> currConstVars, boolean conditional)
		throws LanguageException
	{
		raiseValidateError("Should never be invoked in Baseclass 'Expression'", false);
	}

	public static BinaryOp getBinaryOp(String val) {
		if (val.equalsIgnoreCase("+"))
			return BinaryOp.PLUS;
		else if (val.equalsIgnoreCase("-"))
			return BinaryOp.MINUS;
		else if (val.equalsIgnoreCase("*"))
			return BinaryOp.MULT;
		else if (val.equalsIgnoreCase("/"))
			return BinaryOp.DIV;
		else if (val.equalsIgnoreCase("%%"))
			return BinaryOp.MODULUS;
		else if (val.equalsIgnoreCase("%/%"))
			return BinaryOp.INTDIV;
		else if (val.equalsIgnoreCase("^"))
			return BinaryOp.POW;
		else if (val.equalsIgnoreCase("%*%"))
			return BinaryOp.MATMULT;
		return BinaryOp.INVALID;
	}

	public static RelationalOp getRelationalOp(String val) {
		if (val == null)
			return null;
		else if (val.equalsIgnoreCase("<"))
			return RelationalOp.LESS;
		else if (val.equalsIgnoreCase("<="))
			return RelationalOp.LESSEQUAL;
		else if (val.equalsIgnoreCase(">"))
			return RelationalOp.GREATER;
		else if (val.equalsIgnoreCase(">="))
			return RelationalOp.GREATEREQUAL;
		else if (val.equalsIgnoreCase("=="))
			return RelationalOp.EQUAL;
		else if (val.equalsIgnoreCase("!="))
			return RelationalOp.NOTEQUAL;
		return RelationalOp.INVALID;
	}

	public static BooleanOp getBooleanOp(String val) {
		if (val.equalsIgnoreCase("&&"))
			return BooleanOp.CONDITIONALAND;
		else if (val.equalsIgnoreCase("&"))
			return BooleanOp.LOGICALAND;
		else if (val.equalsIgnoreCase("||"))
			return BooleanOp.CONDITIONALOR;
		else if (val.equalsIgnoreCase("|"))
			return BooleanOp.LOGICALOR;
		else if (val.equalsIgnoreCase("!"))
			return BooleanOp.NOT;
		return BooleanOp.INVALID;
	}

	/**
	 * Convert format types from parser to Hops enum : default is text
	 */

	public static FileFormatTypes convertFormatType(String fn) {
		if (fn == null)
			return FileFormatTypes.TEXT;
		if (fn.equalsIgnoreCase(DataExpression.FORMAT_TYPE_VALUE_TEXT)) {
			return FileFormatTypes.TEXT;
		}
		if (fn.equalsIgnoreCase(DataExpression.FORMAT_TYPE_VALUE_BINARY)) {
			return FileFormatTypes.BINARY;
		}
		if (fn.equalsIgnoreCase(DataExpression.FORMAT_TYPE_VALUE_MATRIXMARKET))  {
			return FileFormatTypes.MM;
		}
		if (fn.equalsIgnoreCase(DataExpression.FORMAT_TYPE_VALUE_CSV))  {
			return FileFormatTypes.CSV;
		}
		// ToDo : throw parse exception for invalid / unsupported format type
		return FileFormatTypes.TEXT;
	}

	/**
	 * Construct Hops from parse tree : Create temporary views in expressions
	 */
	public static String getTempName() {
		return "parsertemp" + _tempId++;
	}

	public abstract VariableSet variablesRead();

	public abstract VariableSet variablesUpdated();

	public static DataType computeDataType(Expression e1, Expression e2, boolean cast) throws LanguageException {
		return computeDataType(e1.getOutput(), e2.getOutput(), cast);
	}

	public static DataType computeDataType(Identifier id1, Identifier id2, boolean cast) throws LanguageException {
		DataType d1 = id1.getDataType();
		DataType d2 = id2.getDataType();

		if (d1 == d2)
			return d1;

		if (cast) {
			if (d1 == DataType.MATRIX && d2 == DataType.SCALAR)
				return DataType.MATRIX;
			if (d1 == DataType.SCALAR && d2 == DataType.MATRIX)
				return DataType.MATRIX;
		}

		LOG.error(id1.printErrorLocation() + "Invalid Datatypes for operation");

		throw new LanguageException(id1.printErrorLocation() + "Invalid Datatypes for operation",
				LanguageException.LanguageErrorCodes.INVALID_PARAMETERS);
	}

	public static ValueType computeValueType(Expression e1, Expression e2, boolean cast) throws LanguageException {
		return computeValueType(e1.getOutput(), e2.getOutput(), cast);
	}

	public static ValueType computeValueType(Identifier id1, Identifier id2, boolean cast) throws LanguageException {
		ValueType v1 = id1.getValueType();
		ValueType v2 = id2.getValueType();

		if (v1 == v2)
			return v1;

		if (cast) {
			if (v1 == ValueType.DOUBLE && v2 == ValueType.INT)
				return ValueType.DOUBLE;
			if (v2 == ValueType.DOUBLE && v1 == ValueType.INT)
				return ValueType.DOUBLE;

			// String value type will override others
			// Primary operation involving strings is concatenation (+)
			if ( v1 == ValueType.STRING || v2 == ValueType.STRING )
				return ValueType.STRING;
		}

		LOG.error(id1.printErrorLocation() + "Invalid Valuetypes for operation");

		throw new LanguageException(id1.printErrorLocation() + "Invalid Valuetypes for operation",
				LanguageException.LanguageErrorCodes.INVALID_PARAMETERS);
	}

	@Override
	public boolean equals(Object that)
	{
		//empty check for robustness
		if( that == null || !(that instanceof Expression) )
			return false;

		Expression thatExpr = (Expression) that;

		//approach is to compare string representation of expression
		String thisStr = this.toString();
		String thatStr = thatExpr.toString();

		return thisStr.equalsIgnoreCase(thatStr);
	}

	@Override
	public int hashCode()
	{
		//use identity hash code
		return super.hashCode();
	}

	///////////////////////////////////////////////////////////////
	// validate error handling (consistent for all expressions)

	/**
	 *
	 * @param msg
	 * @param conditional
	 * @throws LanguageException
	 */
	public void raiseValidateError( String msg, boolean conditional )
		throws LanguageException
	{
		raiseValidateError(msg, conditional, null);
	}

	/**
	 *
	 * @param msg
	 * @param conditional
	 * @param code
	 * @throws LanguageException
	 */
	public void raiseValidateError( String msg, boolean conditional, String errorCode )
		throws LanguageException
	{
		if( conditional )  //warning if conditional
		{
			String fullMsg = this.printWarningLocation() + msg;

			LOG.warn( fullMsg );
		}
		else  //error and exception if unconditional
		{
			String fullMsg = this.printErrorLocation() + msg;

			LOG.error( fullMsg );
			if( errorCode != null )
				throw new LanguageException( fullMsg, errorCode );
			else
				throw new LanguageException( fullMsg );
		}
	}

	/**
	 * Returns the matrix characteristics for scalar-scalar, scalar-matrix, matrix-scalar, matrix-matrix
	 * operations. This method is aware of potentially unknowns and matrix-vector (col/row) operations.
	 *
	 * Format: rlen, clen, brlen, bclen.
	 *
	 * @param left
	 * @param right
	 * @return
	 */
	public static long[] getBinaryMatrixCharacteristics( Expression left, Expression right )
	{
		long[] ret = new long[]{ -1, -1, -1, -1 };

		Identifier idleft = left.getOutput();
		Identifier idright = right.getOutput();

		if( idleft.getDataType()==DataType.SCALAR && idright.getDataType()==DataType.SCALAR ) {
			ret[0] = 0;
			ret[1] = 0;
			ret[2] = 0;
			ret[3] = 0;
		}
		else if( idleft.getDataType()==DataType.SCALAR && idright.getDataType()==DataType.MATRIX ) {
			ret[0] = idright.getDim1();
			ret[1] = idright.getDim2();
			ret[2] = idright.getRowsInBlock();
			ret[3] = idright.getColumnsInBlock();
		}
		else if( idleft.getDataType()==DataType.MATRIX && idright.getDataType()==DataType.SCALAR ) {
			ret[0] = idleft.getDim1();
			ret[1] = idleft.getDim2();
			ret[2] = idleft.getRowsInBlock();
			ret[3] = idleft.getColumnsInBlock();
		}
		else if( idleft.getDataType()==DataType.MATRIX && idright.getDataType()==DataType.MATRIX ) {
			ret[0] = idleft.getDim1();
			ret[1] = idleft.getDim2();
			ret[2] = idleft.getRowsInBlock();
			ret[3] = idleft.getColumnsInBlock();
			if( ret[0] < 0 && idright.getDim1() > 1 ) //robustness for row vectors
				ret[0] = idright.getDim1();
			if( ret[1] < 0 && idright.getDim2() > 1 ) //robustness for row vectors
				ret[1] = idright.getDim2();
		}

		return ret;
	}

	///////////////////////////////////////////////////////////////////////////
	// store exception info + position information for expressions
	///////////////////////////////////////////////////////////////////////////
	private String _filename;
	private int _beginLine, _beginColumn;
	private int _endLine, _endColumn;
	private ArrayList<String> _parseExceptionList = new ArrayList<String>();

	public void setFilename(String passed)  { _filename = passed;   }
	public void setBeginLine(int passed)    { _beginLine = passed;   }
	public void setBeginColumn(int passed) 	{ _beginColumn = passed; }
	public void setEndLine(int passed) 		{ _endLine = passed;   }
	public void setEndColumn(int passed)	{ _endColumn = passed; }
	public void setParseExceptionList(ArrayList<String> passed) { _parseExceptionList = passed;}

	public void setAllPositions(String filename, int blp, int bcp, int elp, int ecp){
		_filename    = filename;
		_beginLine	 = blp;
		_beginColumn = bcp;
		_endLine 	 = elp;
		_endColumn 	 = ecp;
	}

	public String getFilename()	{ return _filename;   }
	public int getBeginLine()	{ return _beginLine;   }
	public int getBeginColumn() { return _beginColumn; }
	public int getEndLine() 	{ return _endLine;   }
	public int getEndColumn()	{ return _endColumn; }
	public ArrayList<String> getParseExceptionList() { return _parseExceptionList; }

	public String printErrorLocation(){
		return "ERROR: " + _filename + " -- line " + _beginLine + ", column " + _beginColumn + " -- ";
	}

	public String printErrorLocation(int beginLine, int beginColumn){
		return "ERROR: " + _filename + " -- line " + beginLine + ", column " + beginColumn + " -- ";
	}

	public String printWarningLocation(){
		return "WARNING: " + _filename + " -- line " + _beginLine + ", column " + _beginColumn + " -- ";
	}

	public String printInfoLocation(){
		return "INFO: " + _filename + " -- line " + _beginLine + ", column " + _beginColumn + " -- ";
	}
}


text:
var server = require('./server')
  , events = require('events')
  , stream = require('stream')
  , assert = require('assert')
  , fs = require('fs')
  , request = require('../index')
  , path = require('path')
  , util = require('util')
  ;

var port = 6768
  , called = false
  , proxiedHost = 'google.com'
  ;

// set up environment variable
process.env.HTTP_PROXY = 'http://localhost:'+port;

var s = server.createServer(port)
s.listen(port, function () {
  s.on('http://google.com/', function (req, res) {
    called = true
    assert.equal(req.headers.host, proxiedHost)
    res.writeHeader(200)
    res.end()
  })
  request ({
    url: 'http://'+proxiedHost,
    /* should read from HTTP_PROXY env var and
    // behave as if these arguments where passed:
    url: 'http://localhost:'+port,
    headers: {host: proxiedHost}
    //*/
  }, function (err, res, body) {
    s.close()
  })
})

process.on('exit', function () {
  assert.ok(called, 'the request must be made to the proxy server')
})


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

@Component({
  selector: 'app-comp-1865',
  templateUrl: './comp-1865.component.html',
  styleUrls: ['./comp-1865.component.css']
})
export class Comp1865Component implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}


text:
import re
from itertools import chain

from django.db import models
from django.core.exceptions import ValidationError
from model_utils.models import TimeStampedModel

class CampaignNameField(models.CharField):

    def __init__(self, *args, **kwargs):
        kwargs['max_length']=32
        super(CampaignNameField, self).__init__(*args, **kwargs)
        self._re = re.compile(r"^\w{4,32}$")

    def clean(self, value, model_instance):
        value = super(models.CharField, self).clean(value, model_instance).strip()
        matched = self._re.match(value)
        if not matched:
            raise ValidationError("Name must be a word made of 4 to 32 characters.")
        setattr(model_instance, self.name, value)
        return value

class Campaign(TimeStampedModel):
    name = CampaignNameField(unique=True)

    @property
    def run_set(self):
        qs = Run.objects.none()
        for dork in self.dork_set.all():
            qs |= dork.run_set
        return qs

    @property
    def result_set(self):
        qs = Result.objects.none()
        for run in self.run_set.all():
            qs |= run.result_set.filter()
        return qs

# TODO: move somewhere else, create a testsuite and remove redundant tests from ./tests.py
class DorkQueryField(models.CharField):

    def __init__(self, *args, **kwargs):
        kwargs['max_length']=256
        super(DorkQueryField, self).__init__(*args, **kwargs)
        self._re = re.compile(r"^.{1,256}$")

    def clean(self, value, model_instance):
        value = super(models.CharField, self).clean(value, model_instance).strip()
        matched = self._re.match(value)
        if not matched:
            raise ValidationError("Name must be a word made of 1 to 256 characters.")
        setattr(model_instance, self.name, value)
        return value

class Dork(TimeStampedModel):
    campaign = models.ForeignKey('Campaign')
    query = DorkQueryField()

    @property
    def result_set(self):
        qs = Dork.objects.none()
        for run in self.run_set.all():
            qs |= run.result_set
        return qs

    class Meta:
        unique_together = ("campaign", "query")

class Run(models.Model):
    dork = models.ForeignKey('Dork')
    result_set = models.ManyToManyField('Result')
    created = models.DateTimeField(auto_now_add=True)

class Result(models.Model):
    title = models.CharField(max_length=1024)
    summary = models.TextField()
    url = models.URLField(max_length=1024)

    class Meta:
        unique_together = ("title", "summary", "url")


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

public class ScoreBoardScript : MonoBehaviour, CustomActionListener, IActionNotifier
{
	int currStarCount = 0;
	int currWrongCount = 0;
	int maxWrong = 3;

	Color[] colorLevels = new Color[] { Color.white, Color.green, Color.red };
	int currStarLevel = 0;
	int starsPerLevel = 5;

	GameObject latestUpdatedStar;
	GameObject latestUpdatedCross;

	public void addStar()
	{

		Transform scoreBoard = GameObject.Find("Scoreboard").transform;

		int starID = (currStarCount%starsPerLevel);
		Transform reqStar = scoreBoard.FindChild("Star-"+starID);
		if(reqStar != null)
		{
			Vector3 tmpStarScale = reqStar.localScale;
			tmpStarScale.x = 5;
			tmpStarScale.y = 5;
			tmpStarScale.z = 1;
			reqStar.localScale = tmpStarScale;

			currStarLevel = (currStarCount / starsPerLevel);
			Color reqStarColor = colorLevels[(currStarLevel % colorLevels.Length)];
			reqStar.GetComponent<SpriteRenderer>().color = reqStarColor;
			reqStar.GetComponent<SpriteRenderer>().sortingOrder++;

			latestUpdatedStar = reqStar.gameObject;

			CustomAnimationManager aniMang = reqStar.gameObject.AddComponent<CustomAnimationManager>();
			List<List<AniCommandPrep>> batchLists = new List<List<AniCommandPrep>>();
			List<AniCommandPrep> batch1 = new List<AniCommandPrep>();
			batch1.Add(new AniCommandPrep("DelayForInterval",1,new List<System.Object>() { 1f } ));
			List<AniCommandPrep> batch2 = new List<AniCommandPrep>();
			batch2.Add(new AniCommandPrep("GrowOrShrink",1,new List<System.Object>() { new float[3] { 1,1,1 }, 3f }));
			List<AniCommandPrep> batch3 = new List<AniCommandPrep>();
			batch3.Add(new AniCommandPrep("DelayForInterval",1,new List<System.Object>() { 0.5f } ));

			/*batch1.Add(new AniCommandPrep("DelayForInterval",1,new List<System.Object>() { 3f } ));
			List<AniCommandPrep> batch2 = new List<AniCommandPrep>();
			batch2.Add(new AniCommandPrep("InjectLocalScale",1,new List<System.Object>() { new float[3] {1f, 1f, 1f}}));*/
			//batch2.Add(new AniCommandPrep("ColorTransition",1,new List<System.Object>() { new float[4] {1,1,1,1}, 0.1f }));
			batchLists.Add(batch1);
			batchLists.Add(batch2);
			batchLists.Add(batch3);
			aniMang.registerListener("Scoreboard",this);
			aniMang.init("NewStarAni",batchLists);

			currStarCount++;
		}
	}

	public void addWrongCross()
	{
		if(currWrongCount < maxWrong)
		{
			Transform scoreBoard = GameObject.Find("Scoreboard").transform;

			Transform reqCross = scoreBoard.FindChild("BadCross-"+currWrongCount);
			if(reqCross != null)
			{
				Vector3 tmpStarScale = reqCross.localScale;
				tmpStarScale.x = 2f;
				tmpStarScale.y = 2f;
				tmpStarScale.z = 1;
				reqCross.localScale = tmpStarScale;

				reqCross.GetComponent<SpriteRenderer>().color = Color.red;
				reqCross.GetComponent<SpriteRenderer>().sortingOrder++;

				latestUpdatedCross = reqCross.gameObject;

				CustomAnimationManager aniMang = reqCross.gameObject.AddComponent<CustomAnimationManager>();
				List<List<AniCommandPrep>> batchLists = new List<List<AniCommandPrep>>();
				List<AniCommandPrep> batch1 = new List<AniCommandPrep>();
				batch1.Add(new AniCommandPrep("DelayForInterval",1,new List<System.Object>() { 0.5f } ));
				List<AniCommandPrep> batch2 = new List<AniCommandPrep>();
				batch2.Add(new AniCommandPrep("GrowOrShrink",1,new List<System.Object>() { new float[3] { 1,1,1 }, 3f }));
				List<AniCommandPrep> batch3 = new List<AniCommandPrep>();
				batch3.Add(new AniCommandPrep("DelayForInterval",1,new List<System.Object>() { 0.5f } ));

				//batch2.Add(new AniCommandPrep("ColorTransition",1,new List<System.Object>() { new float[4] {1,1,1,1}, 0.1f }));
				batchLists.Add(batch1);
				batchLists.Add(batch2);
				batchLists.Add(batch3);
				aniMang.registerListener("Scoreboard",this);
				aniMang.init("NewCrossAni",batchLists);

				currWrongCount++;
			}
		}
	}

	public void reset()
	{
		resetStars();
		resetCrosses();
	}

	private void resetStars()
	{
		currStarCount = 0;

		Transform scoreBoard = GameObject.Find("Scoreboard").transform;

		Color plainColor = ColorUtils.convertColor(21,21,21,47);

		int tmpCounter = 0;
		bool foundStar = true;
		while(foundStar)
		{
			Transform tmpStar = scoreBoard.FindChild("Star-"+tmpCounter);
			if(tmpStar == null)
			{
				foundStar = false;
			}
			else
			{
				tmpStar.GetComponent<SpriteRenderer>().color = plainColor;
			}

			tmpCounter++;
		}
	}

	public void resetCrosses()
	{
		currWrongCount = 0;

		Transform scoreBoard = GameObject.Find("Scoreboard").transform;

		Color plainColor = ColorUtils.convertColor(21,21,21,47);

		int tmpCounter = 0;
		bool foundCross = true;
		while(foundCross)
		{
			Transform tmpCross = scoreBoard.FindChild("BadCross-"+tmpCounter);
			if(tmpCross == null)
			{
				foundCross = false;
			}
			else
			{
				tmpCross.GetComponent<SpriteRenderer>().color = plainColor;
			}

			tmpCounter++;
		}
	}

	public void respondToEvent(string para_sourceID, string para_eventID, System.Object para_eventData)
	{
		if(para_eventID == "NewStarAni")
		{
			latestUpdatedStar.GetComponent<SpriteRenderer>().sortingOrder--;
			notifyAllListeners("Scoreboard","ScoreboardUpdate",null);
		}
		else if(para_eventID == "NewCrossAni")
		{
			latestUpdatedCross.GetComponent<SpriteRenderer>().sortingOrder--;
		}
	}

	// Action Notifier Methods.
	IActionNotifier acNotifier = new ConcActionNotifier();
	public void registerListener(string para_name, CustomActionListener para_listener) { acNotifier.registerListener(para_name,para_listener); }
	public void unregisterListener(string para_name) { acNotifier.unregisterListener(para_name); }
	public void notifyAllListeners(string para_sourceID, string para_eventID, System.Object para_eventData)	{ acNotifier.notifyAllListeners(para_sourceID,para_eventID,para_eventData);	}
}


text:
#ifndef I2C_H
#define I2C_H

#include <stdint.h>
#include "isr.h"
#include "gpio.h"

#define I2C_NON_BLOCKING 1

/* The I2C Interrupt Service Routine */
void i2c_isr (void);

/* Enable the I2C module */
void i2c_enable(void);

/* Disable the I2C module */
void i2c_disable(void);

/* Returns 1 if the I2C bus is active (we or some other device are transferring data) */
uint8_t i2c_busy(void);

/* Returns 1 if our data is sent or received */
uint8_t i2c_transferred(void); // indicates success of data last transfer (send or receive)

/* start receiving data from 'slave_address' of length 'byte_ctr' and store it in 'rx_buf'
 * @parameter slave_addr	7bits (and will be padded with the 'receive bit')
 * @parameter byte_ctr 		the number of bytes expected to be received
 * @parameter rx_buf		the buffer in which the received bytes will be stored.
 *
 * IFDEF I2C_NON_BLOCKING THEN THIS FUNCTION RETURNS IMMEDIATLY BUT THE TRANSFER WILL ONLY
 * BE COMPLETE WHEN i2c_transferred IS 1
 */
void i2c_receiveinit( uint8_t slave_address, uint8_t byte_ctr, uint8_t *rx_buf);

/* start sending data to 'slave_address' of length 'byte_ctr' found  in the buffer 'rx_buf'
 * @parameter slave_addr	7bits (and will be padded with the 'send bit')
 * @parameter byte_ctr 		the number of bytes to be sent
 * @parameter tx_buf		the buffer in which the bytes to be sent are stored
 *
 * IFDEF I2C_NON_BLOCKING THEN THIS FUNCTION RETURNS IMMEDIATLY BUT THE TRANSFER WILL ONLY
 * BE COMPLETE WHEN i2c_transferred IS 1
 */
void i2c_transmitinit(uint8_t slave_address, uint8_t byte_ctr, uint8_t *tx_buf);

#ifndef I2C_NON_BLOCKING
#define I2C_NON_BLOCKING 1
#endif

#if I2C_NON_BLOCKING
uint8_t i2c_receive(void);
void    i2c_transmit(void);
#endif

// TODO: see if this is better fit in platform definition
#define I2C_SDA       13    //SDA == P5.1 // GPIO 13
#define I2C_SCL       12    //SCL == P5.2 // GPIO 12

// TODO: this could use a nice struct with bit members...

#define I2C_BASE (0x80006000)

#define I2CADR		((volatile uint8_t *) ( I2C_BASE + 0x00	))
#define I2CFDR		((volatile uint8_t *) ( I2C_BASE + 0x04	))
#define I2CCR		((volatile uint8_t *) ( I2C_BASE + 0x08	))
#define I2CSR		((volatile uint8_t *) ( I2C_BASE + 0x0C	))
#define I2CDR		((volatile uint8_t *) ( I2C_BASE + 0x10	))
#define I2CDFSRR	((volatile uint8_t *) ( I2C_BASE + 0x14	))
#define I2CCKER		((volatile uint8_t *) ( I2C_BASE + 0x18	))

// TODO: fix nice structs

// i2c CR
#define I2C_MEN		0x80
#define I2C_MIEN	0x40
#define I2C_MSTA	0x20
#define I2C_MTX		0x10
#define I2C_TXAK	0x08
#define I2C_RSTA	0x04
#define I2C_BCST	0x01

// i2c SR
#define I2C_MCF		0x80
#define I2C_MAAS	0x40
#define I2C_MBB		0x20
#define I2C_MAL		0x10
#define I2C_BCSTM	0x08
#define I2C_SRW		0x04
#define I2C_MIF		0x02
#define I2C_RXAK	0x01

// i2c digital filter sample rate register
#define I2C_DFSR 	0x3f // default = 0x10

// i2c CKER
#define I2C_CKEN	0x01

#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2015 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<task oid="cd1e0ff2-0099-11e5-9e22-001e8c717e5b"
	xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
	xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<name>Synchronization: OpenLDAP</name>

	<taskIdentifier>cd1e0ff2-0099-11e5-9e22-001e8c717e5b</taskIdentifier>
	<ownerRef oid="00000000-0000-0000-0000-000000000002"/>
	<executionStatus>runnable</executionStatus>

	<handlerUri>http://midpoint.evolveum.com/xml/ns/public/model/synchronization/task/live-sync/handler-3</handlerUri>
	<objectRef oid="2a7c7130-7a34-11e4-bdf6-001e8c717e5b" xsi:type="c:ResourceType"/>
	<recurrence>recurring</recurrence>
	<binding>tight</binding>
	<schedule>
		<interval>3</interval>
	</schedule>

</task>


text:
const express = require('express');
const router = express.Router();

module.exports = (files, db) => {

	for (let file of files) {
		if (file.match(/\.middleware\.js$/gi)) {
			let middleware = require(file)(db);
			router.use(middleware);
		}
	}

	return router;
};


text:
package com.twitter.elephanttwin.io;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.hadoop.io.Writable;

/**
 * A Writable class to write a list of LongWritable values.
 */
public class ListLongPair implements Writable {

  private List<LongPairWritable> list;

  public ListLongPair() {
    list = new ArrayList<LongPairWritable>();
  }

  public ListLongPair(List<LongPairWritable> l) {
    list = l;
  }

  public ListLongPair(int initialCapacity) {
    list = new ArrayList<LongPairWritable>(initialCapacity);
  }

  public int size() {
    return list.size();
  }

  public void add(LongPairWritable value) {
    LongPairWritable a = new LongPairWritable(value);
    list.add(a);
  }

  public void add(ListLongPair l) {
    list.addAll(l.get());
  }

  @Override
  public void write(DataOutput out) throws IOException {
    out.writeInt(list.size());
    Iterator<LongPairWritable> itr = list.iterator();

    while (itr.hasNext()) {
      LongPairWritable element = itr.next();
      element.write(out);
    }
  }

  @Override
  public String toString() {
    Iterator<LongPairWritable> it = list.listIterator();
    StringBuilder str = new StringBuilder();
    while (it.hasNext()) {
      str.append(" " + it.next());
    }
    return str.toString();
  }

  @Override
  public void readFields(DataInput in) throws IOException {
    int numElements = in.readInt();
    list = new ArrayList<LongPairWritable>(numElements);

    for (int cnt = 0; cnt < numElements; cnt++) {
      LongPairWritable l = new LongPairWritable();
      l.readFields(in);
      list.add(l);
    }
  }

  public List<LongPairWritable> get() {
    return list;
  }
}


text:
/**
 * Provides a convenient holder for disconnected result sets.
 * Supported by JdbcTemplate, but can be used independently too.
 */
@NonNullApi
@NonNullFields
package org.springframework.jdbc.support.rowset;

import org.springframework.lang.NonNullApi;
import org.springframework.lang.NonNullFields;


text:
from memory_profiler import profile
import config
import time

my_config = config.get_config()
number_of_loops = my_config.getint("Global", "number_of_loops")

def my_generator(start_value):
    while start_value < number_of_loops:
        yield start_value
        start_value += 1

@profile
def generator_testing():
    for loop_count in my_generator(0):
        foo = loop_count + 3

start = time.time()
generator_testing()
end = time.time()
print(end - start)


text:
package org.dcm4chee.web.war.folder.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.apache.wicket.model.IModel;
import org.dcm4che2.data.DicomObject;
import org.dcm4che2.data.Tag;
import org.dcm4chee.archive.entity.Patient;
import org.dcm4chee.archive.entity.Study;
import org.dcm4chee.archive.util.JNDIUtils;
import org.dcm4chee.web.dao.folder.StudyListLocal;
import org.dcm4chee.web.war.common.model.AbstractDicomModel;
import org.dcm4chee.web.war.common.model.AbstractEditableDicomModel;

/**
 * @author Gunter Zeilinger <gunterze@gmail.com>
 * @version $Revision$ $Date$
 * @since Dec 12, 2008
 */
public class PatientModel extends AbstractEditableDicomModel implements Serializable {

    private static final long serialVersionUID = 1L;

    private List<StudyModel> studies = new ArrayList<StudyModel>();
    private IModel<Boolean> latestStudyFirst;

    public PatientModel(Patient patient, IModel<Boolean> latestStudyFirst) {
        setPk(patient.getPk());
        this.dataset = patient.getAttributes();
        this.latestStudyFirst = latestStudyFirst;
    }

    @Override
    public void setParent(AbstractDicomModel o) {
        throw new UnsupportedOperationException("Patient has no parent model!");
    }

    public String getName() {
        return dataset.getString(Tag.PatientName);
    }

    public String getId() {
        return dataset.getString(Tag.PatientID);
    }

    public String getIssuer() {
        return dataset.getString(Tag.IssuerOfPatientID);
    }

    public String getSex() {
        return dataset.getString(Tag.PatientSex);
    }

    public Date getBirthdate() {
        return toDate(Tag.PatientBirthDate);
    }

    public String getComments() {
        return dataset.getString(Tag.PatientComments);
    }

    public List<StudyModel> getStudies() {
        return studies;
    }

    @Override
    public int getRowspan() {
        int rowspan = isDetails() ? 2 : 1;
        for (StudyModel study : studies) {
            rowspan += study.getRowspan();
        }
        return rowspan;
    }

    @Override
    public void collapse() {
        studies.clear();
    }

    @Override
    public boolean isCollapsed() {
        return studies.isEmpty();
    }

    public void retainSelectedStudies() {
        for (Iterator<StudyModel> it = studies.iterator(); it.hasNext();) {
            StudyModel study = it.next();
            study.retainSelectedPPSs();
            if (study.isCollapsed() && !study.isSelected()) {
                it.remove();
            }
        }
    }

    @Override
    public void expand() {
        studies.clear();
        StudyListLocal dao = (StudyListLocal)
                JNDIUtils.lookup(StudyListLocal.JNDI_NAME);
        for (Study study : dao.findStudiesOfPatient(getPk(), latestStudyFirst.getObject())) {
            this.studies.add(new StudyModel(study, this));
        }
    }

    @Override
    public int levelOfModel() {
        return PATIENT_LEVEL;
    }

    @Override
    public List<? extends AbstractDicomModel> getDicomModelsOfNextLevel() {
        return studies;
    }

    @Override
    public void update(DicomObject dicomObject) {
        StudyListLocal dao = (StudyListLocal)
                JNDIUtils.lookup(StudyListLocal.JNDI_NAME);
        dataset = dao.updatePatient(getPk(), dicomObject).getAttributes();
    }

    @Override
    public AbstractEditableDicomModel refresh() {
        StudyListLocal dao = (StudyListLocal)
        JNDIUtils.lookup(StudyListLocal.JNDI_NAME);
        dataset = dao.getPatient(getPk()).getAttributes();
        return this;
    }
}


text:
import json
import logging
from secrets import token_hex

from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import Http404
from django.shortcuts import redirect, render

from apps.core.backends import dev_required
from apps.core.forms import ServiceForm
from apps.core.models import Service, UserProfile

logger = logging.getLogger('sso.dev')

# /main/
@login_required
@dev_required
def main(request):
    success = False
    profile = request.user.profile
    services = request.user.managed_services.filter(scope='TEST')
    users = User.objects.filter(profile__test_only=True)

    if request.method == 'POST':
        point_test = request.POST.get('point', '0')
        point_test = int(point_test) if point_test.isdigit() else 0
        test_enabled = request.POST.get('test', 'D') == 'E'

        if profile.flags['sysop']:
            test_enabled = False
        elif profile.flags['test'] and not profile.flags['sparcs']:
            test_enabled = True

        profile.point_test = point_test
        profile.test_enabled = test_enabled
        profile.save()
        success = True
        logger.info('profile.update', {
            'r': request,
            'extra': [
                ('test', str(profile.test_enabled).lower()),
                ('point', profile.point_test),
            ],
        })

    return render(request, 'dev/main.html', {
        'profile': profile,
        'services': services,
        'users': users,
        'success': success,
    })

# /service/(name)/
@login_required
@dev_required
def service(request, name):
    service = Service.objects.filter(name=name, scope='TEST').first()
    if (service and service.admin_user != request.user) or \
            (not service and name != 'add'):
        raise Http404

    if request.method == 'POST':
        service_f = ServiceForm(request.POST, instance=service)
        service_new = service_f.save(commit=False)

        if not service:
            while True:
                name = f'test{token_hex(10)}'
                if not Service.objects.filter(name=name).count():
                    break

            service_new.name = name
            service_new.is_shown = False
            service_new.scope = 'TEST'
            service_new.secret_key = token_hex(10)
            service_new.admin_user = request.user

        service_new.save()

        log_msg = 'create' if not service else 'update'
        logger.warning(f'service.{log_msg}', {
            'r': request,
            'extra': [
                ('name', service_new.name),
                ('alias', service_new.alias),
            ],
        })
        return redirect('/dev/main/')

    return render(request, 'dev/service.html', {'service': service})

# /service/(name)/delete/
@login_required
@dev_required
def service_delete(request, name):
    service = Service.objects.filter(name=name, scope='TEST').first()
    if not service or service.admin_user != request.user:
        raise Http404

    service.delete()
    logger.warning('service.delete', {
        'r': request,
        'extra': [('name', name)],
    })
    return redirect('/dev/main/')

# /user/(uid)/
@login_required
@dev_required
def user(request, uid):
    user = User.objects.filter(username=uid, profile__test_only=True).first()
    if not user and uid != 'add':
        raise Http404

    if request.method == 'POST':
        first_name = request.POST.get('first_name', 'TEST')
        last_name = request.POST.get('last_name', 'TEST')

        if not user:
            while True:
                seed = token_hex(4)
                email = f'test-{seed}@sso.sparcs.org'
                if not User.objects.filter(email=email).count():
                    break

            while True:
                username = f'test{token_hex(10)}'
                if not User.objects.filter(username=username).count():
                    break

            user = User.objects.create_user(username=username,
                                            first_name=first_name,
                                            last_name=last_name,
                                            email=email,
                                            password=seed)
            profile = UserProfile(user=user, email_authed=True,
                                  test_enabled=True, test_only=True)
        else:
            profile = user.profile

        user.first_name = first_name
        user.last_name = last_name
        user.save()

        birthday = request.POST.get('birthday', None)
        profile.gender = request.POST.get('gender', '*H')
        profile.birthday = birthday if birthday else None
        profile.point_test = int(request.POST.get('point_test', '0'))
        profile.save()

        try:
            kaist_info = json.loads(request.POST.get('kaist_info', ''))
            profile.save_kaist_info({
                'userid': kaist_info['kaist_uid'],
                'kaist_info': kaist_info,
            })
        except Exception:
            pass

        log_msg = 'create' if uid == 'add' else 'update'
        logger.warning(f'account.{log_msg}', {
            'r': request,
            'extra': [
                ('uid', user.username),
                ('email', user.email),
            ],
        })
        return redirect('/dev/main/')

    return render(request, 'dev/user.html', {'tuser': user})

# /user/(uid)/delete/
@login_required
@dev_required
def user_delete(request, uid):
    user = User.objects.filter(username=uid, profile__test_only=True).first()
    if not user:
        raise Http404

    user.delete()
    logger.warning('account.delete', {
        'r': request,
        'extra': [('uid', uid)],
    })
    return redirect('/dev/main/')


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace SprintMarketing.C28.ExchangeAgent.API.Models
{
    public class C28APIError
    {
        [JsonProperty(PropertyName = "message")]
        public String message { get; private set; }
    }
}


text:
import express from 'express'
import Mongo from '../server.js';
import config from '../config.js';
import collectionUtil from '../collectionUtil.js';
import utilities from '../utilities.js';
import bodyParser from 'body-parser';

var router = express.Router();

router.get('/',(req,res) => {
	//find user and test pass
	var user = req.user;
	user['confirmed'] = true;
	var query = {'email' : user.email };

	Mongo._update('users',query, user).then((resp) => {
		res.render("home",{ "email": user.email,
	 											"token": req.query.token,
												"password":"your_password"
											});
	})
	.catch((err) => {
		console.log(err);
		res.send("err");
	})
});

export default router;


text:
<?php

namespace Feft\AddressBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;

/**
 * Region
 */
class Region
{
    /**
     * @var integer
     */
    private $id;

    /**
     * Region name
     * @var string
     */
    private $name;

    /**
     * Region country.
     * @var Country;
     */
    protected $country;

    /**
     * Region localities.
     * @var Locality
     */
    protected $localities;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->localities = new ArrayCollection();
    }

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

    /**
     * Set name
     *
     * @param string $name
     * @return Region
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

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

    /**
     * Set country
     *
     * @param \Feft\AddressBundle\Entity\Country $country
     * @return Region
     */
    public function setCountry(\Feft\AddressBundle\Entity\Country $country = null)
    {
        $this->country = $country;

        return $this;
    }

    /**
     * Get country
     *
     * @return \Feft\AddressBundle\Entity\Country
     */
    public function getCountry()
    {
        return $this->country;
    }

    /**
     * Add localities
     *
     * @param \Feft\AddressBundle\Entity\Locality $locality
     * @return Region
     */
    public function addLocality(\Feft\AddressBundle\Entity\Locality $locality)
    {
        $this->localities[] = $locality;

        return $this;
    }

    /**
     * Remove localities
     *
     * @param \Feft\AddressBundle\Entity\Locality $locality
     */
    public function removeLocality(\Feft\AddressBundle\Entity\Locality $locality)
    {
        $this->localities->removeElement($locality);
    }

    /**
     * Get localities
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getLocalities()
    {
        return $this->localities;
    }

    /**
     * Default implementation.
     *
     * @return string
     */
    public function __toString()
    {
        return $this->getName();
    }
}