text:
using System.Globalization;
using System.Security;
using System.Threading;

namespace NUnit.Framework.Internal
{
    /// <summary>
    /// Holds thread state which is captured and restored in order to sandbox user code.
    /// </summary>
    internal sealed class SandboxedThreadState
    {
        public CultureInfo Culture { get; }
        public CultureInfo UICulture { get; }
#if !NETSTANDARD1_4
        public System.Security.Principal.IPrincipal Principal { get; }
#endif
        private readonly SynchronizationContext _synchronizationContext;

        private SandboxedThreadState(
            CultureInfo culture,
            CultureInfo uiCulture,
#if !NETSTANDARD1_4
            System.Security.Principal.IPrincipal principal,
#endif
            SynchronizationContext synchronizationContext)
        {
            Culture = culture;
            UICulture = uiCulture;
#if !NETSTANDARD1_4
            Principal = principal;
#endif
            _synchronizationContext = synchronizationContext;
        }

        /// <summary>
        /// Captures a snapshot of the tracked state of the current thread to be restored later.
        /// </summary>
        public static SandboxedThreadState Capture()
        {
            return new SandboxedThreadState(
                CultureInfo.CurrentCulture,
                CultureInfo.CurrentUICulture,
#if !NETSTANDARD1_4
                Thread.CurrentPrincipal,
#endif
                SynchronizationContext.Current);
        }

        /// <summary>
        /// Restores the tracked state of the current thread to the previously captured state.
        /// </summary>
        [SecurityCritical]
        public void Restore()
        {
#if NETSTANDARD1_4
            CultureInfo.CurrentCulture = Culture;
            CultureInfo.CurrentUICulture = UICulture;
#else
            Thread.CurrentThread.CurrentCulture = Culture;
            Thread.CurrentThread.CurrentUICulture = UICulture;
            Thread.CurrentPrincipal = Principal;
#endif

            SynchronizationContext.SetSynchronizationContext(_synchronizationContext);
        }

        /// <summary>
        /// Returns a copy with the specified culture.
        /// </summary>
        public SandboxedThreadState WithCulture(CultureInfo culture)
        {
            return new SandboxedThreadState(
                culture,
                UICulture,
#if !NETSTANDARD1_4
                Principal,
#endif
                _synchronizationContext);
        }

        /// <summary>
        /// Returns a copy with the specified UI culture.
        /// </summary>
        public SandboxedThreadState WithUICulture(CultureInfo uiCulture)
        {
            return new SandboxedThreadState(
                Culture,
                uiCulture,
#if !NETSTANDARD1_4
                Principal,
#endif
                _synchronizationContext);
        }

#if !NETSTANDARD1_4
        /// <summary>
        /// Returns a copy with the specified principal.
        /// </summary>
        public SandboxedThreadState WithPrincipal(System.Security.Principal.IPrincipal principal)
        {
            return new SandboxedThreadState(
                Culture,
                UICulture,
                principal,
                _synchronizationContext);
        }
#endif
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="Transportation Methods for Econometrics">
    <meta name="author" content="Keith O'Hara">

    <meta name="keywords" content="TraME, Transportation Methods, Optimal Transport, R, C++, Cpp, Econometrics, Research, Alfred Galichon, Keith O'Hara, NYU, New York University" />

    <link rel="shortcut icon" type="image/x-icon" href="siteicon.ico">

    <title>Transportation Methods for Econometrics (TraME)</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/modern-business.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

    <link type="text/css" rel="stylesheet" href="css/swift_theme.css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>

                        About

                        Versions

                                C++

                                R

Home

TraME

                        ARUMs

ARUMs

Empirical

Logit

None

Probit

RSC

RUSC

                        MMFs

MMFs

CD

CES

Geo

Min

                        Transfers

Transfers

ETU

LTU

NTU

TU

                        Markets

Markets

DSE

MFE

                        Solvers

Solvers

Arc Newton

Cupids LP

DA RUM

EAP Nash

IPFP

Jacobi

Max Welfare

Nodal Newton

OAP LP

Models

MMFs

 &nbsp

Exponentially Transferable Utility (ETU) Class

        Class Definition

        Member Objects

        Member Functions

        Notes

        Example

Class Definition

Definition:

class etu
{
    public:
        // build objects
        bool need_norm;

        int transfers_type = 2;
        int nbX;
        int nbY;
        int nbParams;

        arma::mat alpha;
        arma::mat gamma;
        arma::mat tau;
        arma::mat kappa; // kappa_ETU = -1/tau_inp

        arma::mat aux_alpha; // - alpha_ETU / tau_ETU = log(C_ETU)
        arma::mat aux_gamma; // - gamma_ETU / tau_ETU = log(D_ETU)

        arma::mat aux_alpha_exp; // exp(- alpha_ETU / tau_ETU), also labelled C_ETU
        arma::mat aux_gamma_exp; // exp(- gamma_ETU / tau_ETU), also labelled D_ETU

        // member functions
        void build(const arma::mat& alpha_ETU, const arma::mat& gamma_ETU, const arma::mat& tau_ETU, bool need_norm_ETU);

        void trans();

        //
        // MFE-related functions
        arma::mat M(const arma::mat& a_xs, const arma::mat& b_ys) const;
        arma::mat M(const arma::mat& a_xs, const arma::mat& b_ys, arma::uvec* xs, arma::uvec* ys) const;
        arma::mat M(const double& a_xs, const arma::mat& b_ys, arma::uvec* xs, arma::uvec* ys) const;
        arma::mat M(const arma::mat& a_xs, const double& b_ys, arma::uvec* xs, arma::uvec* ys) const;

        arma::mat Mx0(const arma::mat& a_x) const;
        arma::mat M0y(const arma::mat& b_y) const;
};

Member Objects

Member Functions

Notes

Examples

Example:

Copyright © TraME Group 2017

redpajama_set_name: RedPajamaGithub


text:
package com.t3coode.togg.activities.validators;

import android.widget.Spinner;

public class SpinnerSelectedOptionValidator extends BasicValidator {

    public enum ValidationTypes implements ValidationType {
        SELECTION_IS_NOT_EMPTY("selectionIsNotEmpty");

        private final String value;

        private ValidationTypes(String value) {
            this.value = value;
        }

        @Override
        public String value() {
            return value;
        }
    }

    private Spinner spinner;

    public SpinnerSelectedOptionValidator(String keyName, String name,
            Spinner spinner, ValidationTypes[] validations) {
        super(keyName, name, validations);
        this.spinner = spinner;
    }

    @SuppressWarnings("unused")
    private boolean selectionIsNotEmpty() {
        return spinner.getSelectedItem() != null;
    }
}


text:
package com.sicdlib.dto;

import javax.persistence.*;

/**
 * Created by DeMH on 2017/6/13.
 */
@Entity
@Table(name = "article_hot_value", schema = "socialmind", catalog = "")
public class ArticleHotValueEntity {

    private String id;
    private Double hotValue;
    private String websiteName;
    private String tableName;
    private String sourceArticleId;

    @Id
    @Column(name = "id")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "hot_value")
    public Double getHotValue() {
        return hotValue;
    }

    public void setHotValue(Double hotValue) {
        this.hotValue = hotValue;
    }

    @Basic
    @Column(name = "website_name")
    public String getWebsiteName() {
        return websiteName;
    }

    public void setWebsiteName(String websiteName) {
        this.websiteName = websiteName;
    }

    @Basic
    @Column(name = "table_name")
    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    @Basic
    @Column(name = "source_article_id")
    public String getSourceArticleId() {
        return sourceArticleId;
    }

    public void setSourceArticleId(String sourceArticleId) {
        this.sourceArticleId = sourceArticleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ArticleHotValueEntity that = (ArticleHotValueEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (hotValue != null ? !hotValue.equals(that.hotValue) : that.hotValue != null) return false;
        if (websiteName != null ? !websiteName.equals(that.websiteName) : that.websiteName != null) return false;
        if (tableName != null ? !tableName.equals(that.tableName) : that.tableName != null) return false;
        if (sourceArticleId != null ? !sourceArticleId.equals(that.sourceArticleId) : that.sourceArticleId != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (hotValue != null ? hotValue.hashCode() : 0);
        result = 31 * result + (websiteName != null ? websiteName.hashCode() : 0);
        result = 31 * result + (tableName != null ? tableName.hashCode() : 0);
        result = 31 * result + (sourceArticleId != null ? sourceArticleId.hashCode() : 0);
        return result;
    }
}


text:
#import <IDEInterfaceBuilderKit/IBConnectionEndPointHandler.h>

@class IBSourceCodeConnectionContext, NSArray;

@interface IBSourceCodeConnectionEndPointHandler : IBConnectionEndPointHandler
{
    IBSourceCodeConnectionContext *preferredMatchConnectionContext;
    NSArray *connectionContexts;
}

@property(readonly) IBSourceCodeConnectionContext *preferredMatchConnectionContext; // @synthesize preferredMatchConnectionContext;
@property(readonly) NSArray *connectionContexts; // @synthesize connectionContexts;
- (void).cxx_destruct;
- (id)targetToSendToEndPointProviderForConnectionSuccess;
- (id)connectionForPrototype:(id)arg1 interfaceStyle:(id)arg2;
- (id)connectionForConnectingFromObject:(id)arg1;
- (id)configuredAndCompletedConnectionWithSourceObject:(id)arg1;
- (void)showConnectionPopUpController:(id)arg1;
- (long long)runConnectionPopUpControllerModally:(id)arg1;
- (void)insertCodeForConnectionContext:(id)arg1;
- (id)insertOrPrepareToInsertSourceCodeForConnectionContext:(id)arg1 prepareOrInsertBlock:(id)arg2;
- (id)endPointProvider;
- (struct CGPoint)insertionPointInScreenCoordinates;
- (void)setSpringLoadedTraversal:(id)arg1;
- (id)initWithDocument:(id)arg1 connectionContexts:(id)arg2;

@end


text:
angular.module('ngParallaxer', [])
  .directive('ngPlxRoot', ['$window', function($window) {
    return {
      restrict: 'A',
      controller: function() {
        var lastRAF, numCallbacks = 0,
            callbacks = [],
            center = { x: undefined, y: undefined },
            target = { x: undefined, y: undefined },
            actual = { x: undefined, y: undefined };

        var isAttached = false,
            updateTarget, resizeHandler;

        this.register = function(cb) {
          callbacks.push(cb);
          numCallbacks = callbacks.length;
        };

        var smoothing = 20;

        this.setSmoothing = function(val) {
          smoothing = val;
        };

        this.setTargetPercent = function(px,py) {
        	target.x = center.x * 2 * px;
          target.y = center.y * 2 * py;
        };

        this.attachTo = function(elem) {
          if (isAttached) return;
          isAttached = true;

          target.x = actual.x = center.x = elem[0].offsetWidth / 2;
          target.y = actual.y = center.y = elem[0].offsetHeight / 2;

          elem.on("mousemove", updateTarget = function(e) {
            target.x = e.offsetX;
            target.y = e.offsetY;
          });

          $window.addEventListener("deviceorientation", function(e) {
            var gamma = (e.gamma || 0) / 180 + 1;
            var beta = (e.beta || 0) / 180 + 1;
            target.x = gamma * center.x;
            target.y = beta * center.y;
          })

          angular.element($window).on("resize", resizeHandler = function() {
            center.x = elem[0].offsetWidth / 2;
            center.y = elem[0].offsetHeight / 2;
          });

          (function self() {
            actual.x = (target.x + actual.x * smoothing) / (smoothing + 1);
            actual.y = (target.y + actual.y * smoothing) / (smoothing + 1);

            var dx = (actual.x - center.x) / center.x;
            var dy = (actual.y - center.y) / center.y;

            for(var i=0;i<numCallbacks;i++) {
              callbacks[i].call(undefined, dx, dy);
            }

            lastRAF = $window.requestAnimationFrame(self);
          })();
        };

        this.detachFrom = function(elem) {
          elem.off("mousemove", updateTarget);
          $window.off("resize", resizeHandler);
          isAttached = false;
          if(lastRAF) $window.cancelAnimationFrame(lastRAF);
        };
      },
      link: function(scope, elem, attrs, ctrl) {
        ctrl.attachTo(elem);

        var smoothing = scope.$eval(attrs.ngPlxSmoothing);
        if(angular.isUndefined(smoothing)) smoothing = 20;
        ctrl.setSmoothing(smoothing);

        scope.$on('$destory', function() {
          ctrl.detach(scope, elem, attrs);
        });
      }
    };
  }])
  .directive('ngPlxLayer', function() {

  	  var getPropertyName = (function() {
      var actual, possible = [
            'transform',
            'WebkitTransform',
            'MozTransform',
            'OTransform',
            'msTransform'];

      return function(elem) {
        var i = 0;
        while(actual === undefined && i < possible.length) {
          if (elem[0].style[possible[i]] !== undefined) actual = possible[i];
          else i++;
        }
        return actual;
      };
    })();

    return {
      restrict: 'A',
      require: "^^ngPlxRoot",
      link: function(scope, elem, attrs, ctrl) {

        if (!getPropertyName(elem)) return;

        var ax = 0, ay = 0;

        ax = scope.$eval(attrs.ngPlxX);
        ay = scope.$eval(attrs.ngPlxY);

        ctrl.register(function(dx,dy) {

          elem[0].style[getPropertyName()] = "translate3d(" +
            ax * dx + "px, " +
            ay * dy + "px, 0)";
        });
      }
    };
  });

angular.module('parallaxTest', ['ngParallaxer'])
	.directive("autoUpdater", ['$timeout', function($timeout) {

    return {
      restrict: "A",
      require: "^ngPlxRoot",
      link: function(scope, elem, attr, ctrl) {

        var auto = true, cancel, autoUpdater = function() {
          var angle = Math.random() * Math.PI * 2;
          var dist = Math.random() * 0.25 + 0.75;
          ctrl.setTargetPercent(Math.cos(angle) * dist * 0.5 + 0.5, Math.sin(angle) * dist * 0.5 + 0.5);
          if(auto) cancel = $timeout(autoUpdater, 1750);
        };

       	cancel = $timeout(autoUpdater, 100);

        elem.on("mouseover", function() {
          auto = false;
          if(cancel) $timeout.cancel(cancel);
        });
        elem.on("mouseout", function() {
          auto = true;
          cancel = $timeout(autoUpdater, 5000);
        });
      }
    };

  }]);


text: Dir[File.join(File.dirname(__FILE__), '../dishes/provision/*.rb')].sort.each { |lib| require lib }


text:
package net.bitpot.railways.models;

import com.intellij.util.ArrayUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;

/**
 * Container for routes.
 */
public class RouteList extends Vector<Route> {
    // Route name is a key, array of routes with this name is a value.
    // This hash is used for quick lookup in navigation dialogs.
    private final HashMap<String, ArrayList<Route>> namesIndex = new HashMap<>();

    @Override
    public void clear() {
        super.clear();
        namesIndex.clear();
    }

    /**
     * Returns an array of routes that have specified name. As several routes can have the same name (they
     * can differ by method - POST, GET, etc.) the method can return arrays with several elements.
     *
     * @param name Route name to search
     * @return Array of routes or empty route array if nothing is found.
     */
    public Route[] getRoutesByName(String name) {
        if (namesIndex.size() == 0)
            reindexRouteNames();

        List<Route> value = namesIndex.get(name);
        if (value == null)
            return new Route[0];

        return ArrayUtil.toObjectArray(value, Route.class);
    }

    /**
     * Performs route names reindex.
     */
    private void reindexRouteNames() {
        namesIndex.clear();

        for (Route route : this) {
            // As we do not use null as value, we can skip checking existence of the key
            ArrayList<Route> value = namesIndex.computeIfAbsent(route.getName(),
                    k -> new ArrayList<>());

            value.add(route);
        }
    }
}


text:
using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds;
using Microsoft.SharePoint.Client;
using System.Management.Automation;
using OfficeDevPnP.PowerShell.CmdletHelpAttributes;

namespace OfficeDevPnP.PowerShell.Commands
{
    [Cmdlet(VerbsCommon.Add, "SPOEventReceiver")]
    [CmdletHelp("Adds a new event receiver",
        Category = CmdletHelpCategory.EventReceivers)]
    [CmdletExample(
      Code = @"PS:> Add-SPOEventReceiver -List ""ProjectList"" -Name ""TestEventReceiver"" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType ItemAdded -Synchronization Asynchronous",
      Remarks = @"This will add a new event receiver that is executed after an item has been added to the ProjectList list", SortOrder = 1)]
    public class AddEventReceiver : SPOWebCmdlet
    {
        [Parameter(Mandatory = false)]
        public ListPipeBind List;

        [Parameter(Mandatory = true)]
        public string Name;

        [Parameter(Mandatory = true)]
        public string Url;

        [Parameter(Mandatory = true)]
        [Alias("Type")]
        public EventReceiverType EventReceiverType;

        [Parameter(Mandatory = true)]
        [Alias("Sync")]
        public EventReceiverSynchronization Synchronization;

        [Parameter(Mandatory = false)]
        public int SequenceNumber = 1000;

        [Parameter(Mandatory = false)]
        public SwitchParameter Force;

        protected override void ExecuteCmdlet()
        {
            if (this.MyInvocation.BoundParameters.ContainsKey("List"))
            {
                var list = List.GetList(SelectedWeb);
                WriteObject(list.AddRemoteEventReceiver(Name, Url, EventReceiverType, Synchronization, SequenceNumber, Force));
            }
            else
            {
                WriteObject(SelectedWeb.AddRemoteEventReceiver(Name, Url, EventReceiverType, Synchronization, SequenceNumber, Force));
            }

        }

    }

}


text:
struct FrameInfo {

  sf::Vector2f tex_coords[4];
  sf::Vector2f frame_size[4];
  sf::FloatRect local_bounds;
};

class Animation
{
public:
  Animation(const sf::Texture* tex=NULL);

  template <typename T>
  void addFrameRect(const sf::Rect<T> rect);
  void addFrame(const std::vector<sf::Vector2f>& points);
  void setSpriteSheet(const sf::Texture& texture);
  const sf::Texture* getSpriteSheet() const;
  std::size_t getSize() const;
  const FrameInfo& getFrame(std::size_t n) const;

private:
  std::vector<FrameInfo> m_frames;
  const sf::Texture* m_texture;
};

#endif // ANIMATION_INCLUDE


text:
#ifndef ROUTER_INPUTOUTPUTQUEUED_OUTPUTQUEUE_H_
#define ROUTER_INPUTOUTPUTQUEUED_OUTPUTQUEUE_H_

#include <prim/prim.h>

#include <string>
#include <queue>
#include <vector>

#include "event/Component.h"
#include "architecture/Crossbar.h"
#include "architecture/CrossbarScheduler.h"
#include "types/Flit.h"
#include "types/FlitReceiver.h"

namespace InputOutputQueued {

class Router;

class OutputQueue : public Component, public FlitReceiver,
                    public CrossbarScheduler::Client {
 public:
  OutputQueue(const std::string& _name, const Component* _parent,
              u32 _depth, u32 _port, u32 _vc,
              CrossbarScheduler* _outputCrossbarScheduler,
              u32 _crossbarSchedulerIndex,
              Crossbar* _crossbar, u32 _crossbarIndex,
              CrossbarScheduler* _mainCrossbarScheduler,
              u32 _mainCrossbarVcId);
  ~OutputQueue();

  // called by main router crossbar
  void receiveFlit(u32 _port, Flit* _flit) override;

  // event system (Component)
  void processEvent(void* _event, s32 _type) override;

  // response from CrossbarScheduler
  void crossbarSchedulerResponse(u32 _port, u32 _vc) override;

 private:
  void setPipelineEvent();
  void processPipeline();

  // attributes
  const u32 depth_;
  const u32 port_;
  const u32 vc_;

  // external devices
  CrossbarScheduler* outputCrossbarScheduler_;
  const u32 crossbarSchedulerIndex_;
  Crossbar* crossbar_;
  const u32 crossbarIndex_;
  CrossbarScheduler* mainCrossbarScheduler_;
  const u32 mainCrossbarVcId_;

  // single flit per clock input limit assurance
  u64 lastReceivedTime_;

  // state machine to represent a generic pipeline stage
  enum class ePipelineFsm { kEmpty, kWaitingToRequest, kWaitingForResponse,
      kReadyToAdvance };

  // remembers if an event is set to process the pipeline
  u64 eventTime_;

  // The following variables represent the pipeline registers

  // buffer
  std::queue<Flit*> buffer_;  // insertion time & inserted flit

  // Switch allocation [swa_] pipeline stage
  struct {
    ePipelineFsm fsm;
    Flit* flit;
  } swa_;

  // Crossbar traversal [xtr_] stage (no state needed)
};

}  // namespace InputOutputQueued

#endif  // ROUTER_INPUTOUTPUTQUEUED_OUTPUTQUEUE_H_


text:
namespace ApplicationGateway.Models
{
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// The network resource topology information for the given resource group.
    /// </summary>
    public partial class TopologyResource
    {
        /// <summary>
        /// Initializes a new instance of the TopologyResource class.
        /// </summary>
        public TopologyResource()
        {
          CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the TopologyResource class.
        /// </summary>
        /// <param name="name">Name of the resource.</param>
        /// <param name="id">ID of the resource.</param>
        /// <param name="location">Resource location.</param>
        /// <param name="associations">Holds the associations the resource has
        /// with other resources in the resource group.</param>
        public TopologyResource(string name = default(string), string id = default(string), string location = default(string), IList<TopologyAssociation> associations = default(IList<TopologyAssociation>))
        {
            Name = name;
            Id = id;
            Location = location;
            Associations = associations;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets name of the resource.
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets ID of the resource.
        /// </summary>
        [JsonProperty(PropertyName = "id")]
        public string Id { get; set; }

        /// <summary>
        /// Gets or sets resource location.
        /// </summary>
        [JsonProperty(PropertyName = "location")]
        public string Location { get; set; }

        /// <summary>
        /// Gets or sets holds the associations the resource has with other
        /// resources in the resource group.
        /// </summary>
        [JsonProperty(PropertyName = "associations")]
        public IList<TopologyAssociation> Associations { get; set; }

    }
}


text:
  There never was, there never will be, nor is there now, a man who
  is always blamed, or a man who is always praised. 228


text:
create table user (
    id text primary key not null,
    created_at text not null,
    updated_at text not null,
    username text not null unique,
    full_name text
);


text:
title: Résumé
ignore_auto_md: true
---

<md>

## Experience

### UX Designer at [Indiana University](https://uits.iu.edu/)

<time datetime="2012-07">July 2012</time> – Present
·
Bloomington, Indiana

Worked in cross-functional Agile teams to build enterprise products for students, advisors, and faculty.
Conducted user research and analysis.
Produced sketches, wireframes, and prototypes.
Developed front-end production code.
Contributed to the [university design system](https://rivet.iu.edu/) and various development standards.
Trained coworkers regarding design and front-end development practices.
Experimented with technologies and techniques via proof-of-concepts.
Facilitated design community meetings.

### Co-organizer of [IxDA Bloomington](https://www.facebook.com/ixdabloomington)

<time datetime="2013-05">May 2013</time> – <time datetime="2016-10">October 2016</time>
·
Bloomington, Indiana

Organized twice-monthly topical and networking events for the local chapter of
[IxDA](https://ixda.org 'Interaction Design Association').

### Co-founder of BitHouse Design

<time datetime="2011-09">September 2011</time> – <time datetime="2012-09">September 2012</time>
·
Bloomington, Indiana

Produced a web and mobile service (Rundwn) for providing coordinators,
runners, and spectators of long-distance races with real-time event results.

### UX Design Intern at [LexisNexis](https://www.lexisnexis.com)

<time datetime="2010-05">May</time> – <time datetime="2010-08">August 2010</time>
·
Dayton, Ohio

Designed interactive visualization prototypes
for search products. [Co-invented a patent](https://www.google.com/patents/US8874569) for visualizing the presence of search terms across a set of documents.

### Multimedia Developer Intern at [IUPUI Pervasive Technology Labs](https://pti.iu.edu/)

<time datetime="2008-09">September 2008</time> – <time datetime="2009-05">May 2009</time>
·
Indianapolis, Indiana

Researched and developed motion, color, and symbol tracking algorithms to explore
the limits of video processing and analysis in ActionScript 3.

### Web Developer Volunteer at [Lakeview Church](http://www.lakeviewchurch.org)

<time datetime="2007-01">January 2007</time> – <time datetime="2009-05">May 2009</time>
·
Indianapolis, Indiana

Converted content management system to WordPress.
Developed WordPress themes and Flash podcast player.
Assisted with various network administration activities.

### Web Developer Intern at A Beautiful Question

<time datetime="2008-01">January</time> – <time datetime="2008-05">May 2008</time>
·
Indianapolis, Indiana

Collaborated with clients to develop WordPress themes and Adobe AIR
applications.

## Education

### M.S. [Human-Computer Interaction Design](https://www.sice.indiana.edu/graduate/degrees/informatics/hcid/)

<time datetime="2011-06">June 2011</time>
·
[Indiana University](https://iu.edu),
Bloomington, Indiana

### B.S. [Media Arts & Sciences](https://soic.iupui.edu/undergraduate/degrees/media-arts/)

<time datetime="2009-05">May 2009</time>
·
[IUPUI](https://iupui.edu),
Indianapolis, Indiana

Summa Cum Laude,
General Honors

### Minor [Computer & Information Science](https://cs.iupui.edu)

<time datetime="2009-05">May 2009</time>
·
[IUPUI](https://iupui.edu),
Indianapolis, Indiana

</md>

<md>

## Team skills

- Agile Scrum
- Lean UX

## Design skills

- Prototyping ([Axure](https://www.axure.com/), paper)
- Accessibility ([ARIA](https://www.w3.org/TR/html-aria/))
- Responsive, mobile-first design
- User research (exploratory, evaluative) and analysis

## Development skills

- HTML and CSS ([BEM](/talks/architecting-css/ 'Block Element Modifier'), [Less.js](http://lesscss.org/))
- JavaScript and [Node.js](https://nodejs.org/)
- Libraries ([RxJS](https://github.com/ReactiveX/rxjs), [React](https://facebook.github.io/react/), [Webpack](https://webpack.github.io/))
- Version control ([Git](https://git-scm.com/))

***

[Download Résumé (PDF)](/basham-resume.pdf)

</md>


text:
/**
 * (C) 2008, ICZ, a.s.
 * Package: cz.i.cis.dbutils.conn Created: 2.7.2008 Author: dmatej
 */
package org.jdbc.adapter.jdbc42;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.NClob;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Map;
import java.util.logging.Logger;

import org.jdbc.adapter.iface.ResultSetWrapper;
import org.jdbc.adapter.iface.StatementWrapper;

/**
 * Basic result set wrapper.
 *
 * @author David Matejcek
 */
public class Jdbc42ResultSet implements ResultSetWrapper {
  private static final Logger LOG = Logger.getLogger(Jdbc42ResultSet.class.getName());

  private final ResultSet resultSet;
  private final StatementWrapper parentStatement;

  /**
   * @param resultSet
   * @param parentStatement
   */
  public Jdbc42ResultSet(final ResultSet resultSet, final StatementWrapper parentStatement) {
    LOG.entering(getClass().getSimpleName(), "Jdbc42ResultSet", new Object[]{resultSet, parentStatement});
    this.resultSet = resultSet;
    this.parentStatement = parentStatement;
  }

  /**
   * @return wrapped resultSet
   */
  protected final ResultSet getResultSet() {
    return this.resultSet;
  }

  @Override
  public Statement getStatement() throws SQLException {
    if (isClosed()) {
      throw new SQLException("The result set is already closed.");
    }
    return this.parentStatement;
  }

  @Override
  public boolean isWrapperFor(final Class<?> iface) throws SQLException {
    return iface.isInstance(this) || iface.isInstance(this.resultSet) || this.resultSet.isWrapperFor(iface);
  }

  @Override
  public <T> T unwrap(final Class<T> iface) throws SQLException {
    if (iface.isInstance(this)) {
      return iface.cast(this);
    }
    if (iface.isInstance(this.resultSet)) {
      return iface.cast(this.resultSet);
    }
    return this.resultSet.unwrap(iface);
  }

  @Override
  public boolean absolute(int row) throws SQLException {
    return this.resultSet.absolute(row);
  }

  @Override
  public void afterLast() throws SQLException {
    this.resultSet.afterLast();
  }

  @Override
  public void beforeFirst() throws SQLException {
    this.resultSet.beforeFirst();
  }

  @Override
  public void cancelRowUpdates() throws SQLException {
    this.resultSet.cancelRowUpdates();
  }

  @Override
  public void clearWarnings() throws SQLException {
    this.resultSet.clearWarnings();
  }

  @Override
  public void close() throws SQLException {
    this.resultSet.close();
  }

  @Override
  public void deleteRow() throws SQLException {
    this.resultSet.deleteRow();
  }

  @Override
  public int findColumn(String columnName) throws SQLException {
    return this.resultSet.findColumn(columnName);
  }

  @Override
  public boolean first() throws SQLException {
    return this.resultSet.first();
  }

  @Override
  public Array getArray(int i) throws SQLException {
    return this.resultSet.getArray(i);
  }

  @Override
  public Array getArray(String colName) throws SQLException {
    return this.resultSet.getArray(colName);
  }

  @Override
  public InputStream getAsciiStream(int columnIndex) throws SQLException {
    return this.resultSet.getAsciiStream(columnIndex);
  }

  @Override
  public InputStream getAsciiStream(String columnName) throws SQLException {
    return this.resultSet.getAsciiStream(columnName);
  }

  @Override
  public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
    return this.resultSet.getBigDecimal(columnIndex);
  }

  @Override
  public BigDecimal getBigDecimal(String columnName) throws SQLException {
    return this.resultSet.getBigDecimal(columnName);
  }

  @Override
  @SuppressWarnings("deprecation")
  @Deprecated
  public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
    return this.resultSet.getBigDecimal(columnIndex, scale);
  }

  @Override
  @SuppressWarnings("deprecation")
  @Deprecated
  public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
    return this.resultSet.getBigDecimal(columnName, scale);
  }

  @Override
  public InputStream getBinaryStream(int columnIndex) throws SQLException {
    return this.resultSet.getBinaryStream(columnIndex);
  }

  @Override
  public InputStream getBinaryStream(String columnName) throws SQLException {
    return this.resultSet.getBinaryStream(columnName);
  }

  @Override
  public Blob getBlob(int i) throws SQLException {
    return this.resultSet.getBlob(i);
  }

  @Override
  public Blob getBlob(String colName) throws SQLException {
    return this.resultSet.getBlob(colName);
  }

  @Override
  public boolean getBoolean(int columnIndex) throws SQLException {
    return this.resultSet.getBoolean(columnIndex);
  }

  @Override
  public boolean getBoolean(String columnName) throws SQLException {
    return this.resultSet.getBoolean(columnName);
  }

  @Override
  public byte getByte(int columnIndex) throws SQLException {
    return this.resultSet.getByte(columnIndex);
  }

  @Override
  public byte getByte(String columnName) throws SQLException {
    return this.resultSet.getByte(columnName);
  }

  @Override
  public byte[] getBytes(int columnIndex) throws SQLException {
    return this.resultSet.getBytes(columnIndex);
  }

  @Override
  public byte[] getBytes(String columnName) throws SQLException {
    return this.resultSet.getBytes(columnName);
  }

  @Override
  public Reader getCharacterStream(int columnIndex) throws SQLException {
    return this.resultSet.getCharacterStream(columnIndex);
  }

  @Override
  public Reader getCharacterStream(String columnName) throws SQLException {
    return this.resultSet.getCharacterStream(columnName);
  }

  @Override
  public Clob getClob(int i) throws SQLException {
    return this.resultSet.getClob(i);
  }

  @Override
  public Clob getClob(String colName) throws SQLException {
    return this.resultSet.getClob(colName);
  }

  @Override
  public int getConcurrency() throws SQLException {
    return this.resultSet.getConcurrency();
  }

  @Override
  public String getCursorName() throws SQLException {
    return this.resultSet.getCursorName();
  }

  @Override
  public Date getDate(int columnIndex) throws SQLException {
    return this.resultSet.getDate(columnIndex);
  }

  @Override
  public Date getDate(String columnName) throws SQLException {
    return this.resultSet.getDate(columnName);
  }

  @Override
  public Date getDate(int columnIndex, Calendar cal) throws SQLException {
    return this.resultSet.getDate(columnIndex, cal);
  }

  @Override
  public Date getDate(String columnName, Calendar cal) throws SQLException {
    return this.resultSet.getDate(columnName, cal);
  }

  @Override
  public double getDouble(int columnIndex) throws SQLException {
    return this.resultSet.getDouble(columnIndex);
  }

  @Override
  public double getDouble(String columnName) throws SQLException {
    return this.resultSet.getDouble(columnName);
  }

  @Override
  public int getFetchDirection() throws SQLException {
    return this.resultSet.getFetchDirection();
  }

  @Override
  public int getFetchSize() throws SQLException {
    return this.resultSet.getFetchSize();
  }

  @Override
  public float getFloat(int columnIndex) throws SQLException {
    return this.resultSet.getFloat(columnIndex);
  }

  @Override
  public float getFloat(String columnName) throws SQLException {
    return this.resultSet.getFloat(columnName);
  }

  @Override
  public int getInt(int columnIndex) throws SQLException {
    return this.resultSet.getInt(columnIndex);
  }

  @Override
  public int getInt(String columnName) throws SQLException {
    return this.resultSet.getInt(columnName);
  }

  @Override
  public long getLong(int columnIndex) throws SQLException {
    return this.resultSet.getLong(columnIndex);
  }

  @Override
  public long getLong(String columnName) throws SQLException {
    return this.resultSet.getLong(columnName);
  }

  @Override
  public ResultSetMetaData getMetaData() throws SQLException {
    return this.resultSet.getMetaData();
  }

  @Override
  public Object getObject(int columnIndex) throws SQLException {
    return this.resultSet.getObject(columnIndex);
  }

  @Override
  public Object getObject(String columnName) throws SQLException {
    return this.resultSet.getObject(columnName);
  }

  @Override
  public Object getObject(int i, Map<String, Class<?>> map) throws SQLException {
    return this.resultSet.getObject(i, map);
  }

  @Override
  public Object getObject(String colName, Map<String, Class<?>> map) throws SQLException {
    return this.resultSet.getObject(colName, map);
  }

  @Override
  public Ref getRef(int i) throws SQLException {
    return this.resultSet.getRef(i);
  }

  @Override
  public Ref getRef(String colName) throws SQLException {
    return this.resultSet.getRef(colName);
  }

  @Override
  public int getRow() throws SQLException {
    return this.resultSet.getRow();
  }

  @Override
  public short getShort(int columnIndex) throws SQLException {
    return this.resultSet.getShort(columnIndex);
  }

  @Override
  public short getShort(String columnName) throws SQLException {
    return this.resultSet.getShort(columnName);
  }

  @Override
  public String getString(int columnIndex) throws SQLException {
    return this.resultSet.getString(columnIndex);
  }

  @Override
  public String getString(String columnName) throws SQLException {
    return this.resultSet.getString(columnName);
  }

  @Override
  public Time getTime(int columnIndex) throws SQLException {
    return this.resultSet.getTime(columnIndex);
  }

  @Override
  public Time getTime(String columnName) throws SQLException {
    return this.resultSet.getTime(columnName);
  }

  @Override
  public Time getTime(int columnIndex, Calendar cal) throws SQLException {
    return this.resultSet.getTime(columnIndex, cal);
  }

  @Override
  public Time getTime(String columnName, Calendar cal) throws SQLException {
    return this.resultSet.getTime(columnName, cal);
  }

  @Override
  public Timestamp getTimestamp(int columnIndex) throws SQLException {
    return this.resultSet.getTimestamp(columnIndex);
  }

  @Override
  public Timestamp getTimestamp(String columnName) throws SQLException {
    return this.resultSet.getTimestamp(columnName);
  }

  @Override
  public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
    return this.resultSet.getTimestamp(columnIndex, cal);
  }

  @Override
  public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException {
    return this.resultSet.getTimestamp(columnName, cal);
  }

  @Override
  public int getType() throws SQLException {
    return this.resultSet.getType();
  }

  @Override
  public URL getURL(int columnIndex) throws SQLException {
    return this.resultSet.getURL(columnIndex);
  }

  @Override
  public URL getURL(String columnName) throws SQLException {
    return this.resultSet.getURL(columnName);
  }

  @Override
  @SuppressWarnings("deprecation")
  @Deprecated
  public InputStream getUnicodeStream(int columnIndex) throws SQLException {
    return this.resultSet.getUnicodeStream(columnIndex);
  }

  @Override
  @SuppressWarnings("deprecation")
  @Deprecated
  public InputStream getUnicodeStream(String columnName) throws SQLException {
    return this.resultSet.getUnicodeStream(columnName);
  }

  @Override
  public SQLWarning getWarnings() throws SQLException {
    return this.resultSet.getWarnings();
  }

  @Override
  public void insertRow() throws SQLException {
    this.resultSet.insertRow();
  }

  @Override
  public boolean isAfterLast() throws SQLException {
    return this.resultSet.isAfterLast();
  }

  @Override
  public boolean isBeforeFirst() throws SQLException {
    return this.resultSet.isBeforeFirst();
  }

  @Override
  public boolean isFirst() throws SQLException {
    return this.resultSet.isFirst();
  }

  @Override
  public boolean isLast() throws SQLException {
    return this.resultSet.isLast();
  }

  @Override
  public boolean last() throws SQLException {
    return this.resultSet.last();
  }

  @Override
  public void moveToCurrentRow() throws SQLException {
    this.resultSet.moveToCurrentRow();
  }

  @Override
  public void moveToInsertRow() throws SQLException {
    this.resultSet.moveToInsertRow();
  }

  @Override
  public boolean next() throws SQLException {
    return this.resultSet.next();
  }

  @Override
  public boolean previous() throws SQLException {
    return this.resultSet.previous();
  }

  @Override
  public void refreshRow() throws SQLException {
    this.resultSet.refreshRow();
  }

  @Override
  public boolean relative(int rows) throws SQLException {
    return this.resultSet.relative(rows);
  }

  @Override
  public boolean rowDeleted() throws SQLException {
    return this.resultSet.rowDeleted();
  }

  @Override
  public boolean rowInserted() throws SQLException {
    return this.resultSet.rowInserted();
  }

  @Override
  public boolean rowUpdated() throws SQLException {
    return this.resultSet.rowUpdated();
  }

  @Override
  public void setFetchDirection(int direction) throws SQLException {
    this.resultSet.setFetchDirection(direction);
  }

  @Override
  public void setFetchSize(int rows) throws SQLException {
    this.resultSet.setFetchSize(rows);
  }

  @Override
  public void updateArray(int columnIndex, Array x) throws SQLException {
    this.resultSet.updateArray(columnIndex, x);
  }

  @Override
  public void updateArray(String columnName, Array x) throws SQLException {
    this.resultSet.updateArray(columnName, x);
  }

  @Override
  public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
    this.resultSet.updateAsciiStream(columnIndex, x, length);
  }

  @Override
  public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException {
    this.resultSet.updateAsciiStream(columnName, x, length);
  }

  @Override
  public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
    this.resultSet.updateBigDecimal(columnIndex, x);
  }

  @Override
  public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException {
    this.resultSet.updateBigDecimal(columnName, x);
  }

  @Override
  public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
    this.resultSet.updateBinaryStream(columnIndex, x, length);
  }

  @Override
  public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException {
    this.resultSet.updateBinaryStream(columnName, x, length);
  }

  @Override
  public void updateBlob(int columnIndex, Blob x) throws SQLException {
    this.resultSet.updateBlob(columnIndex, x);
  }

  @Override
  public void updateBlob(String columnName, Blob x) throws SQLException {
    this.resultSet.updateBlob(columnName, x);
  }

  @Override
  public void updateBoolean(int columnIndex, boolean x) throws SQLException {
    this.resultSet.updateBoolean(columnIndex, x);
  }

  @Override
  public void updateBoolean(String columnName, boolean x) throws SQLException {
    this.resultSet.updateBoolean(columnName, x);
  }

  @Override
  public void updateByte(int columnIndex, byte x) throws SQLException {
    this.resultSet.updateByte(columnIndex, x);
  }

  @Override
  public void updateByte(String columnName, byte x) throws SQLException {
    this.resultSet.updateByte(columnName, x);
  }

  @Override
  public void updateBytes(int columnIndex, byte[] x) throws SQLException {
    this.resultSet.updateBytes(columnIndex, x);
  }

  @Override
  public void updateBytes(String columnName, byte[] x) throws SQLException {
    this.resultSet.updateBytes(columnName, x);
  }

  @Override
  public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
    this.resultSet.updateCharacterStream(columnIndex, x, length);
  }

  @Override
  public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException {
    this.resultSet.updateCharacterStream(columnName, reader, length);
  }

  @Override
  public void updateClob(int columnIndex, Clob x) throws SQLException {
    this.resultSet.updateClob(columnIndex, x);
  }

  @Override
  public void updateClob(String columnName, Clob x) throws SQLException {
    this.resultSet.updateClob(columnName, x);
  }

  @Override
  public void updateDate(int columnIndex, Date x) throws SQLException {
    this.resultSet.updateDate(columnIndex, x);
  }

  @Override
  public void updateDate(String columnName, Date x) throws SQLException {
    this.resultSet.updateDate(columnName, x);
  }

  @Override
  public void updateDouble(int columnIndex, double x) throws SQLException {
    this.resultSet.updateDouble(columnIndex, x);
  }

  @Override
  public void updateDouble(String columnName, double x) throws SQLException {
    this.resultSet.updateDouble(columnName, x);
  }

  @Override
  public void updateFloat(int columnIndex, float x) throws SQLException {
    this.resultSet.updateFloat(columnIndex, x);
  }

  @Override
  public void updateFloat(String columnName, float x) throws SQLException {
    this.resultSet.updateFloat(columnName, x);
  }

  @Override
  public void updateInt(int columnIndex, int x) throws SQLException {
    this.resultSet.updateInt(columnIndex, x);
  }

  @Override
  public void updateInt(String columnName, int x) throws SQLException {
    this.resultSet.updateInt(columnName, x);
  }

  @Override
  public void updateLong(int columnIndex, long x) throws SQLException {
    this.resultSet.updateLong(columnIndex, x);
  }

  @Override
  public void updateLong(String columnName, long x) throws SQLException {
    this.resultSet.updateLong(columnName, x);
  }

  @Override
  public void updateNull(int columnIndex) throws SQLException {
    this.resultSet.updateNull(columnIndex);
  }

  @Override
  public void updateNull(String columnName) throws SQLException {
    this.resultSet.updateNull(columnName);
  }

  @Override
  public void updateObject(int columnIndex, Object x) throws SQLException {
    this.resultSet.updateObject(columnIndex, x);
  }

  @Override
  public void updateObject(String columnName, Object x) throws SQLException {
    this.resultSet.updateObject(columnName, x);
  }

  @Override
  public void updateObject(int columnIndex, Object x, int scale) throws SQLException {
    this.resultSet.updateObject(columnIndex, x, scale);
  }

  @Override
  public void updateObject(String columnName, Object x, int scale) throws SQLException {
    this.resultSet.updateObject(columnName, x, scale);
  }

  @Override
  public void updateRef(int columnIndex, Ref x) throws SQLException {
    this.resultSet.updateRef(columnIndex, x);
  }

  @Override
  public void updateRef(String columnName, Ref x) throws SQLException {
    this.resultSet.updateRef(columnName, x);
  }

  @Override
  public void updateRow() throws SQLException {
    this.resultSet.updateRow();
  }

  @Override
  public void updateShort(int columnIndex, short x) throws SQLException {
    this.resultSet.updateShort(columnIndex, x);
  }

  @Override
  public void updateShort(String columnName, short x) throws SQLException {
    this.resultSet.updateShort(columnName, x);
  }

  @Override
  public void updateString(int columnIndex, String x) throws SQLException {
    this.resultSet.updateString(columnIndex, x);
  }

  @Override
  public void updateString(String columnName, String x) throws SQLException {
    this.resultSet.updateString(columnName, x);
  }

  @Override
  public void updateTime(int columnIndex, Time x) throws SQLException {
    this.resultSet.updateTime(columnIndex, x);
  }

  @Override
  public void updateTime(String columnName, Time x) throws SQLException {
    this.resultSet.updateTime(columnName, x);
  }

  @Override
  public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
    this.resultSet.updateTimestamp(columnIndex, x);
  }

  @Override
  public void updateTimestamp(String columnName, Timestamp x) throws SQLException {
    this.resultSet.updateTimestamp(columnName, x);
  }

  @Override
  public boolean wasNull() throws SQLException {
    return this.resultSet.wasNull();
  }

  @Override
  public int getHoldability() throws SQLException {
    return this.resultSet.getHoldability();
  }

  @Override
  public Reader getNCharacterStream(int columnIndex) throws SQLException {
    return this.resultSet.getNCharacterStream(columnIndex);
  }

  @Override
  public Reader getNCharacterStream(String columnLabel) throws SQLException {
    return this.resultSet.getNCharacterStream(columnLabel);
  }

  @Override
  public NClob getNClob(int columnIndex) throws SQLException {
    return this.resultSet.getNClob(columnIndex);
  }

  @Override
  public NClob getNClob(String columnLabel) throws SQLException {
    return this.resultSet.getNClob(columnLabel);
  }

  @Override
  public String getNString(int columnIndex) throws SQLException {
    return this.resultSet.getNString(columnIndex);
  }

  @Override
  public String getNString(String columnLabel) throws SQLException {
    return this.resultSet.getNString(columnLabel);
  }

  @Override
  public RowId getRowId(int columnIndex) throws SQLException {
    return this.resultSet.getRowId(columnIndex);
  }

  @Override
  public RowId getRowId(String columnLabel) throws SQLException {
    return this.resultSet.getRowId(columnLabel);
  }

  @Override
  public SQLXML getSQLXML(int columnIndex) throws SQLException {
    return this.resultSet.getSQLXML(columnIndex);
  }

  @Override
  public SQLXML getSQLXML(String columnLabel) throws SQLException {
    return this.resultSet.getSQLXML(columnLabel);
  }

  @Override
  public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
    return resultSet.getObject(columnIndex, type);
  }

  @Override
  public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
    return resultSet.getObject(columnLabel, type);
  }

  @Override
  public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
    this.resultSet.updateAsciiStream(columnIndex, x);
  }

  @Override
  public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
    this.resultSet.updateAsciiStream(columnLabel, x);
  }

  @Override
  public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
    this.resultSet.updateAsciiStream(columnIndex, x, length);
  }

  @Override
  public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
    this.resultSet.updateAsciiStream(columnLabel, x, length);
  }

  @Override
  public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
    this.resultSet.updateBinaryStream(columnIndex, x);
  }

  @Override
  public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
    this.resultSet.updateBinaryStream(columnLabel, x);
  }

  @Override
  public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
    this.resultSet.updateBinaryStream(columnIndex, x, length);
  }

  @Override
  public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
    this.resultSet.updateBinaryStream(columnLabel, x, length);
  }

  @Override
  public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
    this.resultSet.updateBlob(columnIndex, inputStream);
  }

  @Override
  public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
    this.resultSet.updateBlob(columnLabel, inputStream);
  }

  @Override
  public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
    this.resultSet.updateBlob(columnIndex, inputStream, length);
  }

  @Override
  public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
    this.resultSet.updateBlob(columnLabel, inputStream, length);
  }

  @Override
  public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
    this.resultSet.updateCharacterStream(columnIndex, x);
  }

  @Override
  public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
    this.resultSet.updateCharacterStream(columnLabel, reader);
  }

  @Override
  public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
    this.resultSet.updateCharacterStream(columnIndex, x, length);
  }

  @Override
  public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
    this.resultSet.updateCharacterStream(columnLabel, reader, length);
  }

  @Override
  public void updateClob(int columnIndex, Reader reader) throws SQLException {
    this.resultSet.updateClob(columnIndex, reader);
  }

  @Override
  public void updateClob(String columnLabel, Reader reader) throws SQLException {
    this.resultSet.updateClob(columnLabel, reader);
  }

  @Override
  public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
    this.resultSet.updateClob(columnIndex, reader, length);
  }

  @Override
  public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
    this.resultSet.updateClob(columnLabel, reader, length);
  }

  @Override
  public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
    this.resultSet.updateNCharacterStream(columnIndex, x);
  }

  @Override
  public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
    this.resultSet.updateNCharacterStream(columnLabel, reader);
  }

  @Override
  public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
    this.resultSet.updateNCharacterStream(columnIndex, x, length);
  }

  @Override
  public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
    this.resultSet.updateNCharacterStream(columnLabel, reader, length);
  }

  @Override
  public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
    this.resultSet.updateNClob(columnIndex, nClob);
  }

  @Override
  public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
    this.resultSet.updateNClob(columnLabel, nClob);
  }

  @Override
  public void updateNClob(int columnIndex, Reader reader) throws SQLException {
    this.resultSet.updateNClob(columnIndex, reader);
  }

  @Override
  public void updateNClob(String columnLabel, Reader reader) throws SQLException {
    this.resultSet.updateNClob(columnLabel, reader);
  }

  @Override
  public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
    this.resultSet.updateNClob(columnIndex, reader, length);
  }

  @Override
  public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
    this.resultSet.updateNClob(columnLabel, reader, length);
  }

  @Override
  public void updateNString(int columnIndex, String nString) throws SQLException {
    this.resultSet.updateNString(columnIndex, nString);
  }

  @Override
  public void updateNString(String columnLabel, String nString) throws SQLException {
    this.resultSet.updateNString(columnLabel, nString);
  }

  @Override
  public void updateRowId(int columnIndex, RowId x) throws SQLException {
    this.resultSet.updateRowId(columnIndex, x);
  }

  @Override
  public void updateRowId(String columnLabel, RowId x) throws SQLException {
    this.resultSet.updateRowId(columnLabel, x);
  }

  @Override
  public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
    this.resultSet.updateSQLXML(columnIndex, xmlObject);
  }

  @Override
  public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
    this.resultSet.updateSQLXML(columnLabel, xmlObject);
  }

  @Override
  public boolean isClosed() throws SQLException {
    return this.resultSet.isClosed();
  }

  @Override
  public int hashCode() {
    return this.resultSet.hashCode();
  }
}


text:
/**
 * jquery Main Data
 * Description: 目前主要用于处理json格式的enum
 * Author: wangsy
 * Date  : 2015-04-15
 * Update: 2015-04-15
 *===============================================================================
 * 一、功能说明:
 * 1. 管理前台枚举值的数据
 *
 * 二、使用参考:
 * 1. 依赖 jQuery
 * 2. 引入插件js: main-data.js
 * 3. 初始化插件
 *        var main_data = new MAINDATA({
 * 			ajaxFlag : true,
 * 			enumUrl : '/view/demo/maindata/mockData.jsp'
 * 		});
 * 4. 方法参考:
 *    添加enum : main_data.addEnum('test', [{value : 'v1', text : 't1'}]);
 *    查询enum : main_data.getEnum('test');
 *    查询text : main_data.getEnumText('test', 'v1');
 *
 *===============================================================================
 *
 ********************************************************************************/
(function ($) {
    var thisTool = Dolphin;
    function ENUM(param) {
        this.init(param);
    }
    ENUM.defaults = {
        //enum
        valueField: "code",									  //枚举code label
              textField: "name",									  //枚举值 label
        otherField: "other",								   	  //枚举附加属性 label

        //cookie
        cookieFlag : false,                                     //是否支持cookie

        //ajax
        ajaxFlag: false,							   		       //是否支持远程
        enumUrl: null,						     				   //远程url
        enumTextUrl: null,									   //远程取值url
        async: false,					 				           //是否默认异步
        type: "get",					                 		   //默认请求方法
        dataType: "json",									       //默认数据类型
        //contentType: "application/json; charset=UTF-8",	   //默认contentType
        cache: false,									           //默认ajax是否缓存
        enumKey: "id",								               //默认提交参数enumId名称
        enumNameKey: "enumOptionId",						   //默认提交参数enumOptionId名称
        ajax: thisTool.ajax,							           //默认ajax方法
        enumCache: true,										   //ajax请求结果是否缓存到前台
        dataFilter : null                                       //数据处理
    };

    ENUM.prototype = {
        /* ==================== property ================= */
        constructor: ENUM,
        enumData: {},															//前台缓存枚举数据
        enumType: {															//前台创建枚举类型
            lowerCase: "abcdefghijklmnopqrstuvwxyz",
            upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        },

        /* ===================== method ================== */
        init: function (param) {
            this.opts = $.extend({}, ENUM.defaults, param);

            if (this.opts.ajaxFlag) {
                if (this.opts.enumTextUrl == null) {
                    this.opts.enumTextUrl = this.opts.enumUrl;
                }
            }
        },
        addEnumType: function (name, data) {
            this.enumType[name] = data;
        },

        //add enum
        addEnum: function (name, data) {
            this.enumData[name] = data;
        },
        createEnum: function (name, data, type, start) {
            //init param
            if (typeof data == 'string') {
                data = data.split(',');
            }
            type = type || 'number';
            start = start || 0;

            //init start index
            var indexValue = start;
            if (type != 'number') {
                indexValue = this.enumType[type].indexOf(start);
                if (indexValue < 0) {
                    indexValue = 0;
                }
            }

            //enumData
            var enumData = [];
            var value = null;
            var enumOption = null;
            for (var i = 0; i < data.length; i++) {
                if (type == 'number') {
                    value = indexValue + i;
                } else {
                    value = this.enumType[type].charAt(indexValue + i);
                }

                enumOption = {};
                enumOption[this.opts.valueField] = value;
                enumOption[this.opts.textField] = data[i];

                enumData.push(enumOption);
            }

            this.addEnum.call(this, name, enumData);
            return enumData;
        },

        //cookie enum
        setCookieEnum : function(name, enumObj){
            if(!Dolphin.cookie(name)){
                thisTool.cookie(name, thisTool.json2string(enumObj), {
                    expires: 365,
                    path : thisTool.path.basePath
                });

                if (this.opts.enumCache === true) {
                    this.addEnum(name, enumObj);
                }
            }
        },
        setCookieEnumByAjax : function(name){
            if(!thisTool.cookie(name)){
                var enumObj = this.loadEnum(name);
                if(enumObj){
                    var cookieEnum = [], cookieEnumItem = null;
                    for(var i = 0; i < enumObj.length; i++){
                        cookieEnumItem = {};
                        cookieEnumItem[this.opts.valueField] = enumObj[i][this.opts.valueField];
                        cookieEnumItem[this.opts.textField] = enumObj[i][this.opts.textField];
                        cookieEnum.push(cookieEnumItem);
                    }
                    this.setCookieEnum(name, cookieEnum);
                }
            }
        },
        setCookieEnumsByAjax : function(nameList){
            for(var i = 0; i < nameList.length; i++){
                this.setCookieEnumByAjax(nameList[i]);
            }
        },
        getCookieEnum : function(name){
            var enumStr = thisTool.cookie(name);
            return thisTool.string2json(enumStr);
        },

        //load enum
        loadEnum: function (name) {
            var _this = this;
            var data = {}, url;
            data[this.opts.enumKey] = name;
            url = this.opts.enumUrl.replace("{"+this.opts.enumKey+"}", name);
            var returnData = this.opts.ajax.call(this, {
                url: url,
                data: data,
                async : false
            });

            var enumData = null;
            if(returnData.success){
                if(typeof _this.opts.dataFilter == 'function'){
                    returnData = _this.opts.dataFilter.call(_this, returnData);
                }
                enumData = returnData.rows;
                if (this.opts.enumCache === true) {
                    this.addEnum.call(this, name, enumData);
                }
            }

            return enumData;
        },
        loadEnumText: function (name, value) {
            var text = null;
            var data = {};
            data[this.opts.enumKey] = name;
            data[this.opts.enumNameKey] = value;

            this.opts.ajax.call(this, {
                url: this.opts.enumTextUrl,
                data: data,
                async : false
            });

            return text;
        },

        //get enum
        getEnum: function (name) {
            var enumData = this.enumData[name];

            if(enumData == null && this.opts.cookieFlag == true){
                enumData = this.getCookieEnum.call(this, name);
            }

            if (enumData == null && this.opts.ajaxFlag == true) {
                enumData = this.loadEnum.call(this, name);
            }

            return enumData;
        },
        getEnumText: function (name, value) {
            var enumData = this.getEnum(name);
            var text = value;

            if (enumData) {
                for (var i = 0; i < enumData.length; i++) {
                    if (enumData[i][this.opts.valueField] == value) {
                        text = enumData[i][this.opts.textField];
                        break;
                    }
                }
            } else {
                if (console && console.log) {
                    console.log(thisTool.i18n.get('enum_cannot_found', name));
                }
            }

            return text;
        },
        getEnumOption: function (name, value) {
            var enumData = this.getEnum(name);
            var option = null;

            if (enumData) {
                for (var i = 0; i < enumData.length; i++) {
                    if (enumData[i][this.opts.valueField] == value) {
                        option = enumData[i];
                        break;
                    }
                }
            } else {
                if (console && console.log) {
                    console.log(thisTool.i18n.get('enum_cannot_found', name));
                }
            }

            return option;
        },
        setOptions : function(param){
            $.extend(true, this.opts, param);
            return this;
        }
    };

    thisTool.ENUM = ENUM;
    thisTool.enum = new ENUM();
})(jQuery);


text:
<?php

namespace Amb\DebitBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

use Doctrine\ORM\PersistentCollection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

/**
 * @Route("/ajax")
 */
class AjaxController extends Controller
{

  /**
   * @Route("/users/list", name="admin_ajax_users_list")
   * @Template()
   */
  public function depensesListAction(Request $request)
  {
    $get = $request->query->all();

    /* Array of database columns which should be read and sent back to DataTables. Use a space where
    * you want to insert a non-database field (for example a counter or static image)
    */
    $columns = array( 'id', 'date_operation', 'mode_retrait', 'n_piece', 'libelle', 'montant' );
    $get['columns'] = &$columns;

    $em = $this->getDoctrine()->getEntityManager();
    $rResult = $em->getRepository('AmbDebitBundle:Depense')->ajaxTable($get, true)->getArrayResult();

    /* Data set length after filtering */
    $iFilteredTotal = count($rResult);

    /*
     * Output
     */
    $output = array(
      "sEcho" => intval($get['sEcho']),
      "iTotalRecords" => $em->getRepository('AmbDebitBundle:Depense')->getCount(),
      "iTotalDisplayRecords" => $iFilteredTotal,
      "aaData" => array()
    );

    foreach($rResult as $aRow)
    {
      $row = array();
      for ( $i=0 ; $i<count($columns) ; $i++ ){
        if ( $columns[$i] == "version" ){
          /* Special output formatting for 'version' column */
          $row[] = ($aRow[ $columns[$i] ]=="0") ? '-' : $aRow[ $columns[$i] ];
        }elseif ( $columns[$i] != ' ' ){
          /* General output */
          $row[] = $aRow[ $columns[$i] ];
        }
      }
      $output['aaData'][] = $row;
    }

    unset($rResult);

    return new Response(
      json_encode($output)
    );
  }

}


text:
class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :token_authenticatable

  cattr_accessor :current_user

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :data_set_attributes

	has_many :votes, :as => :voteable
	has_many :comments
	has_many :posts
	has_many :notifications, :order => "created_at DESC"
	has_many :admin_auths

	has_one :data_set
	accepts_nested_attributes_for :data_set

	validates_uniqueness_of :name
	validates_format_of :name, :with => /\A[a-zA-Z0-9]+\z/i,
	:message => "can only contain letters and numbers."

	make_voter

  def is_spammer?
    !Spammer.find_by_user_id(self.id).nil?
  end

  def all_notifications
    {
      :new_notifications => self.notifications.where(:unread => true),
      :old_notifications => self.notifications.find(:all,
        :conditions => { :unread => false }, :limit => 20)
    }
  end
end


text:
namespace agency
{

__agency_exec_check_disable__
template<class E, class Function, class ResultFactory, class... Factories,
         __AGENCY_REQUIRES(detail::BulkAsynchronousExecutor<E>()),
         __AGENCY_REQUIRES(executor_execution_depth<E>::value == sizeof...(Factories))
        >
__AGENCY_ANNOTATION
executor_future_t<
  E,
  detail::result_of_t<ResultFactory()>
>
bulk_async_execute(E& exec, Function f, executor_shape_t<E> shape, ResultFactory result_factory, Factories... shared_factories)
{
  return exec.bulk_async_execute(f, shape, result_factory, shared_factories...);
}

__agency_exec_check_disable__
template<class E, class Function, class ResultFactory, class... Factories,
         __AGENCY_REQUIRES(detail::BulkExecutor<E>() && !detail::BulkAsynchronousExecutor<E>()),
         __AGENCY_REQUIRES(executor_execution_depth<E>::value == sizeof...(Factories))
        >
__AGENCY_ANNOTATION
executor_future_t<
  E,
  detail::result_of_t<ResultFactory()>
>
bulk_async_execute(E& exec, Function f, executor_shape_t<E> shape, ResultFactory result_factory, Factories... shared_factories)
{
  using void_future_type = executor_future_t<E,void>;

  // XXX we might want to actually allow the executor to participate here
  auto predecessor = future_traits<void_future_type>::make_ready();

  return agency::bulk_then_execute(exec, f, shape, predecessor, result_factory, shared_factories...);
}

} // end agency


text:
package hr.fer.ztel.thesis.spark

import java.time.Instant

import hr.fer.ztel.thesis.measure.ItemPairSimilarityMeasure
import hr.fer.ztel.thesis.measure.ItemPairSimilarityMeasure._
import org.apache.spark.sql.SparkSession

class SparkSessionHandler(args: Array[String]) extends Serializable {

  if (args.length != 8) {
    println("Wrong args, should be: [folder] [user-item] [item-item] [measure] [normalize] [output] [k] [blocksize]")
    System exit 1
  }

  val folder: String = if (!args(0).endsWith("/")) args(0) + "/" else args(0)
  val userItemPath: String = folder + args(1)

  val itemItemPath: String = folder + args(2)
  val measureStr: String = args(3).toLowerCase
  val normalize: Boolean = args(4).toLowerCase.toBoolean
  val measure: ItemPairSimilarityMeasure = parseMeasure(measureStr).get

  val time: String = Instant.ofEpochMilli(System.currentTimeMillis)
    .toString.replace(":", "-").replace(".", "-")

  val recommendationsPath: String = folder + args(5) + "_" + time
  val topK: Int = args(6).toInt

  val usersSizePath: String = userItemPath + ".lookup.size"
  val itemsSizePath: String = itemItemPath + ".lookup.size"

  val blockSize: Int = args(7).toInt

  lazy val getSparkSession: SparkSession = {

    val sparkBuilder = if (folder.startsWith("hdfs:///")) SparkSession.builder
    else SparkSession.builder.master("local[*]")

    sparkBuilder
      .appName("SparkRecommenderThesis")
      .config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
      .config("spark.kryo.registrator", "hr.fer.ztel.thesis.spark.SparkKryoRegistrator")
      .getOrCreate
  }

}


text:
namespace Owin.Scim.Tests.Validation.Users
{
    using System.Collections.Generic;

    using Machine.Specifications;

    using Model.Users;

    using v2.Model;

    public class with_a_list_of_address_with_invalid_country_codes : when_validating_a_user
    {
        Establish ctx = () =>
        {
            User = new ScimUser2
            {
                UserName = "daniel",
                Addresses = new List<MailingAddress>
                {
                    new MailingAddress { Country = "USA" },
                    new MailingAddress { Country = "invalid" }
                }
            };
        };

        It should_be_invalid = () => ((bool)Result).ShouldEqual(false);
    }
}


text:
using namespace std;

class Solution {
public:
    static int find_offset(vector<int>& nums, int begin, int end){
        if(begin == end) return begin;
        if(nums[begin] < nums[end]) return begin;

        int mid = begin + (end - begin + 1) / 2;
        if(nums[mid] < nums[end]){
            return find_offset(nums, begin, mid);
        }else{
            return find_offset(nums, mid, end);
        }
    }

    static int search(vector<int>& nums, int begin, int end, int offset, int target) {
        if(begin == end) return -1;

        int mid = begin + (end - begin) / 2;
        int mid_val = nums[(mid+offset)%nums.size()];
        if(mid_val == target){
            return mid;
        }else if (mid_val < target){
            return search(nums, mid+1, end, offset, target);
        }else {
            return search(nums, begin, mid, offset, target);
        }

    }

    int search(vector<int>& nums, int target) {
        if(nums.empty()) return -1;

        int offset = find_offset(nums, 0, nums.size()-1);
        int pos = search(nums, 0, nums.size(), offset, target);
        if(pos == -1){
            return -1;
        }else{
            return (pos + offset) % nums.size();
        }
    }
};


text:
namespace Switch {
  /// @brief The Switch::System namespace contains fundamental classes and base classes that define commonly-used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions.
  namespace System {
    /// @brief The Switch::System::Windows namespaces including animation clients, user interface controls, data binding, and type conversion. Switch::System::Windows::Forms and its child namespaces are used for developing Windows Forms applications.
    namespace Windows {
      /// @brief The Switch::System::Windows::Forms namespace contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows operating system, Apple macOS and Linux like Ubuntu operating system.
      namespace Forms {
        /// @brief Specifies the base class used for displaying dialog boxes on the screen.
        /// @par Library
        /// Switch.System.Windows.Forms
        /// @remarks Inherited classes are required to implement RunDialog by invoking ShowDialog to create a specific common dialog box. Inherited classes can optionally override HookProc to implement specific dialog box hook functionality.
        /// @par Examples
        /// The following code example uses the ColorDialog implementation of CommonDialog and illustrates creating and showing a dialog box. This example requires that the method is called from within an existing form, which has a TextBox and Button placed on it.
        /// @code
        /// void button1_Click(const object& sender, const System::EventArgs& e) {
        ///   ColorDialog MyDialog;
        ///   // Keeps the user from selecting a custom color.
        ///   MyDialog.AllowFullOpen = false ;
        ///   // Allows the user to get help. (The default is false.)
        ///   MyDialog.ShowHelp = true ;
        ///   // Sets the initial color select to the current text color.
        ///   MyDialog.Color = textBox1.ForeColor ;
        ///
        ///   // Update the text box color if the user clicks OK
        ///   if (MyDialog.ShowDialog() == DialogResult::OK)
        ///     textBox1.ForeColor =  MyDialog.Color;
        /// }
        /// @endcode
        class system_windows_forms_export_ CommonDialog : public System::ComponentModel::Component {
        public:
          /// @brief Initializes a new instance of the CommonDialog class.
          CommonDialog() {}

          /// @brief Gets or sets an object that contains data about the control.
          /// @return object The object that contains data about the CommonDialog.
          /// @remarks Use this property to store arbitrary information about the control.
          property_ < ref<object >> Tag {
            get_ {return this->tag;},
            set_ {this->tag = value;}
          };

          /// @brief Occurs when the user clicks the Help button on a common dialog box.
          /// @remarks For information about handling events, see Handling and Raising Events.
          /// @par Examples
          /// The following code example demonstrates initializing a ColorDialog object setting the AnyColor, AllowFullOpen properties. The ColorDialog object does not allow the user to set a custom color, but it allows the full set of basic colors to be displayed. By setting the SolidColorOnly property to false, it allows the display of colors that are combinations of other colors on systems with 256 or less colors. The example also shows setting the ShowHelp property and handling a HelpRequest event for a dialog box. To run the example, paste the following code in a form and call the InitializeColorDialog method in the form's constructor or Load method. This example requires that the Click event of the button is connected to the event handler defined in the example.
          /// @code
          /// ColorDialog colorDialog1;
          ///
          /// // This method initializes ColorDialog1 to allow any colors,
          /// // and combination colors on systems with 256 colors or less,
          /// // but will not allow the user to set custom colors.  The
          /// // dialog will contain the help button.
          /// void InitializeColorDialog() {
          ///   this->colorDialog1.AllowFullOpen = false;
          ///   this->colorDialog1.AnyColor = true;
          ///   this->colorDialog1.SolidColorOnly = false;
          ///   this->colorDialog1.ShowHelp = true;
          ///
          ///   // Associate the event-handling method with
          ///   // the HelpRequest event.
          ///   this->colorDialog1.HelpRequest += System::EventHandler(*this, &Form1::ColorDialog1_HelpRequest);
          /// }
          ///
          /// // This method opens the dialog and checks the DialogResult value.
          /// // If the result is OK, the text box's background color will be changed
          /// // to the user-selected color.
          /// void Button1_Click(const System::Object& sender, const System::EventArgs& e) {
          ///   DialogResult result = this->colorDialog1.ShowDialog();
          ///   if (result == DialogResult::OK) {
          ///     TextBox1.BackColor = this->colorDialog1.Color;
          ///   }
          /// }
          ///
          /// // This method is called when the HelpRequest event is raised,
          /// // which occurs when the user clicks the Help button on the ColorDialog object.
          /// void ColorDialog1_HelpRequest(const object& sender, const System::EventArgs& e) {
          ///   MessageBox::Show("Please select a color by clicking it. This will change the BackColor property of the TextBox.");
          /// }
          /// @endcode
          EventHandler HelpRequest;

          /// @brief When overridden in a derived class, resets the properties of a common dialog box to their default values.
          /// @par Notes to Inheritors
          /// Inheriting classes can override this method to reset their properties.
          virtual void Reset() = 0;

          /// @brief When overridden in a derived class, specifies a common dialog box.
          /// @param hwndOwner A value that represents the window handle of the owner window for the common dialog box.
          /// @return bool true if the dialog box was successfully run; otherwise, false.
          /// @remarks This method is invoked when the user of a common dialog box calls ShowDialog, and it must be overridden by inherited classes of CommonDialog to implement a specific common dialog box.
          virtual bool RunDialog(intptr hwndOwner) = 0;

          /// @brief Runs a common dialog box with a default owner.
          /// @return DialogResult DialogResult::OK if the user clicks OK in the dialog box; otherwise, DialogResult::Cancel.
          /// @remarks This method implements RunDialog.
          DialogResult ShowDialog();

          /// @brief Runs a common dialog box with the specified owner.
          /// @param owner Any object that implements IWin32Window that represents the top-level window that will own the modal dialog box.
          /// @return DialogResult DialogResult::OK if the user clicks OK in the dialog box; otherwise, DialogResult::Cancel.
          /// @remarks This version of the ShowDialog method allows you to specify a specific form or control that will own the dialog box that is shown. If you use the version of this method that has no parameters, the dialog box being shown would be owned automatically by the currently active window of your application.
          DialogResult ShowDialog(const IWin32Window& owner);

        protected:
          /// @brief Defines the common dialog box hook procedure that is overridden to add specific functionality to a common dialog box.
          /// @param hwnd The handle to the dialog box window.
          /// @param msg The message being received.
          /// @param wparam Additional information about the message.
          /// @param lparam Additional information about the message.
          /// @return intptr A zero value if the default dialog box procedure processes the message; a nonzero value if the default dialog box procedure ignores the message.
          /// @remarks A hook procedure is a mechanism by which a function can intercept events before they reach an application. When you override the HookProc method for a CommonDialog class, the operating system invokes your override of the function to post operating system messages to the window.
          /// @par Notes to Inheritors
          /// Inheriting classes can override this method to add specific functionality to a common dialog box. When overriding HookProc in a derived class, be sure to call the base class's HookProc method.
          /// @par Examples
          /// @code
          /// // Defines the constants for Windows messages.
          /// static const int WM_SETFOCUS = 0x0007;
          /// static const int WM_INITDIALOG = 0x0110;
          /// static const int WM_LBUTTONDOWN = 0x0201;
          /// static const int WM_RBUTTONDOWN = 0x0204;
          /// static const int WM_MOVE = 0x0003;
          ///
          /// // Overrides the base class hook procedure...
          /// intptr HookProc(intptr hWnd, int msg, intptr wParam, intptr lParam) override {
          ///   // Evaluates the message parameter to determine the user action.
          ///   switch(msg) {
          ///     case WM_INITDIALOG:
          ///       System::Diagnostics::Trace::Write("The WM_INITDIALOG message was received.");
          ///       break;
          ///     case WM_SETFOCUS:
          ///       System::Diagnostics::Trace::Write("The WM_SETFOCUS message was received.");
          ///       break;
          ///     case WM_LBUTTONDOWN:
          ///       System::Diagnostics::Trace::Write("The WM_LBUTTONDOWN message was received.");
          ///       break;
          ///     case WM_RBUTTONDOWN:
          ///       System::Diagnostics::Trace::Write("The WM_RBUTTONDOWN message was received.");
          ///       break;
          ///     case WM_MOVE:
          ///       System::Diagnostics::Trace::Write("The WM_MOVE message was received.");
          ///       break;
          ///   }
          ///
          ///   // Always call the base class hook procedure.
          ///   return this->CommonDialogApi::HookProc(hWnd, msg, wParam, lParam);
          /// }
          /// @endcode
          virtual intptr HookProc(intptr hWnd, int32 msg, intptr wparam, intptr lparam);

          /// @brief Raises the HelpRequest event.
          /// @param e An HelpEventArgs that provides the event data.
          /// @remarks This method is invoked when the Help button is clicked. Inheriting classes can override this method to handle the event.
          virtual void OnHelpRequest(const EventArgs& e);

          /// @brief Defines the owner window procedure that is overridden to add specific functionality to a common dialog box.
          /// @param hWnd The window handle of the message to send.
          /// @param msg The Win32 message to send.
          /// @param wparam The wparam to send with the message.
          /// @param lparam The lparam to send with the message.
          /// @return intptr The result of the message processing, which is dependent on the message sent.
          /// @remarks Control is transferred here when messages are sent to the owner window of the common dialog box. Inheriting classes can override this method to add specific functionality to a common dialog box.
          virtual intptr OwnerWndProc(intptr hWnd, int32 msg, intptr wparam, intptr lparam);

          /// @cond
          ref<object> tag;
          /// @endcond
        };
      }
    }
  }
}


text:
"""Diffusion maps -- organising images"""

# Standard library imports
import math
import random
import sys

# Third party imports
import numpy as np
from scipy import ndimage as ndi
from scipy.misc.pilutil import imsave
from matplotlib import pyplot as plt

# Imports from this project
from difmap import DiffusionMap, gauss_kernel

from skimage import img_as_ubyte
from skimage.io import imread
from skimage.transform import rotate

from nutils import rescale_arr

def stretch(a,b,s):
    c = (a+b)/2.0
    d = s * (b-a)/2.0
    return (c-d,c+d)

def plot_images(x,y,images,shape):
    """Plot image sequence at coordinates x,y.
    """
    s = 1.4 # scale axes out so images don't fall off edge of figure
    xlim = stretch(x.min(),x.max(),s)
    ylim = stretch(y.min(),y.max(),s)

    fig = plt.figure(figsize=(5,5))
    ax = fig.add_axes([0,0,1,1],xlim=xlim,ylim=ylim,xticks=[],yticks=[])

    forward = ax.transData.transform
    reverse = ax.transAxes.inverted().transform

    for i,img in enumerate(images):
        xi,yi = reverse(forward([x[i],y[i]]))
        a_sub = plt.axes([xi,yi,0.1,0.1],axisbg='w',aspect=1.0,
                         xticks=[],yticks=[])
        a_sub.imshow(images[i].reshape(shape),cmap=plt.cm.gray)

def makemat(nx,ny,images,shape):
    nr,nc = shape
    mat = np.empty((nx*nr,ny*nc))

    ir = range(nx)
    jr = range(ny)
    ni = 0
    for i in ir:
        for j in jr:
            mat[i*nr:(i+1)*nr,j*nc:(j+1)*nc] = images[ni].reshape(shape)
            ni += 1
    return mat

if __name__ == '__main__':
    # Number of images to generate
    nx,ny = (8,8)
    N = nx*ny
    max_angle = 360

    #angles = np.linspace(0,max_angle,N,endpoint=False)
    angles = np.random.uniform(0,max_angle,N)

    angles_ord = angles.copy() # keep copy to plot unsorted images
    random.shuffle(angles)   # truly randomized inputs

    # Generate randomized dataset
    template = img_as_ubyte(imread('template.png', as_grey=True))
    shape = np.array(template.shape)
    x_off,y_off = (shape-1)/2

    data = np.empty((len(angles),np.prod(template.shape)),float)
    for i,a in enumerate(angles):
        print("Rotating %i" % i)
        data[i] = rotate(template, angle=a, cval=1).flat

    # Compute diffusion map on dataset
    dm = DiffusionMap(data, kernel=gauss_kernel, kernel_params={'eps':1e9})
    w,v = dm.map()

    # # Plot the raw data as seen by the diffusion map
    # plt.figure()
    # dx,dy = data.shape
    # plt.imshow(data),aspect=float(dy)/dx,cmap=plt.cm.gray)
    # plt.title('raw')
    # plt.xticks([])

    # Plot the matrices as a little table
    m = makemat(nx,ny,data,template.shape)
    plt.matshow(m,cmap=plt.cm.gray)
    plt.xticks([]); plt.yticks([])
    #plt.savefig('images_table.png',dpi=200)

    # Plot the unsorted images on a circle on the x-y plane
    plot_images(np.cos(angles_ord),np.sin(angles_ord),data,template.shape)
    #plt.savefig('images_unordered.png')

    # Plot the images on the diffusion coordinates, which should be sorted
    plot_images(v[:,0],v[:,1],data,template.shape)
    plt.savefig('images_ordered.png',dpi=200)

    plt.show()


text:
package com.flowpowered.api.generator;

import com.flowpowered.api.geo.World;
import com.flowpowered.api.material.BlockMaterial;
import com.flowpowered.api.util.cuboid.CuboidBlockMaterialBuffer;

/**
 * Generates a flat world of a material
 */
public class FlatWorldGenerator implements WorldGenerator {
    private final BlockMaterial material;

    public FlatWorldGenerator() {
        material = BlockMaterial.SOLID_BLUE;
    }

    public FlatWorldGenerator(BlockMaterial material) {
        this.material = material;
    }

    @Override
    public void generate(CuboidBlockMaterialBuffer blockData, World world) {
        final int minBlockY = blockData.getBase().getFloorY();
        final int maxBlockY = blockData.getTop().getFloorY() - 1;
        if (minBlockY > -1 || maxBlockY < -32) {
            blockData.flood(BlockMaterial.AIR);
            return;
        }
        final int bottom = Math.max(-32, minBlockY);
        final int top = Math.min(-1, maxBlockY);
        blockData.setHorizontalLayer(bottom, top - bottom, material);
    }

    @Override
    public Populator[] getPopulators() {
        return new Populator[0];
    }

    @Override
    public String getName() {
        return "FlatWorld";
    }
}


text:
var mongoose = require('mongoose');

var thingSchema = mongoose.Schema({
    name : String,
    stuff : String
});

module.exports = mongoose.model('Thing', thingSchema);


text:
declare module '*.gif';
declare module '*.txt';
declare module '*.md';
declare module '*.mp4';
declare module '*.mp3';
declare module '*.vtt';


text:
package org.apache.druid.client.indexing;

import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.timeline.DataSegment;
import org.joda.time.DateTime;
import org.joda.time.Interval;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.util.Collections;
import java.util.List;

public class ClientAppendQueryTest
{
  private ClientAppendQuery clientAppendQuery;
  private static final String DATA_SOURCE = "data_source";
  private final DateTime start = DateTimes.nowUtc();
  private List<DataSegment> segments = Collections.singletonList(
      new DataSegment(DATA_SOURCE, new Interval(start, start.plus(1)), start.toString(), null, null, null, null, 0, 0)
  );

  @Before
  public void setUp()
  {
    clientAppendQuery = new ClientAppendQuery(DATA_SOURCE, segments);
  }

  @Test
  public void testGetType()
  {
    Assert.assertEquals("append", clientAppendQuery.getType());
  }

  @Test
  public void testGetDataSource()
  {
    Assert.assertEquals(DATA_SOURCE, clientAppendQuery.getDataSource());
  }

  @Test
  public void testGetSegments()
  {
    Assert.assertEquals(segments, clientAppendQuery.getSegments());
  }

  @Test
  public void testToString()
  {
    Assert.assertTrue(clientAppendQuery.toString().contains(DATA_SOURCE));
    Assert.assertTrue(clientAppendQuery.toString().contains(segments.toString()));
  }
}


text:
<BroadcastMonitor>
  <updated>2015-08-04T15:38:52</updated>
  <stationName>Radio 6</stationName>
  <Current>
    <startTime></startTime>
    <itemId></itemId>
    <titleId></titleId>
    <itemCode></itemCode>
    <itemReference></itemReference>
    <titleName></titleName>
    <artistName></artistName>
    <albumName></albumName>
    <CategoryCode></CategoryCode>
    <CategoryName></CategoryName>
    <itemDuration></itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Current>
  <Next>
    <startTime>2015-08-04T15:38:52</startTime>
    <itemId>1000080525:1241168</itemId>
    <titleId>216080584</titleId>
    <itemCode>04245</itemCode>
    <itemReference></itemReference>
    <titleName>Walking On The Moon</titleName>
    <artistName>Roseaux feat. Aloe Blacc</artistName>
    <albumName></albumName>
    <CategoryCode>736</CategoryCode>
    <CategoryName>SOUL</CategoryName>
    <itemDuration>325</itemDuration>
    <MultiMedia1></MultiMedia1>
    <MultiMedia2></MultiMedia2>
    <MultiMedia3></MultiMedia3>
    <MultiMedia4></MultiMedia4>
  </Next>
</BroadcastMonitor>