text:
<!DOCTYPE html>

<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Accessible Mega Menu</title>

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

Perceivable

Information and user interface components must be presentable to users in ways they can perceive.

1.1 Text Alternatives

Provide text alternatives for any non-text content so that it can be changed into other forms people need, such as large print, braille, speech, symbols or simpler language.

1.1.1 Non-text Content

1.2 Time-based Media

Provide alternatives for time-based media.

1.2.1 Audio-only and Video-only (Prerecorded)

1.2.2 Captions (Prerecorded)

1.2.3 Audio Description or Media Alternative (Prerecorded)

1.2.4 Captions (Live)

1.2.5 Audio Description (Prerecorded)

1.2.6 Sign Language (Prerecorded)

1.2.7 Extended Audio Description (Prerecorded)

1.2.8 Media Alternative (Prerecorded)

1.2.9 Audio-only (Live)

1.3 Adaptable

Create content that can be presented in different ways (for example simpler layout) without losing information or structure.

1.3.1 Info and Relationships

1.3.2 Meaningful Sequence

1.3.3 Sensory Characteristics

1.4 Distinguishable

Make it easier for users to see and hear content including separating foreground from background.

1.4.1 Use of Color

1.4.2 Audio Control

1.4.3 Contrast (Minimum)

1.4.4 Resize Text

1.4.5 Images of Text

1.4.6 Contrast (Enhanced)

1.4.7 Low or No Background Audio

1.4.8 Visual Presentation

1.4.9 Images of Text (No Exception)

Operable

User interface components and navigation must be operable.

2.1 Keyboard Accessible

Make all functionality available from a keyboard.

2.1.1 Keyboard

2.1.2 No Keyboard Trap

2.1.3 Keyboard (No Exception)

2.2 Enough Time

Provide users enough time to read and use content.

2.2.1 Timing Adjustable

2.2.2 Pause, Stop, Hide

2.2.3 Interruptions

2.2.4 Interruptions

2.2.5 Re-authenticating

2.3 Seizures

Do not design content in a way that is known to cause seizures.

2.3.1 Three Flashes or Below Threshold

2.3.2 Three Flashes

2.4 Navigable

Provide ways to help users navigate, find content, and determine where they are.

2.4.1 Bypass Blocks

2.4.2 Page Titled

2.4.3 Focus Order

2.4.4 Link Purpose (In Context)

2.4.5 Multiple Ways

2.4.6 Headings and Labels

2.4.7 Focus Visible

2.4.8 Location

2.4.9 Link Purpose (Link Only)

2.4.10 Section Headings

Understandable

Information and the operation of user interface must be understandable.

3.1 Readable

Make text content readable and understandable.

3.1.1 Language of Page

3.1.2 Language of Parts

3.1.3 Unusual Words

3.1.4 Abbreviations

3.1.5 Reading Level

3.1.6 Pronunciation

3.2 Predictable

Make Web pages appear and operate in predictable ways.

3.2.1 On Focus

3.2.2 On Input

3.2.3 Consistent Navigation

3.2.4 Consistent Identification

3.2.5 Change on Request

3.3 Input Assistance

Help users avoid and correct mistakes.

3.3.1 Error Identification

3.3.2 Labels or Instructions

3.3.3 Error Suggestion

3.3.4 Error Prevention (Legal, Financial, Data)

3.3.5 Help

3.3.6 Error Prevention (All)

Robust

Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.

4.1 Compatible

Maximize compatibility with current and future user agents, including assistive technologies.

4.1.1 Parsing

4.1.2 Name, Role, Value

An Accessible Mega Menu

The navigation at the top of this page demonstrates how one can implement an accessible mega menu as a jQuery plugin. It is modeled after the mega menu on adobe.com but has been simplified for use by others. An brief explanation of our interaction design choices can be found in a blog post at Mega menu accessibility on adobe.com.

Content for the links and text within the mega menu comes from the Web Content Accessibility Guidelines (WCAG) 2.0.

Keyboard Accessibility

The accessible mega menu supports keyboard interaction modeled after the behavior described in the WAI-ARIA Menu or Menu bar (widget) design pattern, however we also try to respect users' general expectations for the behavior of links in a global navigation. To this end, the accessible mega menu implementation permits tab focus on each of the six top-level menu items. When one of the menu items has focus, pressing the Enter key, Spacebar or Down arrow will open the submenu panel, and pressing the Left or Right arrow key will shift focus to the adjacent menu item. Links within the submenu panels are included in the tab order when the panel is open. They can also be navigated with the arrow keys or by typing the first character in the link name, which speeds up keyboard navigation considerably. Pressing the Escape key closes the submenu and restores focus to the parent menu item.

Screen Reader Accessibility

The accessible mega menu models its use of WAI-ARIA Roles, States, and Properties after those described in the WAI-ARIA Menu or Menu bar (widget) design pattern with some notable exceptions, so that it behaves better with screen reader user expectations for global navigation. We don't use role="menu" for the menu container and role="menuitem" for each of the links therein, because if we do, assistive technology will no longer interpret the links as links, but instead, as menu items, and the links in our global navigation will no longer show up when a screen reader user executes a shortcut command to bring up a list of links in the page.

We also want to maintain the semantic structure of the submenu panels in our mega menu; our links are organized into lists and separated by headings. Omitting role="menu" and role="menuitem" for the global navigation seems the safer way to go.

Usage

HTML

The HTML structure for the mega menu is a nav element, or any other container element, containing a list. Each list item contains a link which is followed by a div or any other container element which will serve as the pop up panel. The panel can contain any html content; in the following example, each panel contains three lists of links. You can explicitly define groups within the panel, between which a user can navigate quickly using the left and right arrow keys; in the following example, the CSS class .sub-nav-group identifies a navigable group.

    <nav>
        <ul class="nav-menu">
            <li class="nav-item">
                <a href="?movie">Movies</a>
                <div class="sub-nav">
                    <ul class="sub-nav-group">
                        <li><a href="?movie&genre=0">Action & Adventure</a></li>
                        <li><a href="?movie&genre=2">Children & Family</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?movie&genre=7">Dramas</a></li>
                        <li><a href="?movie&genre=9">Foreign</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?movie&genre=14">Musicals</a></li>
                        <li><a href="?movie&genre=15">Romance</a></li>
                        <li>&#8230;</li>
                    </ul>
                </div>
            </li>
            <li class="nav-item">
                <a href="?tv">TV Shows</a>
                <div class="sub-nav">
                    <ul class="sub-nav-group">
                        <li><a href="?tv&genre=20">Classic TV</a></li>
                        <li><a href="?tv&genre=21">Crime TV</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?tv&genre=27">Reality TV</a></li>
                        <li><a href="?tv&genre=30">TV Action</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?tv&genre=33">TV Dramas</a></li>
                        <li><a href="?tv&genre=34">TV Horror</a></li>
                        <li>&#8230;</li>
                    </ul>
                </div>
            </li>
        </ul>
    </nav>

By default, accessibleMegaMenu uses the the following CSS classes to define the top-level navigation items, panels, groups within the panels, and the hover, focus, and open states. It also defines a prefix for unique id strings, which are required to indicate the relationship of a top-level navigation item to the panel it controls.

    defaults = {
        /* unique ID's are required to indicate aria-owns, aria-controls and aria-labelledby */
        uuidPrefix: "accessible-megamenu",

        /* default css class used to define the megamenu styling */
        menuClass: "accessible-megamenu",

        /* default css class for a top-level navigation item in the megamenu */
        topNavItemClass: "accessible-megamenu-top-nav-item",

        /* default css class for a megamenu panel */
        panelClass: "accessible-megamenu-panel",

        /* default css class for a group of items within a megamenu panel */
        panelGroupClass: "accessible-megamenu-panel-group",

        /* default css class for the hover state */
        hoverClass: "hover",

        /* default css class for the focus state */
        focusClass: "focus",

        /* default css class for the open state */
        openClass: "open"
    }

You can optionally override the defaults to use the CSS classes you may have already defined for your mega menu.

JavaScript

Be sure to include jQuery and the jquery-accessibleMegaMenu.js plugin script.

    <script src="js/vendor/jquery-1.10.1.min.js"></script>
    <script src="js/jquery-accessibleMegaMenu.js"></script>

The following initializes the first nav element in the document as an accessibleMegaMenu, with optional CSS class overrides.

    $("nav:first").accessibleMegaMenu({
        /* prefix for generated unique id attributes, which are required
           to indicate aria-owns, aria-controls and aria-labelledby */
        uuidPrefix: "accessible-megamenu",

        /* css class used to define the megamenu styling */
        menuClass: "nav-menu",

        /* css class for a top-level navigation item in the megamenu */
        topNavItemClass: "nav-item",

        /* css class for a megamenu panel */
        panelClass: "sub-nav",

        /* css class for a group of items within a megamenu panel */
        panelGroupClass: "sub-nav-group",

        /* css class for the hover state */
        hoverClass: "hover",

        /* css class for the focus state */
        focusClass: "focus",

        /* css class for the open state */
        openClass: "open"
    });

CSS

AccessibleMegaMenu handles the showing and hiding of panels by adding or removing a CSS class. No inline styles are added to hide elements or create animation between states.

Following is some rudimentary CSS for our example which enables the showing/hiding of and the layout of lists panels in the mega menu.

    /* Rudimentary mega menu CSS for demonstration */

    /* mega menu list */
    .nav-menu {
        display: block;
        position: relative;
        list-style: none;
        margin: 0;
        padding: 0;
        z-index: 15;
    }

    /* a top level navigation item in the mega menu */
    .nav-item {
        list-style: none;
        display: inline-block;
        padding: 0;
        margin: 0;
    }

    /* first descendant link within a top level navigation item */
    .nav-item > a {
        position: relative;
        display: inline-block;
        padding: 0.5em 1em;
        margin: 0 0 -1px 0;
        border: 1px solid transparent;
    }

    /* focus/open states of first descendant link within a top level
       navigation item */
    .nav-item > a:focus,
    .nav-item > a.open {
        border: 1px solid #dedede;
    }

    /* open state of first descendant link within a top level
       navigation item */
    .nav-item > a.open {
        background-color: #fff;
        border-bottom: none;
        z-index: 1;
    }

    /* sub-navigation panel */
    .sub-nav {
        position: absolute;
        display: none;
        top: 2.2em;
        margin-top: -1px;
        padding: 0.5em 1em;
        border: 1px solid #dedede;
        background-color: #fff;
    }

    /* sub-navigation panel open state */
    .sub-nav.open {
        display: block;
    }

    /* list of items within sub-navigation panel */
    .sub-nav ul {
        display: inline-block;
        vertical-align: top;
        margin: 0 1em 0 0;
        padding: 0;
    }

    /* list item within sub-navigation panel */
    .sub-nav li {
        display: block;
        list-style-type: none;
        margin: 0;
        padding: 0;
    }

Completed Example

Putting it all together, here is the completed example:

                Movies

Action & Adventure

Children & Family

…

Dramas

Foreign

…

Musicals

Romance

…

                TV Shows

Classic TV

Crime TV

…

Reality TV

TV Action

…

TV Dramas

TV Horror

…

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Simple Accessible Mega Menu Example</title>
    <style>
        /* Rudimentary mega menu CSS for demonstration */

        /* mega menu list */
        .nav-menu {
            display: block;
            position: relative;
            list-style: none;
            margin: 0;
            padding: 0;
            z-index: 15;
        }

        /* a top level navigation item in the mega menu */
        .nav-item {
            list-style: none;
            display: inline-block;
            padding: 0;
            margin: 0;
        }

        /* first descendant link within a top level navigation item */
        .nav-item > a {
            position: relative;
            display: inline-block;
            padding: 0.5em 1em;
            margin: 0 0 -1px 0;
            border: 1px solid transparent;
        }

        /* focus/open states of first descendant link within a top level
           navigation item */
        .nav-item > a:focus,
        .nav-item > a.open {
            border: 1px solid #dedede;
        }

        /* open state of first descendant link within a top level
           navigation item */
        .nav-item > a.open {
            background-color: #fff;
            border-bottom: none;
            z-index: 1;
        }

        /* sub-navigation panel */
        .sub-nav {
            position: absolute;
            display: none;
            top: 2.6em;
            margin-top: -1px;
            padding: 0.5em 1em;
            border: 1px solid #dedede;
            background-color: #fff;
        }

        /* sub-navigation panel open state */
        .sub-nav.open {
            display: block;
        }

        /* list of items within sub-navigation panel */
        .sub-nav ul {
            display: inline-block;
            vertical-align: top;
            margin: 0 1em 0 0;
            padding: 0;
        }

        /* list item within sub-navigation panel */
        .sub-nav li {
            display: block;
            list-style-type: none;
            margin: 0;
            padding: 0;
        }
    </style>
    </head>
    <body>
    <nav>
        <ul class="nav-menu">
            <li class="nav-item">
                <a href="?movie">Movies</a>
                <div class="sub-nav">
                    <ul class="sub-nav-group">
                        <li><a href="?movie&genre=0">Action &amp; Adventure</a></li>
                        <li><a href="?movie&genre=2">Children &amp; Family</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?movie&genre=7">Dramas</a></li>
                        <li><a href="?movie&genre=9">Foreign</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?movie&genre=14">Musicals</a></li>
                        <li><a href="?movie&genre=15">Romance</a></li>
                        <li>&#8230;</li>
                    </ul>
                </div>
            </li>
            <li class="nav-item">
                <a href="?tv">TV Shows</a>
                <div class="sub-nav">
                    <ul class="sub-nav-group">
                        <li><a href="?tv&genre=20">Classic TV</a></li>
                        <li><a href="?tv&genre=21">Crime TV</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?tv&genre=27">Reality TV</a></li>
                        <li><a href="?tv&genre=30">TV Action</a></li>
                        <li>&#8230;</li>
                    </ul>
                    <ul class="sub-nav-group">
                        <li><a href="?tv&genre=33">TV Dramas</a></li>
                        <li><a href="?tv&genre=34">TV Horror</a></li>
                        <li>&#8230;</li>
                    </ul>
                </div>
            </li>
        </ul>
    </nav>

    <!-- include jquery -->
    <script src="//code.jquery.com/jquery-1.10.1.min.js"></script>

    <!-- include the jquery-accessibleMegaMenu plugin script -->
    <script src="js/jquery-accessibleMegaMenu.js"></script>

    <!-- initialize a selector as an accessibleMegaMenu -->
    <script>
        $("nav:first").accessibleMegaMenu({
            /* prefix for generated unique id attributes, which are required
               to indicate aria-owns, aria-controls and aria-labelledby */
            uuidPrefix: "accessible-megamenu",

            /* css class used to define the megamenu styling */
            menuClass: "nav-menu",

            /* css class for a top-level navigation item in the megamenu */
            topNavItemClass: "nav-item",

            /* css class for a megamenu panel */
            panelClass: "sub-nav",

            /* css class for a group of items within a megamenu panel */
            panelGroupClass: "sub-nav-group",

            /* css class for the hover state */
            hoverClass: "hover",

            /* css class for the focus state */
            focusClass: "focus",

            /* css class for the open state */
            openClass: "open"
        });
    </script>
    </body>
    </html>


text:
set -euo pipefail
IFS=$'\n\t'

npm run clean
npm run test
npm run compile

redpajama_set_name: RedPajamaGithub


text:
package com.linkedin.thirdeye.detector.function;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Properties;

import com.linkedin.thirdeye.detector.api.AnomalyFunctionSpec;

public abstract class BaseAnomalyFunction implements AnomalyFunction {
  private AnomalyFunctionSpec spec;

  @Override
  public void init(AnomalyFunctionSpec spec) throws Exception {
    this.spec = spec;
  }

  @Override
  public AnomalyFunctionSpec getSpec() {
    return spec;
  }

  protected Properties getProperties() throws IOException {
    Properties props = new Properties();
    if (spec.getProperties() != null) {
      String[] tokens = spec.getProperties().split(";");
      for (String token : tokens) {
        props.load(new ByteArrayInputStream(token.getBytes()));
      }
    }
    return props;
  }
}


text:
package nano

import "errors"

// Errors that could be occurred during message handling.
var (
	ErrCloseClosedGroup   = errors.New("close closed group")
	ErrClosedGroup        = errors.New("group closed")
	ErrMemberNotFound     = errors.New("member not found in the group")
	ErrSessionDuplication = errors.New("session has existed in the current group")
)


text:
// .NAME vtkOpenGLHardwareSelector - implements the device specific code of
//  vtkOpenGLHardwareSelector.
//
// .SECTION Description
// Implements the device specific code of vtkOpenGLHardwareSelector.
//
// .SECTION See Also
// vtkHardwareSelector

#ifndef vtkOpenGLHardwareSelector_h
#define vtkOpenGLHardwareSelector_h

#include "vtkRenderingOpenGL2Module.h" // For export macro
#include "vtkHardwareSelector.h"

class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLHardwareSelector : public vtkHardwareSelector
{
public:
  static vtkOpenGLHardwareSelector* New();
  vtkTypeMacro(vtkOpenGLHardwareSelector, vtkHardwareSelector);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Called by the mapper before and after
  // rendering each prop.
  virtual void BeginRenderProp();
  virtual void EndRenderProp()
    { this->vtkHardwareSelector::EndRenderProp(); }

  // Description:
  // Called by any vtkMapper or vtkProp subclass to render a composite-index.
  // Currently indices >= 0xffffff are not supported.
  virtual void RenderCompositeIndex(unsigned int index);

  // Description:
  // Called by any vtkMapper or vtkProp subclass to render an attribute's id.
  virtual void RenderAttributeId(vtkIdType attribid);

  // Description:
  // Called by any vtkMapper or subclass to render process id. This has any
  // effect when this->UseProcessIdFromData is true.
  virtual void RenderProcessId(unsigned int processid);

protected:
  vtkOpenGLHardwareSelector();
  virtual ~vtkOpenGLHardwareSelector();

  // Called internally before and after each prop is rendered
  // for device specific configuration/preparation etc.
  virtual void BeginRenderProp(vtkRenderWindow *);
  virtual void EndRenderProp(vtkRenderWindow *);

  virtual void SavePixelBuffer(int passNo);

  // for internal state
  class vtkInternals;
  vtkInternals* Internals;

private:
  vtkOpenGLHardwareSelector(const vtkOpenGLHardwareSelector&) VTK_DELETE_FUNCTION;
  void operator=(const vtkOpenGLHardwareSelector&) VTK_DELETE_FUNCTION;
};

#endif


text:
EnergyCoin - ENRG

EnergyCoin is a pure PoS coin which generates coins through PoS blocks. Except the first block where it generates the initial 101 million coins, no PoW mining will get any coins. The 1 billion coins will be distributed equally to 1000 individuals with 1 million coins each, all every person has to do is post it on our facebook, twitter or reddit page, and add a signature to btctalk profile. Its easy and free!

After distribution is over energycoin is  mineable by simply running your wallet. Thus a huge mining cost of hardware and millions of electricity costs are saved.

EnergyCoin also adopts a variable PoS rate with the following annual interest rate:
Year-1: 10%
Year-2: 8%
Year-3: 6%
Year-4: 4%
Year-5: 2%
Year 6 has only 1% of annual interest.

-30 seconds block time to make sure network is stable and fast at the same time
-Difficulty retarget is based on each block ensures to keep the difficulty logical
-Scarce but not too scarce to be uninteresting or not usable. 101 million coins in distribution and interest values were decided to make sure the coin retains its value

Ports:
P2P:	22705
RPC:	22706


text:
declare namespace java {
  namespace lang {
    namespace management {

      interface CompilationMXBean extends java.lang.management.PlatformManagedObject {
        getName(): java.lang.String
        isCompilationTimeMonitoringSupported(): boolean
        getTotalCompilationTime(): number
      }

    }
  }
}


text:
@implementation UIApplication (FMExtension)

- (UIViewController *)fm_activityViewController {
    __block UIWindow *normalWindow = [self.delegate window];
    if (normalWindow.windowLevel != UIWindowLevelNormal) {
        [self.windows enumerateObjectsUsingBlock:^(__kindof UIWindow * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            if (obj.windowLevel == UIWindowLevelNormal) {
                normalWindow = obj;
                *stop        = YES;
            }
        }];
    }
    return [self p_nextTopForViewController:normalWindow.rootViewController];
}

- (UIViewController *)p_nextTopForViewController:(UIViewController *)inViewController {
    while (inViewController.presentedViewController) {
        inViewController = inViewController.presentedViewController;
    }
    if ([inViewController isKindOfClass:[UITabBarController class]]) {
        UIViewController *selectController = ((UITabBarController *)inViewController).selectedViewController;
        if (selectController) {
            UIViewController *selectedVC = [self p_nextTopForViewController:selectController];
            return selectedVC;
        } else {
            return inViewController;
        }
    } else if ([inViewController isKindOfClass:[UINavigationController class]]) {
        UIViewController *visibleVC = ((UINavigationController *)inViewController).visibleViewController;
        if (visibleVC) {
            UIViewController *selectedVC = [self p_nextTopForViewController:visibleVC];
            return selectedVC;
        } else {
            return inViewController;
        }
    } else {
        return inViewController;
    }
}

@end


text:
var dick = (function() {
  "use strict";

  function Chainy(lib) {
    return function(value) {
      var self = Object.create(null);
      var objectType = typeof(value);
      var lastValue = value;
      var key, func;

      function buildFunction(key, func) {
        return function() {
          var args = Array.prototype.slice.call(arguments); // Cast arguments into array
          if (lastValue) {
            args.unshift(lastValue);
          }
          var newValue = func.apply(lib, args);
          if (newValue) {
            lastValue = newValue;
          }

          return self;
        };
      }

      // Bind chainability
      for (key in lib) {
        if (lib.hasOwnProperty(key)) {
          self[key] = buildFunction(key, lib[key]);
        }
      }

      self.ret = function ret() {
        return lastValue;
      };

      return self;
    };
  }

  return {
    Chainy: Chainy
  };
}());

module.exports = dick;


text:
<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <property name="acs-oauth-secret-development" type="string">
		mnnlIHrn9qmWE0VZYopTNz3yU5UClr7a
	</property>
    <property name="acs-oauth-key-development" type="string">
		enUM8ZuAEjFMRgjEV7mxpl9EAh1KUVSu
	</property>
    <property name="acs-api-key-development" type="string">
		D199qWmCpyMPyvOXO4x2pJb4rd76Fhz2
	</property>
    <property name="acs-oauth-secret-production" type="string">
		KwsvxQYnfQrSQn0PCUETubzrgraRBezz
	</property>
    <property name="acs-oauth-key-production" type="string">
		5do2LgDKgolbbawL3Q2pMYypMW3Bev7l
	</property>
    <property name="acs-api-key-production" type="string">
		iSnjVjZfhJl0bJ31VKJHed9FN11ExA3d
	</property>
    <property name="acs-push-type-development" type="string">
		gcm
	</property>
    <property name="acs-push-type-production" type="string">
		gcm
	</property>
    <property name="acs-push-type" type="string">
		gcm
	</property>
    <id>com.ifootball.com</id>
    <name>
		iFootball
	</name>
    <version>
		1.0
	</version>
    <publisher>
		kimnamcham
	</publisher>
    <url>
		http://
	</url>
    <description>
		not specified
	</description>
    <copyright>
		2014 by KNC
	</copyright>
    <icon>icon.png</icon>
    <fullscreen>
		true
	</fullscreen>
    <navbar-hidden>
		false
	</navbar-hidden>
    <analytics>
		true
	</analytics>
    <guid>
		96457246-859e-4e88-89a7-1db08d5f1a1c
	</guid>
    <property name="ti.ui.defaultunit" type="string">
		dp
	</property>
    <ios>
        <plist>
            <dict>
                <key>
					UISupportedInterfaceOrientations~iphone
				</key>
                <array>
                    <string>
						UIInterfaceOrientationPortrait
					</string>
                </array>
                <key>
					UISupportedInterfaceOrientations~ipad
				</key>
                <array>
                    <string>
						UIInterfaceOrientationPortrait
					</string>
                    <string>
						UIInterfaceOrientationPortraitUpsideDown
					</string>
                </array>
                <key>
					UIRequiresPersistentWiFi
				</key>
                <false/>
                <key>
					UIPrerenderedIcon
				</key>
                <false/>
                <key>
					UIStatusBarHidden
				</key>
                <false/>
                <key>
					UIStatusBarStyle
				</key>
                <string>
					UIStatusBarStyleDefault
				</string>
            </dict>
        </plist>
    </ios>
    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <application>
                <activity android:configChanges="keyboardHidden"
                    android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="portrait"/>
                <activity android:configChanges="keyboardHidden" android:name="ti.modules.titanium.ui.TiTabActivity"/>
            </application>
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        </manifest>
        <services>
            <service type="interval" url="android_bgservice.js"/>
        </services>
    </android>
    <mobileweb>
        <precache/>
        <splash>
            <enabled>
				true
			</enabled>
            <inline-css-images>
				true
			</inline-css-images>
        </splash>
        <theme>
			default
		</theme>
    </mobileweb>
    <modules>
        <module platform="android">ti.cloudpush</module>
        <module platform="commonjs">ti.cloud</module>
        <module platform="iphone">bencoding.sms</module>
    </modules>
    <deployment-targets>
        <target device="android">true</target>
        <target device="blackberry">
			false
		</target>
        <target device="ipad">true</target>
        <target device="iphone">true</target>
        <target device="mobileweb">
			false
		</target>
        <target device="tizen">
			false
		</target>
    </deployment-targets>
    <sdk-version>3.2.2.GA</sdk-version>
</ti:app>


text:
//
//   Copyright 2015 Blu Age Corporation - Plano, Texas
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using Summer.Batch.Common.Util;

namespace Summer.Batch.Common.Proxy
{
    /// <summary>
    /// Factory for dynamic proxy.
    /// This factory can create a proxy for an interface. The created type will implement all the required interfaces
    /// as well as the <see cref="IProxyObject"/> interface. The method implementation redirect to the underlying
    /// instance. This instance can be changed and can be momentarilly be null, but it must be set when the proxy is
    /// manipulated.
    /// The created proxy supports, properties (including indexed properties), methods, and events.
    /// </summary>
    public static class ProxyFactory
    {
        #region constants

        private const string DynamicAssemblyName = "SummerBatchProxyAssembly";
        private const string DynamicModuleName = "MainModule";
        private const string DynamicTypePrefix = "Proxy_";

        private const string GetInstanceMethodName = "GetInstance";

        private const MethodAttributes InterfaceMethodAttributes = MethodAttributes.Public
                                                                   | MethodAttributes.HideBySig
                                                                   | MethodAttributes.Virtual
                                                                   | MethodAttributes.NewSlot;

        private const MethodAttributes PropertyMethodAttributes = MethodAttributes.Public
                                                                  | MethodAttributes.SpecialName
                                                                  | MethodAttributes.HideBySig
                                                                  | MethodAttributes.Virtual
                                                                  | MethodAttributes.NewSlot;

        #endregion

        private static readonly MethodInfo InstanceGetter = typeof(IProxyObject).GetMethod(GetInstanceMethodName, new Type[0]);

        private static readonly AssemblyName AssemblyName = new AssemblyName(DynamicAssemblyName);

        private static readonly AssemblyBuilder AssemblyBuilder
            = AppDomain.CurrentDomain.DefineDynamicAssembly(AssemblyName, AssemblyBuilderAccess.Run);

        private static readonly ModuleBuilder ModuleBuilder = AssemblyBuilder.DefineDynamicModule(DynamicModuleName);

        // cache for the created types
        private static readonly IDictionary<ProxyCacheKey, Type> ProxyTypeCache = new Dictionary<ProxyCacheKey, Type>();

        /// <summary>
        /// Creates a new proxy for the specified interface and optionally sets its underlying instance.
        /// </summary>
        /// <typeparam name="T"> the interface to proxy</typeparam>
        /// <param name="superType">the super-type of the proxy object</param>
        /// <param name="instance">the underlying instance</param>
        /// <returns>a new proxy for the specified interface</returns>
        public static T Create<T>(Type superType = null, object instance = null)
        {
            return (T)Create(new List<Type> { typeof(T) }, superType, instance);
        }

        /// <summary>
        /// Creates a new proxy for the specified interface and optionally sets its underlying instance.
        /// </summary>
        /// <param name="interface">the interface to proxy</param>
        /// <param name="superType">the super-type of the proxy object</param>
        /// <param name="instance">the underlying instance</param>
        /// <returns>a new proxy for the specified interface</returns>
        public static object Create(Type @interface, Type superType = null, object instance = null)
        {
            return Create(new List<Type> { @interface }, superType, instance);
        }

        /// <summary>
        /// Creates a new proxy for the specified interface and optionally sets its underlying instance.
        /// </summary>
        /// <param name="interfaces">the interfaces to proxy</param>
        /// <param name="superType">the super-type of the proxy object</param>
        /// <param name="instance">the underlying instance</param>
        /// <returns>a new proxy for the specified interface</returns>
        public static object Create(IList<Type> interfaces, Type superType = null, object instance = null)
        {
            if (interfaces.Any(i => !i.IsInterface))
            {
                throw new ProxyException(string.Format("Cannot create a proxy for types [{0}]: only interfaces can be proxied.",
                                                       string.Join(", ", interfaces.Select(i => i.FullName))),
                                         interfaces);
            }

            var key = new ProxyCacheKey(interfaces);
            Type proxyType;
            if (!ProxyTypeCache.TryGetValue(key, out proxyType))
            {
                proxyType = BuildType(interfaces, superType ?? typeof(ProxyObject));
                ProxyTypeCache[key] = proxyType;
            }
            var proxy = Activator.CreateInstance(proxyType);
            if (proxy is ProxyObject)
            {
                ((IProxyObject)proxy).SetInstance(instance);
            }
            return proxy;
        }

        /// <summary>
        /// Builds a dynamic type for the specified interface.
        /// </summary>
        /// <param name="interfaces">the interfaces to proxy</param>
        /// <param name="superType">the super-type of the proxy object</param>
        /// <returns>a new type</returns>
        private static Type BuildType(IList<Type> interfaces, Type superType)
        {
            Assert.NotEmpty(interfaces, "At least one interface must be specified.");
            var name = DynamicTypePrefix + Guid.NewGuid().ToString("N");
            var typeBuilder = ModuleBuilder.DefineType(name, TypeAttributes.Public, superType, interfaces.ToArray());

            foreach (var currentInterface in GetAllInterfaces(interfaces))
            {
                foreach (var property in currentInterface.GetProperties(BindingFlags.Public | BindingFlags.Instance))
                {
                    CreateProperty(typeBuilder, property);
                }
                foreach (var method in currentInterface.GetMethods(BindingFlags.Public | BindingFlags.Instance)
                            .Where(m => !m.IsSpecialName))
                {
                    CreateMethod(typeBuilder, method, InterfaceMethodAttributes);
                }
                foreach (var @event in currentInterface.GetEvents(BindingFlags.Public | BindingFlags.Instance)
                            .Where(e => !e.IsSpecialName))
                {
                    CreateEvent(typeBuilder, @event);
                }
            }

            return typeBuilder.CreateType();
        }

        /// <summary>
        /// Creates a property and its get and set methods if required.
        /// </summary>
        /// <param name="typeBuilder">the builder for the proxy type</param>
        /// <param name="property">the original property</param>
        private static void CreateProperty(TypeBuilder typeBuilder, PropertyInfo property)
        {
            var indexParameterTypes = property.GetIndexParameters().Select(p => p.ParameterType).ToArray();
            var propertyBuilder = typeBuilder.DefineProperty(property.Name, PropertyAttributes.None,
                property.PropertyType, indexParameterTypes);
            if (property.GetMethod != null)
            {
                propertyBuilder.SetGetMethod(CreateMethod(typeBuilder, property.GetMethod, PropertyMethodAttributes));
            }
            if (property.SetMethod != null)
            {
                propertyBuilder.SetSetMethod(CreateMethod(typeBuilder, property.SetMethod, PropertyMethodAttributes));
            }
        }

        /// <summary>
        /// Creates an event and its methods if required.
        /// </summary>
        /// <param name="typeBuilder">the builder for the proxy type</param>
        /// <param name="event">the original event</param>
        private static void CreateEvent(TypeBuilder typeBuilder, EventInfo @event)
        {
            var eventBuilder = typeBuilder.DefineEvent(@event.Name, EventAttributes.None, @event.EventHandlerType);
            if (@event.AddMethod != null)
            {
                eventBuilder.SetAddOnMethod(CreateMethod(typeBuilder, @event.AddMethod, PropertyMethodAttributes));
            }
            if (@event.RemoveMethod != null)
            {
                eventBuilder.SetRemoveOnMethod(CreateMethod(typeBuilder, @event.RemoveMethod,
                    PropertyMethodAttributes));
            }
            if (@event.RaiseMethod != null)
            {
                eventBuilder.SetRaiseMethod(CreateMethod(typeBuilder, @event.RaiseMethod, PropertyMethodAttributes));
            }
        }

        /// <summary>
        /// Creates a method.
        /// </summary>
        /// <param name="typeBuilder">the builder for the proxy type</param>
        /// <param name="method">the original method</param>
        /// <param name="attributes">the attributes of the method</param>
        /// <returns>the corresponding method builder</returns>
        private static MethodBuilder CreateMethod(TypeBuilder typeBuilder, MethodInfo method, MethodAttributes attributes)
        {
            var name = method.DeclaringType.FullName + "." + method.Name;
            var parameters = method.GetParameters().Select(p => p.ParameterType).ToArray();
            var methodBuilder = typeBuilder.DefineMethod(name, attributes, method.ReturnType, parameters);

            foreach (var parameter in method.GetParameters())
            {
                methodBuilder.DefineParameter(parameter.Position + 1, parameter.Attributes, parameter.Name);
            }

            var il = methodBuilder.GetILGenerator();

            il.Emit(OpCodes.Ldarg_0); // Load this
            il.Emit(OpCodes.Callvirt, InstanceGetter); // Get instance

            // Load parameters
            for (var i = 0; i < method.GetParameters().Length; i++)
            {
                il.Emit(OpCodes.Ldarg, i + 1);
            }

            il.Emit(OpCodes.Callvirt, method); // Call method
            il.Emit(OpCodes.Ret); // Return

            // We define it as an explicit implementation, this way we avoid any name collision
            typeBuilder.DefineMethodOverride(methodBuilder, method);

            return methodBuilder;
        }

        /// <summary>
        /// Computes all the interfaces extended by the specified interface.
        /// </summary>
        /// <param name="interfaces">the interfaces to proxy</param>
        /// <returns>an <see cref="IEnumerable{T}"/> of the extended interfaces</returns>
        private static IEnumerable<Type> GetAllInterfaces(IEnumerable<Type> interfaces)
        {
            var yeld = new HashSet<Type>();
            var stack = new Stack<Type>(interfaces);
            while (stack.Count != 0)
            {
                var currentInterface = stack.Pop();
                if (yeld.Contains(currentInterface))
                {
                    continue;
                }
                yeld.Add(currentInterface);
                yield return currentInterface;
                foreach (var superInterface in currentInterface.GetInterfaces())
                {
                    stack.Push(superInterface);
                }
            }
        }

        private struct ProxyCacheKey
        {
            private readonly Type[] _interfaces;

            public ProxyCacheKey(IEnumerable<Type> interfaces)
            {
                _interfaces = interfaces.OrderBy(i => i.FullName).ToArray();
            }

            public override bool Equals(object obj)
            {
                if (obj.GetType() != typeof(ProxyCacheKey))
                {
                    return false;
                }
                var key = (ProxyCacheKey)obj;
                if (key._interfaces.Length != _interfaces.Length)
                {
                    return false;
                }
                return !_interfaces.Where((t, i) => t != key._interfaces[i]).Any();
            }

            public override int GetHashCode()
            {
                return _interfaces.Aggregate(17, (current, @interface) => current * 486187739 + @interface.GetHashCode());
            }

            public override string ToString()
            {
                return "[" + string.Join(", ", _interfaces.Select(i => i.FullName)) + "]";
            }
        }
    }
}


text:
layout: post
title:  "Backpacking Europe:  Milan"
date:   2017-11-28 03:52:38
categories: Travel
tags: [Travel, Backpacking, Europe, Friends, Photoblog, WeekendDiaries]
image:
  background: witewall_3.png
---

Milan is the second most populous city in Italy after Rome, the city has long been named fashion capital of the world and the world's design capital, thanks to several international events and fairs, including Milan Fashion Week.
And Since, Milan was the most watched city of my teenage years. A visit to Milan was must. :stuck_out_tongue_winking_eye: :grinning: :grin:

**_Read other Eurotrip Blogs:_**

+ Backpacking Europe : Zurich
+ Backpacking Europe : Versailles
+ Backpacking Europe : Paris
+ Backpacking Europe : Manchester
+ Backpacking Europe : Liverpool
+ Backpacking Europe : Munich
+ Backpacking Europe : Bled
+ Backpacking Europe : Ljubljana
+ Backpacking Europe : Innsbruck
+ Backpacking Europe : Darmstadt
+ Backpacking Europe : Bratislava
+ Backpacking Europe : Vienna
+ Backpacking Europe : Budapest
+ Backpacking Europe : Prague
+ Backpacking Europe : Milan
+ Backpacking Europe :  Rome
+ Backpacking Europe : Berlin
+ Backpacking Europe : Amsterdam

I landed in Milan and went to the famous city's cathedral. It is a hard miss it as it stands in the city centre, at the Piazza del Duomo. It is truly magnificent, even more, if you are familiar with the fact, that 6 centuries were needed to be completely built it. The cathedral is also the third largest in the world.

>Look Up !

>Piazza del Duomo

>Sit here and admire the Duomo

It's an astonishing gothic confection of white pink marble that dominates Cathedral Square. Literally, it took my breath away. So just sat there, near this :point_up: fountain, gasped, and looked at it for half an hour.

On the right is the Museum that holds various famous artefacts related to the Duomo.

>Candles inside the Cathedral

>St. Bartholomew (From Leonardo's student)

>Inside the Duomo

>Museum of Duomo

>Wooden Replica of the Cathedral

The next stop was the Vitorrio. It is called the world's oldest shopping mall. The street is covered by an arching glass and cast iron roof. This is where you'll find big-name designers like Prada and Louis Vuitton and plenty of cafes. Almost all of which were not pocket-friendly. So I did some window shopping and reached  Teatro Alla Scala on the Piazza Della Scala, one of the most famous opera houses in the world.

>Vitorrio

>Glass and Iron

>The Dome

>Capitoline Wolf with Romulus and Remus

The second reason to check Milan off my list because it is the city of Leonardo da Vinci.

Many historians and scholars regard Leonardo as the prime exemplar of the "Universal Genius" or "Renaissance Man", an individual of "unquenchable curiosity" and he is widely considered one of the most diversely talented individuals ever to have lived. The scope and depth of his interests were without precedent in recorded history, and his mind and personality seem to us superhuman, while the man himself mysterious and remote.

One of his paintings Salvator Mundi is sold for half a billion dollars.

Ok, just got drifted away. Let's come back to Milan. I had planned to see the Last Supper painting by Leonardo. But Then I was told that one has to do advance booking to view the painting.

>Near Leonardo Museum

>Some Statue

>The Arch Della

From the main city, I took a tram to Sempione Park. There are also two tourist attractions, worth the attention – Arco Della Pace (arch) and Castello Sforzesco (castle).

The castle has many museums but on our visit. The castle and the Museum also house the work of Leonardo da Vinci, Michelangelo and Bramantino. I didn't have time for the Museum but It is still was an experience to walk around the walls and the numerous courtyards in the castle.

>Top of Arco Della Pace

>Autumn Colors in the Park

>Little Ninja

>Dam in the park

>Inside the Castle

>Fountain in the Castle

Milan is Italy's Munich. Called the economic and financial capital of the country similar to Munich. Milan hosts alps on the north, while Munich to the south. After a nostalgic ride in the tram, I hopped on the bus back to Munich.

*Trip Cost Breakdown Per Person*

| S.No | Activity|Cost (In Euros) |
|:----------|:----------:|-:|
| 1.      | Day Ticket      |4.5|
| 2.      | Lunch      |7|
| 3.      | Dinner      |0|
| 4.      | Breakfast      |4|
| 5.     | AirBnB     |0|
| 6.      | Momento      |5|
| 7.      | Bus Tickets       |20|
||Total|40 Euros ~ 3200 INR|


text:
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Diagnostics;
using System.Linq;

namespace LinqToDB.DataProvider.SqlServer
{
	using Data;
	using SqlProvider;

	class SqlServerBulkCopy : BasicBulkCopy
	{
		public SqlServerBulkCopy(SqlServerDataProvider dataProvider)
		{
			_dataProvider = dataProvider;
		}

		readonly SqlServerDataProvider _dataProvider;

		protected override BulkCopyRowsCopied ProviderSpecificCopy<T>(
			[JetBrains.Annotations.NotNull] DataConnection dataConnection,
			BulkCopyOptions options,
			IEnumerable<T>  source)
		{
			if (dataConnection == null) throw new ArgumentNullException("dataConnection");

			var connection = dataConnection.Connection as SqlConnection;

			if (connection != null)
			{
				var ed      = dataConnection.MappingSchema.GetEntityDescriptor(typeof(T));
				var columns = ed.Columns.Where(c => !c.SkipOnInsert || options.KeepIdentity == true && c.IsIdentity).ToList();
				var sb      = _dataProvider.CreateSqlBuilder();
				var rd      = new BulkCopyReader(_dataProvider, dataConnection.MappingSchema, columns, source);
				var sqlopt  = SqlBulkCopyOptions.Default;
				var rc      = new BulkCopyRowsCopied();

				if (options.CheckConstraints       == true) sqlopt |= SqlBulkCopyOptions.CheckConstraints;
				if (options.KeepIdentity           == true) sqlopt |= SqlBulkCopyOptions.KeepIdentity;
				if (options.TableLock              == true) sqlopt |= SqlBulkCopyOptions.TableLock;
				if (options.KeepNulls              == true) sqlopt |= SqlBulkCopyOptions.KeepNulls;
				if (options.FireTriggers           == true) sqlopt |= SqlBulkCopyOptions.FireTriggers;
				if (options.UseInternalTransaction == true) sqlopt |= SqlBulkCopyOptions.UseInternalTransaction;

				using (var bc = new SqlBulkCopy(connection, sqlopt, (SqlTransaction)dataConnection.Transaction))
				{
					if (options.NotifyAfter != 0 && options.RowsCopiedCallback != null)
					{
						bc.NotifyAfter = options.NotifyAfter;

						bc.SqlRowsCopied += (sender,e) =>
						{
							rc.RowsCopied = e.RowsCopied;
							options.RowsCopiedCallback(rc);
							if (rc.Abort)
								e.Abort = true;
						};
					}

					if (options.MaxBatchSize.   HasValue) bc.BatchSize       = options.MaxBatchSize.   Value;
					if (options.BulkCopyTimeout.HasValue) bc.BulkCopyTimeout = options.BulkCopyTimeout.Value;

					var sqlBuilder = _dataProvider.CreateSqlBuilder();
					var descriptor = dataConnection.MappingSchema.GetEntityDescriptor(typeof(T));
					var tableName  = GetTableName(sqlBuilder, options, descriptor);

					bc.DestinationTableName = tableName;

					for (var i = 0; i < columns.Count; i++)
						bc.ColumnMappings.Add(new SqlBulkCopyColumnMapping(
							i,
							sb.Convert(columns[i].ColumnName, ConvertType.NameToQueryField).ToString()));

					TraceAction(
						dataConnection,
						"INSERT BULK " + tableName + Environment.NewLine,
						() => { bc.WriteToServer(rd); return rd.Count; });
				}

				if (rc.RowsCopied != rd.Count)
				{
					rc.RowsCopied = rd.Count;

					if (options.NotifyAfter != 0 && options.RowsCopiedCallback != null)
						options.RowsCopiedCallback(rc);
				}

				return rc;
			}

			return MultipleRowsCopy(dataConnection, options, source);
		}

		protected override BulkCopyRowsCopied MultipleRowsCopy<T>(
			DataConnection dataConnection, BulkCopyOptions options, IEnumerable<T> source)
		{
			BulkCopyRowsCopied ret;

			var helper = new MultipleRowsHelper<T>(dataConnection, options, options.KeepIdentity == true);

			if (options.KeepIdentity == true)
				dataConnection.Execute("SET IDENTITY_INSERT " + helper.TableName + " ON");

			switch (((SqlServerDataProvider)dataConnection.DataProvider).Version)
			{
				case SqlServerVersion.v2000 :
				case SqlServerVersion.v2005 : ret = MultipleRowsCopy2(helper, dataConnection, options, source, ""); break;
				default                     : ret = MultipleRowsCopy1(helper, dataConnection, options, source);     break;
			}

			if (options.KeepIdentity == true)
				dataConnection.Execute("SET IDENTITY_INSERT " + helper.TableName + " OFF");

			return ret;
		}
	}
}


text:
package io.debezium.server.pravega;

import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;

import javax.enterprise.event.Observes;

import org.awaitility.Awaitility;
import org.junit.jupiter.api.Test;

import io.debezium.server.TestConfigSource;
import io.debezium.server.events.ConnectorCompletedEvent;
import io.debezium.server.events.ConnectorStartedEvent;
import io.debezium.testing.testcontainers.PostgresTestResourceLifecycleManager;
import io.debezium.util.Testing;
import io.pravega.client.ClientConfig;
import io.pravega.client.EventStreamClientFactory;
import io.pravega.client.admin.ReaderGroupManager;
import io.pravega.client.stream.EventStreamReader;
import io.pravega.client.stream.ReaderConfig;
import io.pravega.client.stream.ReaderGroupConfig;
import io.pravega.client.stream.Stream;
import io.pravega.client.stream.impl.UTF8StringSerializer;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
@QuarkusTestResource(PostgresTestResourceLifecycleManager.class)
@QuarkusTestResource(PravegaTestResource.class)
public class PravegaIT {

    private static final int MESSAGE_COUNT = 4;
    protected static final String STREAM_NAME = "testc.inventory.customers";

    static EventStreamReader<String> reader;

    {
        Testing.Files.delete(TestConfigSource.OFFSET_STORE_PATH);
        Testing.Files.createTestingFile(TestConfigSource.OFFSET_STORE_PATH);
    }

    void setupDependencies(@Observes ConnectorStartedEvent event) {
        Testing.Print.enable();
    }

    void connectorCompleted(@Observes ConnectorCompletedEvent event) {
        if (!event.isSuccess()) {
            throw new RuntimeException(event.getError().get());
        }
    }

    /**
     * Creates a reader where scope name, stream name and reader group name are STREAM_NAME.
     * Consumes 4 events using the reader.
     */
    @Test
    public void testPravega() {
        URI controllerURI = URI.create(PravegaTestResource.getControllerUri());
        ClientConfig clientConfig = ClientConfig.builder()
                .controllerURI(controllerURI)
                .build();
        ReaderGroupConfig readerGroupConfig = ReaderGroupConfig.builder()
                .stream(Stream.of(STREAM_NAME, STREAM_NAME))
                .disableAutomaticCheckpoints()
                .build();

        try (final ReaderGroupManager readerGroupManager = ReaderGroupManager.withScope(STREAM_NAME, clientConfig)) {
            readerGroupManager.createReaderGroup(STREAM_NAME, readerGroupConfig);
        }

        ReaderConfig readerConfig = ReaderConfig.builder().build();
        reader = EventStreamClientFactory.withScope(STREAM_NAME, clientConfig)
                .createReader("0", STREAM_NAME, new UTF8StringSerializer(), readerConfig);

        final List<String> records = new ArrayList<>();
        Awaitility.await().atMost(Duration.ofSeconds(TestConfigSource.waitForSeconds())).until(() -> {
            String event;
            if ((event = reader.readNextEvent(2000).getEvent()) != null) {
                records.add(event);
            }
            return records.size() >= MESSAGE_COUNT;
        });
    }

}


text:
<!DOCTYPE html>

    <title>Aquaria Automatica</title>

    <link rel="import" href="../../bower_components/font-roboto/roboto.html">
    <link rel="import" href="../styles/styles.html">
    <link rel="import" href="../../bower_components/paper-card/paper-card.html">
    <link rel="import" href="../../bower_components/paper-toggle-button/paper-toggle-button.html">
    <link rel="import" href="../../bower_components/iron-flex-layout/classes/iron-flex-layout.html">
    <link rel="import" href="../../bower_components/paper-toolbar/paper-toolbar.html">
    <link rel="import" href="../../bower_components/neon-animation/neon-animated-pages.html">
    <link rel="import" href="../../bower_components/neon-animation/neon-animations.html">
    <link rel="import" href="../../bower_components/paper-tabs/paper-tabs.html">
    <link rel="import" href="../../bower_components/paper-slider/paper-slider.html">
    <link rel="import" href="../../bower_components/paper-button/paper-button.html">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">

    <paper-tabs id="menu">
      <paper-tab>Home</paper-tab>
      <paper-tab>Admin</paper-tab>
    </paper-tabs>

      <neon-animated-pages selected="0" id="pages">
        <neon-animatable>

            <paper-card heading="Aquarium" class="flex-1 card">

                    <paper-toggle-button class="pad-bot-5">Licht</paper-toggle-button>
                    <paper-toggle-button class="pad-bot-5">Zuurstof</paper-toggle-button>
                    <paper-toggle-button class="pad-bot-5">Filter</paper-toggle-button>

            </paper-card>
            <paper-card heading="Gordijnen" class="flex-1 card">

                      <paper-button raised>Open</paper-button>
                      <paper-button raised>Dicht</paper-button>
                      <paper-button raised>Stop</paper-button>

                    <paper-toggle-button class="pad-bot-5">Spots</paper-toggle-button>
                    <paper-toggle-button class="pad-bot-5">Strips</paper-toggle-button>

            </paper-card>
            <paper-card heading="Sfeer" class="flex-1 card">

Eet tafel

                    <paper-slider min="0" max="12" value="0" pin editable class="pad-bot-5"></paper-slider>
                    <paper-toggle-button class="pad-bot-5">Hoofd licht</paper-toggle-button>
                    <paper-toggle-button class="pad-bot-5">Tv wand</paper-toggle-button>
                    <paper-toggle-button class="pad-bot-5">Achter wand</paper-toggle-button>

            </paper-card>

        </neon-animatable>
        <neon-animatable>

            <paper-card>

PAGE 2

            </paper-card>

        </neon-animatable>
      </neon-animated-pages>


text: juju bootstrap


text:
package vcs.citydb.wfs.kvp;

import net.opengis.fes._2.AbstractQueryExpressionType;
import net.opengis.wfs._2.GetFeatureType;
import org.citygml4j.builder.jaxb.CityGMLBuilder;
import vcs.citydb.wfs.config.WFSConfig;
import vcs.citydb.wfs.exception.KVPParseException;
import vcs.citydb.wfs.exception.WFSException;
import vcs.citydb.wfs.exception.WFSExceptionCode;
import vcs.citydb.wfs.kvp.parser.BigIntegerParser;
import vcs.citydb.wfs.kvp.parser.ResolveValueParser;
import vcs.citydb.wfs.kvp.parser.ResultTypeParser;
import vcs.citydb.wfs.kvp.parser.StringParser;

import javax.xml.bind.JAXBElement;
import javax.xml.validation.Schema;
import java.util.List;
import java.util.Map;

public class GetFeatureReader extends KVPRequestReader {
	private final BaseRequestReader baseRequestReader;
	private final QueryExpressionReader queryExpressionReader;

	public GetFeatureReader(Map<String, String> parameters, Schema wfsSchema, CityGMLBuilder cityGMLBuilder, WFSConfig wfsConfig) {
		super(parameters, wfsConfig);
		baseRequestReader = new BaseRequestReader();
		queryExpressionReader = new QueryExpressionReader(
				new net.opengis.wfs._2.ObjectFactory(),
				new net.opengis.fes._2.ObjectFactory(),
				new net.opengis.gml.ObjectFactory(),
				wfsSchema,
				cityGMLBuilder,
				wfsConfig);
	}

	@Override
	public GetFeatureType readRequest() throws WFSException {
		GetFeatureType wfsRequest = new GetFeatureType();
		baseRequestReader.read(wfsRequest, parameters);

		try {
			// standard presentation parameters
			if (parameters.containsKey(KVPConstants.START_INDEX))
				wfsRequest.setStartIndex(new BigIntegerParser().parse(KVPConstants.START_INDEX, parameters.get(KVPConstants.START_INDEX)));

			if (parameters.containsKey(KVPConstants.COUNT))
				wfsRequest.setCount(new BigIntegerParser().parse(KVPConstants.COUNT, parameters.get(KVPConstants.COUNT)));

			if (parameters.containsKey(KVPConstants.OUTPUT_FORMAT))
				wfsRequest.setOutputFormat(new StringParser().parse(KVPConstants.OUTPUT_FORMAT, parameters.get(KVPConstants.OUTPUT_FORMAT)));

			if (parameters.containsKey(KVPConstants.RESULT_TYPE))
				wfsRequest.setResultType(new ResultTypeParser().parse(KVPConstants.RESULT_TYPE, parameters.get(KVPConstants.RESULT_TYPE)));

			// standard resolve parameters
			if (parameters.containsKey(KVPConstants.RESOLVE))
				wfsRequest.setResolve(new ResolveValueParser().parse(KVPConstants.RESOLVE, parameters.get(KVPConstants.RESOLVE)));

			if (parameters.containsKey(KVPConstants.RESOLVE_DEPTH))
				wfsRequest.setResolveDepth(new StringParser().parse(KVPConstants.RESOLVE_DEPTH, parameters.get(KVPConstants.RESOLVE_DEPTH)));

			if (parameters.containsKey(KVPConstants.RESOLVE_TIMEOUT))
				wfsRequest.setResolveTimeout(new BigIntegerParser().parse(KVPConstants.RESOLVE_TIMEOUT, parameters.get(KVPConstants.RESOLVE_TIMEOUT)));

		} catch (KVPParseException e) {
			throw new WFSException(WFSExceptionCode.INVALID_PARAMETER_VALUE, e.getMessage(), e.getParameter(), e.getCause());
		}

		// queries
		List<JAXBElement<? extends AbstractQueryExpressionType>> queries = queryExpressionReader.read(parameters, KVPConstants.GET_FEATURE, getNamespaces(), true);
		wfsRequest.getAbstractQueryExpression().addAll(queries);

		return wfsRequest;
	}

	@Override
	public String getOperationName() {
		return KVPConstants.GET_FEATURE;
	}
}


text:
<?php
namespace Coercive\Utility\FileUpload;

class FileUpload extends AbstractFileUpload {

	/**
	 * @inheritdoc
	 * @see Util\FileUpload\AbstractFileUpload::move
	 */
	public function move($sDestPath) {

		# Move
		$this->moveUploadedFile($sDestPath);

		# Maintain chainability
		return $this;

	}

	/**
	 * @inheritdoc
	 * @see Util\FileUpload\AbstractFileUpload::copy
	 */
	public function copy($sDestPath) {

		# Move
		$this->copyFile($this->getFilePath(), $sDestPath);

		# Maintain chainability
		return $this;

	}

	/**
	 * @inheritdoc
	 * @see Util\FileUpload\AbstractFileUpload::save
	 */
	public function save($sDestPath) {

		return $this->copy($sDestPath);

	}

}


text:
var returnServerHelper = function(serverConfig) { return {
    showBanner: function(req, res) { res.send(serverConfig.banner) },
} }

module.exports = returnServerHelper


text:
module WineBouncer
  VERSION = '1.0.4'.freeze
end


text:
Here is the code used to create the images from my [TEDx
talk](http://tedxul.si/speakers/andrej-bauer/), with extras. It is all released under
the permissive [MIT license](http://opensource.org/licenses/MIT), so please have fun with
it and send me improvements (as a pull requests, please).

The code and the TEDx talk were of course heavily inspired by John Baez's
[The Beauty of roots](http://www.math.ucr.edu/home/baez/roots/), and the work of people
mentioned therein.

Here is a short explanation of the relevant files:

* `zeroes.c`: a C program for computing & drawing the zeroes of polynomials
* `Makefile`: a make file to compile `zeroes.c`
* `movie.py`: a Python helper for creating an animation from the image computed by `zeroes.c`
* `zeroes.py`: Python program to draw the zeroes as disks
* `animate.py`: example of how to make an animation using `zeroes.py`
* `examples`: examples of images created by the above programs

The TEDx movies generated with these programs can be seen in my [Vimeo "Zeroes" album](https://vimeo.com/album/3086303), and you can read about the whole thing at
my blog post [TEDx "Zeroes"](http://math.andrej.com/2014/10/16/tedx-zeroes/).

## Compilation

### Prerequisites

To compile `zeroes.c` you need the [GNU Scientific
Library](http://www.gnu.org/software/gsl/). It is available on most Linux distributions,
for instance on a Debian-based Linux you can get it with

    sudo apt-get install libgsl0-dev

On OSX you can get it via Homebrew with

    brew install gsl

For the Python files to work you need [numpy](http://www.numpy.org) and [Pillow](http://python-pillow.github.io) (which is a newer version of [PIL](http://www.pythonware.com/products/pil/)).

In order to do process the created images you will need
[ImageMagick](http://www.imagemagick.org) and [ffmpeg](http://ffmpeg.org). These are again
available through most Linux package managers, and through Homebrew on OSX.

I have no idea how to make this stuff work under Windows. If you do, please provide some instructions.

### Compilation

The Python code needs no compilation, of course.

Before you compile the C code uncomment the correct `LIBS` definition in the `Makefile`, then type `make`.

## How to use the programs

### The C program

The C program is used as follows:

    ./zeroes <xmin> <xmax> <ymin> <ymax> <xres> <coeff> ... <coeff> - <degree> ... <degree>

It will output a PPM image to the standard output. A typical invocation would be

    ./zeroes -2 2 -1.75 1.75 2000 1 -1 - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 > picture.ppm

The meaning of the command-line arguments is as follows:

* `<xmin>`, `<xmax>`, `<ymin>`, `<ymax>` define a rectangle in the complex plane that the image will capture
* `xres` is the horizontal size of the image in pixels; the vertical size is computed automatically
* `<coeff> ... <coeff>` a list of floating-point numbers separated by spaces
* `<degree> ... <degree>` a list of integers separated by spaces

The program computes all zeroes of all polynomials of the given degrees with the given
coefficients. It outputs a gray-scale image in the PPM format. The gray levels are
log-scale frequency counts of how many times each pixel was hit by a zero. Thus whiter
regions have a greater density of zeroes.

In order to make a nice picture from the output we need to fiddle with the image colors.
ImageMagick is a wonderful tool for doing precisely that. For instance, given the
`picture.ppm` as computed above, we can run

    convert -normalize -fill orange -tint 100 picture.ppm picture.png

to produce a better looking version `picture.png`. For larger images you may need to
replace `-normalize` with a suitable invocatin of `-contrast-stretch`, and for really good
quality you will need some competence with ImageMagick.

If you are planning to generate movies, you can generate a really big picture and then cut
out movie frames from it using ImageMagick. Then you can combine the frames into a movie
with `ffmpeg`. The `movie.py` program helps you generate a movie.

### The Python program

The Python program `zeroes.py` generates a different kind of picture in which zeroes are
represented as disks of variying radii. The size of the radii decreases exponentially with
the degree. Thus the low-degree zeroes are repreented more prominently.

The program has a usage message, so let me just show a typical usage example:

    ./zeroes.py --out picture.png --size 1000 --radius 200 --degrees 1-14 --coeffs 1,-1 --xmin -2 --xmax 2 --ymin -2 --ymax 2 --colors 0,0,255:0,128,255:128,255,255

And another one:

    ./zeroes.py --out picture.png --size 1000 --radius 100 --degrees 1-10 --coeffs 0,1,2 --xmin -3 --xmax 2 --ymin -2 --ymax 2 --colors 255,255,0:255,128,0:0,255,255

The program `animate.py` uses `zeroes.py` to generate a sequence of images which can then be composed into a movie. The movie shows what happens when we smoothly change the coefficients.


text: An implementation of the classic Tic-Tac(Movable) game using React in es6


text:
Imports System.Data.SqlClient
Public Class Form1

    Dim connection As New SqlConnection("Server=(localdb)\MSSQLLocalDB;Database=VB;")

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim adpater As New SqlDataAdapter("SELECT * FROM Students", connection)

        Dim dataset As New DataSet()

        Try

            adpater.Fill(dataset)

            For Each row In dataset.Tables(0).Rows

                ListView1.Items.Add(New ListViewItem(New String() {row("Id"),
                                                     row("Name"),
                                                     row("Email"),
                                                     row("Age")}))

            Next

        Catch ex As Exception

            MessageBox.Show(ex.Message)

        End Try

    End Sub

End Class


text:
package httpproxy

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/http/httputil"
	"regexp"
	"strconv"
	"strings"
	"time"
)

// InMemoryResponse creates new HTTP response given arguments.
func InMemoryResponse(code int, header http.Header, body []byte) *http.Response {
	if header == nil {
		header = make(http.Header)
	}
	st := http.StatusText(code)
	if st != "" {
		st = " " + st
	}
	var bodyReadCloser io.ReadCloser
	var bodyContentLength = int64(0)
	if body != nil {
		bodyReadCloser = ioutil.NopCloser(bytes.NewBuffer(body))
		bodyContentLength = int64(len(body))
	}
	return &http.Response{
		Status:        fmt.Sprintf("%d%s", code, st),
		StatusCode:    code,
		Proto:         "HTTP/1.1",
		ProtoMajor:    1,
		ProtoMinor:    1,
		Header:        header,
		Body:          bodyReadCloser,
		ContentLength: bodyContentLength,
	}
}

// ServeResponse serves HTTP response to http.ResponseWriter.
func ServeResponse(w http.ResponseWriter, resp *http.Response) error {
	if resp.Body != nil {
		defer resp.Body.Close()
	}
	h := w.Header()
	for k, v := range resp.Header {
		for _, v1 := range v {
			h.Add(k, v1)
		}
	}
	if h.Get("Date") == "" {
		h.Set("Date", time.Now().UTC().Format("Mon, 2 Jan 2006 15:04:05")+" GMT")
	}
	if h.Get("Content-Type") == "" && resp.ContentLength != 0 {
		h.Set("Content-Type", "text/plain; charset=utf-8")
	}
	if resp.ContentLength >= 0 {
		h.Set("Content-Length", strconv.FormatInt(resp.ContentLength, 10))
	} else {
		h.Del("Content-Length")
	}
	h.Del("Transfer-Encoding")
	te := ""
	if len(resp.TransferEncoding) > 0 {
		if len(resp.TransferEncoding) > 1 {
			return ErrUnsupportedTransferEncoding
		}
		te = resp.TransferEncoding[0]
	}
	h.Del("Connection")
	clientConnection := ""
	if resp.Request != nil {
		clientConnection = resp.Request.Header.Get("Connection")
	}
	switch clientConnection {
	case "close":
		h.Set("Connection", "close")
	case "keep-alive":
		if h.Get("Content-Length") != "" || te == "chunked" {
			h.Set("Connection", "keep-alive")
		} else {
			h.Set("Connection", "close")
		}
	default:
		if te == "chunked" {
			h.Set("Connection", "close")
		}
	}
	switch te {
	case "":
		w.WriteHeader(resp.StatusCode)
		if resp.Body != nil {
			if _, err := io.Copy(w, resp.Body); err != nil {
				return err
			}
		}
	case "chunked":
		h.Set("Transfer-Encoding", "chunked")
		w.WriteHeader(resp.StatusCode)
		w2 := httputil.NewChunkedWriter(w)
		if resp.Body != nil {
			if _, err := io.Copy(w2, resp.Body); err != nil {
				return err
			}
		}
		if err := w2.Close(); err != nil {
			return err
		}
		if _, err := w.Write([]byte("\r\n")); err != nil {
			return err
		}
	default:
		return ErrUnsupportedTransferEncoding
	}
	return nil
}

// ServeInMemory serves HTTP response given arguments to http.ResponseWriter.
func ServeInMemory(w http.ResponseWriter, code int, header http.Header, body []byte) error {
	return ServeResponse(w, InMemoryResponse(code, header, body))
}

var hasPort = regexp.MustCompile(`:\d+$`)

func stripPort(s string) string {
	ix := strings.IndexRune(s, ':')
	if ix == -1 {
		return s
	}
	return s[:ix]
}


text:
  Template.body.helpers({
    imps: function () {
      return Imps.find({}, {sort: {likes: -1}});
    },
    rebels: function () {
      return Rebels.find({}, {sort: {likes: -1}});
    },
    scavi: function () {
      return ScAVi.find({}, {sort: {likes: -1}});
    }
  });
  Template.cards.events({
    'click .js-open-popup': function (e) {
        var imgPath = $(e.currentTarget).data('image');
        if (imgPath) {
            sImageBox.open(imgPath, {
                animation: 'zoomIn'
            });
        }
    },
    'click .like': function(e) {
      var cardName = $(e.currentTarget).data('cardname');
      var fraction = $("a[data-cardname='" + cardName + "']").parent().parent().find("h3").data("fraction");
      switch(fraction) {
        case 'rebels':
          var doc = Rebels.findOne({"cardName": cardName})
          Rebels.update(doc._id, {$inc: {likes: 1}});
          alert("Wahl registriert für " + cardName);
          break;
        case 'imps':
          var doc = Imps.findOne({"cardName": cardName})
          Imps.update(doc._id, {$inc: {likes: 1}});
          alert("Wahl registriert für " + cardName);
          break;
         case 'scavi':
          var doc = ScAVi.findOne({"cardName": cardName})
          ScAVi.update(doc._id, {$inc: {likes: 1}});
          alert("Wahl registriert für " + cardName);
          break;
      }
    }
    });


text:
using namespace rmengine;
using namespace rmengine::transform;

class TestTTransform3d : public TTransform3d {
public:

    constexpr bool test_isGlobalTransformNeedsUpdate() const noexcept {
        return isGlobalTransformNeedsUpdate();
    }

    constexpr bool test_isTransformNeedsUpdate() const noexcept { return isTransformNeedsUpdate(); }
    constexpr bool test_isRotationNeedsUpdate() const noexcept { return isRotationNeedsUpdate(); }
    constexpr bool test_isPositionNeedsUpdate() const noexcept { return isPositionNeedsUpdate(); }
    constexpr bool test_isScaleNeedsUpdate() const noexcept { return isScaleNeedsUpdate(); }

};

#endif //RMVECTORMATH_TTRANSFORM3DTEST_HPP


text:
<?php
namespace QuickBooksOnline\API\Data;

/**
 * @xmlNamespace http://schema.intuit.com/finance/v3
 * @xmlType string
 * @xmlName IPPAccountClassificationEnum
 * @var IPPAccountClassificationEnum
 * @xmlDefinition
				Product: ALL
				Description: Enumeration of basic
				Account types used generally in the accounting activities.

 */
class IPPAccountClassificationEnum
	{

		/**
		* Initializes this object, optionally with pre-defined property values
		*
		* Initializes this object and it's property members, using the dictionary
		* of key/value pairs passed as an optional argument.
		*
		* @param dictionary $keyValInitializers key/value pairs to be populated into object's properties
		* @param boolean $verbose specifies whether object should echo warnings
		*/
		public function __construct($keyValInitializers=array(), $verbose=FALSE)
		{
			foreach($keyValInitializers as $initPropName => $initPropVal)
			{
				if (property_exists('IPPAccountClassificationEnum',$initPropName) || property_exists('QuickBooksOnline\API\Data\IPPAccountClassificationEnum',$initPropName))
				{
					$this->{$initPropName} = $initPropVal;
				}
				else
				{
					if ($verbose)
						echo "Property does not exist ($initPropName) in class (".get_class($this).")";
				}
			}
		}

		/**
		 * @xmlType value
		 * @var string
		 */
		public $value;

} // end class IPPAccountClassificationEnum


text:
module Credentials
  # Specifies an individual 'line' in a Rulebook.
  # Trivially subclassed as Credentials::Rule::AllowRule
  # and Credentials::Rule::DenyRule, but this is just
  # to allow you to create your own, more complex rule types.
  class Rule
    attr_accessor :parameters
    attr_accessor :options

    def initialize(*args)
      self.options = args.last.is_a?(Hash) ? args.pop : {}
      self.parameters = args
    end

    # Returns the number of arguments expected in a test to this
    # rule. This is really basic, but allows a quick first-pass
    # filtering of the rules.
    def arity
      parameters.length
    end

    # Returns +true+ if the given arguments match this rule.
    # Rules mostly use the same matching criteria as Ruby's
    # +case+ statement: that is, the <tt>===</tt> operator.
    # Remember:
    #     User === User.new   # a class matches an instance
    #     /\w+/ === "abc"     # a RegExp matches a valid string
    #     (1..5) === 3        # a Range matches a number
    #     :foo === :foo       # anything matches itself
    #
    # There are two exceptions to this behaviour. Firstly,
    # if the rule specifies an array, then the argument will
    # match any element of that array:
    #     class User
    #       credentials do |user|
    #         user.can [ :punch, :fight ], [ :shatner, :gandhi ]
    #       end
    #     end
    #
    #     user.can? :fight, :gandhi  # => true
    #
    # Secondly, specifying <tt>:self</tt> in a rule is a nice
    # shorthand for specifying an object's permissions on itself:
    #     class User
    #       credentials do |user|
    #         user.can :fight, :self  # SPOILER ALERT
    #       end
    #     end
    def match?(*args)
      values = args.last.is_a?(Hash) ? args.pop : {}

      return false unless arity == args.length

      parameters.zip(args).each do |expected, actual|
        case expected
        when :self then return false unless actual == args.first
        when Array then return false unless expected.any? { |item| (item === actual) || (item == :self && actual == args.first) }
        else return false unless expected == actual || expected === actual || (expected.is_a?(Class) && actual.is_a?(Class) && actual.ancestors.include?(expected))
        end
      end

      result = true
      result = result && (options.keys & Credentials::Prepositions).inject(true) { |memo, key| memo && evaluate_preposition(args.first, options[key], values[key]) }
      result = result && evaluate_condition(options[:if], :|, *args) unless options[:if].nil?
      result = result && !evaluate_condition(options[:unless], :&, *args) unless options[:unless].nil?
      result
    end

    # Evaluates an +if+ or +unless+ condition.
    # [+conditions+]   One or more conditions to evaluate.
    #                  Can be symbols or procs.
    # [+op+]           Operator used to combine the results
    #                  (+|+ for +if+, +&+ for +unless+).
    # [+args+]         List of arguments to test with/against
    def evaluate_condition(conditions, op, *args)
      receiver = args.shift
      args.reject! { |arg| arg.is_a? Symbol }
      Array(conditions).inject(op == :| ? false : true) do |memo, condition|
        memo = memo.send op, case condition
        when Symbol
          return false unless receiver.respond_to? condition
          !!receiver.send(condition, *args[0, receiver.method(condition).arity])
        when Proc
          raise ArgumentError, "wrong number of arguments to condition (#{args.size + 1} to #{condition.arity})" unless args.size + 1 == condition.arity
          !!condition.call(receiver, *args)
        else
          raise ArgumentError, "invalid :if or :unless option (expected Symbol or Proc, or array thereof; got #{condition.class})"
        end
      end
    end

    def evaluate_preposition(object, expected, actual)
      return true if expected.nil?
      return false if actual.nil?
      return true if expected === actual

      single = expected.to_s
      plural = single.respond_to?(:pluralize) ? single.pluralize : single + "s"

      lclass, rclass = [ object.class.name, actual.class.name ].map do |s|
        s.gsub(/^.*::/, '').
          gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
          gsub(/([a-z\d])([A-Z])/,'\1_\2').
          tr("-", "_").
          downcase
      end

      if object.respond_to?(:id) && actual.respond_to?(:"#{lclass}_id")
        return true if actual.send(:"#{lclass}_id").to_i == object.id.to_i
      end

      if actual.respond_to?(:id) && object.respond_to?(:"#{rclass}_id")
        return true if object.send(:"#{rclass}_id").to_i == actual.id.to_i
      end

      (object.respond_to?(single) && (object.send(single) == actual)) || (object.respond_to?(plural) && (object.send(plural).include?(actual)))
    end
  end
end


text:
package xhsun.gw2app.steve.backend.util.task.vault.wallet;

import java.util.List;

import me.xhsun.guildwars2wrapper.GuildWars2;
import me.xhsun.guildwars2wrapper.error.ErrorCode;
import me.xhsun.guildwars2wrapper.error.GuildWars2Exception;
import timber.log.Timber;
import xhsun.gw2app.steve.backend.data.model.CurrencyModel;
import xhsun.gw2app.steve.backend.data.wrapper.account.AccountDB;
import xhsun.gw2app.steve.backend.data.wrapper.account.AccountWrapper;
import xhsun.gw2app.steve.backend.data.wrapper.common.CurrencyDB;
import xhsun.gw2app.steve.backend.data.wrapper.common.CurrencyWrapper;
import xhsun.gw2app.steve.backend.data.wrapper.wallet.WalletDB;
import xhsun.gw2app.steve.backend.data.wrapper.wallet.WalletWrapper;
import xhsun.gw2app.steve.backend.util.support.dialog.AddAccountListener;
import xhsun.gw2app.steve.backend.util.support.vault.wallet.FragmentInfoProvider;
import xhsun.gw2app.steve.backend.util.task.AsyncTaskResult;
import xhsun.gw2app.steve.backend.util.task.CancellableAsyncTask;
import xhsun.gw2app.steve.view.dialog.DialogManager;

/**
 * Update wallet infomation for all accounts
 *
 * @author xhsun
 * @since 2017-05-01
 */

public class UpdateWalletTask extends CancellableAsyncTask<Void, Void, AsyncTaskResult<List<CurrencyModel>>> {
	private FragmentInfoProvider provider;
	private WalletWrapper walletWrapper;

	public UpdateWalletTask(FragmentInfoProvider provider) {
		this.provider = provider;
		GuildWars2 wrapper = GuildWars2.getInstance();
		AccountWrapper accountWrapper = new AccountWrapper(
				new AccountDB(provider.getContext()), wrapper);
		CurrencyWrapper currencyWrapper = new CurrencyWrapper(new CurrencyDB(provider.getContext()));
		walletWrapper = new WalletWrapper(new WalletDB(provider.getContext()), currencyWrapper, wrapper, accountWrapper);
	}

	@Override
	protected void onPreExecute() {
		provider.hideContent(false);
		provider.getTasks().add(this);
	}

	@Override
	protected void onCancelled() {
		Timber.i("Update wallet info cancelled");
		provider.showContent(false);
		walletWrapper.setCancelled(true);
	}

	@Override
	protected AsyncTaskResult<List<CurrencyModel>> doInBackground(Void... params) {
		AsyncTaskResult<List<CurrencyModel>> result;
		Boolean isSuccess = walletWrapper.update();
		if (isSuccess == null) {
			result = new AsyncTaskResult<>();
			result.setData(null);
			return result;
		}

		List<CurrencyModel> data = walletWrapper.getAll();
		if (!isSuccess) {
			result = new AsyncTaskResult<>(new GuildWars2Exception(ErrorCode.Server, ""));
			result.setData(data);
			return result;
		} else return new AsyncTaskResult<>(data);
	}

	@Override
	protected void onPostExecute(AsyncTaskResult<List<CurrencyModel>> result) {
		if (isCancelled() || isCancelled) return;//task cancelled, abort
		if (result.getData() == null) {
			Timber.i("No accounts in record, prompt add account");
			new DialogManager(provider.getFragmentManager()).promptAdd((AddAccountListener) provider);
		} else provider.getAdapter().setData(result.getData());

		if (result.getError() != null) provider.displayError();

		provider.getTasks().remove(this);
		provider.showContent(false);
	}

}


text:
import React from 'react';
//import {Link} from 'react-router';
//import { Button } from 'react-bootstrap';

const HomePage = () => {
  return (

 My name is Tyrus Brenc and I am a Full Stack Software Engineer specializing in Javascript with a passion for diving deep into tech to figure out
      which technologies work together the best.  This website attempts to not only showcase
      my work, but act as a proving ground for new tech that I’m trying out!

  );
};

export default HomePage;


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.trino.plugin.kudu;

import com.google.common.collect.ImmutableMap;
import io.airlift.units.Duration;
import org.testng.annotations.Test;

import java.util.Map;

import static io.airlift.configuration.testing.ConfigAssertions.assertFullMapping;
import static io.airlift.configuration.testing.ConfigAssertions.assertRecordedDefaults;
import static io.airlift.configuration.testing.ConfigAssertions.recordDefaults;
import static java.util.concurrent.TimeUnit.MINUTES;
import static java.util.concurrent.TimeUnit.SECONDS;

public class TestKuduClientConfig
{
    @Test
    public void testDefaults()
    {
        assertRecordedDefaults(recordDefaults(KuduClientConfig.class)
                .setMasterAddresses("")
                .setDefaultAdminOperationTimeout(new Duration(30, SECONDS))
                .setDefaultOperationTimeout(new Duration(30, SECONDS))
                .setDisableStatistics(false)
                .setSchemaEmulationEnabled(false)
                .setSchemaEmulationPrefix("presto::")
                .setDynamicFilteringWaitTimeout(new Duration(0, MINUTES)));
    }

    @Test
    public void testExplicitPropertyMappingsWithCredentialsKey()
    {
        Map<String, String> properties = ImmutableMap.<String, String>builder()
                .put("kudu.client.master-addresses", "localhost")
                .put("kudu.client.default-admin-operation-timeout", "1m")
                .put("kudu.client.default-operation-timeout", "5m")
                .put("kudu.client.disable-statistics", "true")
                .put("kudu.schema-emulation.enabled", "true")
                .put("kudu.schema-emulation.prefix", "trino::")
                .put("kudu.dynamic-filtering.wait-timeout", "30m")
                .buildOrThrow();

        KuduClientConfig expected = new KuduClientConfig()
                .setMasterAddresses("localhost")
                .setDefaultAdminOperationTimeout(new Duration(1, MINUTES))
                .setDefaultOperationTimeout(new Duration(5, MINUTES))
                .setDisableStatistics(true)
                .setSchemaEmulationEnabled(true)
                .setSchemaEmulationPrefix("trino::")
                .setDynamicFilteringWaitTimeout(new Duration(30, MINUTES));

        assertFullMapping(properties, expected);
    }
}


text:
import { Editor } from 'content-kit-editor';
import Helpers from '../test-helpers';
import { MOBILEDOC_VERSION } from 'content-kit-editor/renderers/mobiledoc';

const { test, module } = QUnit;

let fixture, editor, editorElement, selectedText;

const mobiledoc = {
  version: MOBILEDOC_VERSION,
  sections: [
    [],
    [[
      1, 'P', [[[], 0, 'THIS IS A TEST']],
      1, 'P', [[[], 0, 'second section']]
    ]]
  ]
};

module('Acceptance: Editor commands', {
  beforeEach() {
    fixture = document.getElementById('qunit-fixture');
    editorElement = document.createElement('div');
    editorElement.setAttribute('id', 'editor');
    fixture.appendChild(editorElement);
    editor = new Editor(editorElement, {mobiledoc});

    selectedText = 'IS A';
    Helpers.dom.selectText(selectedText, editorElement);
    Helpers.dom.triggerEvent(document, 'mouseup');
  },

  afterEach() {
    editor.destroy();
  }
});

test('when text is highlighted, shows toolbar', (assert) => {
  let done = assert.async();

  setTimeout(() => {
    assert.hasElement('.ck-toolbar', 'displays toolbar');
    assert.hasElement('.ck-toolbar-btn', 'displays toolbar buttons');
    let boldBtnSelector = '.ck-toolbar-btn[title="bold"]';
    assert.hasElement(boldBtnSelector, 'has bold button');

    done();
  });
});

test('highlight text, click "bold" button bolds text', (assert) => {
  let done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'bold');
    assert.hasElement('#editor strong:contains(IS A)');

    done();
  });
});

test('highlight text, click "heading" button turns text into h2 header', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'heading');
    assert.hasElement('#editor h2:contains(THIS IS A TEST)');
    assert.selectedText('THIS IS A TEST', 'expands selection to entire section');

    done();
  });
});

test('click heading button triggers update', (assert) => {
  const done = assert.async();
  const triggered = [];
  const triggerFn = editor.trigger;
  editor.trigger = (name, ...args) => {
    triggered.push(name);
    triggerFn.call(editor, name, ...args);
  };

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'heading');
    assert.ok(triggered.indexOf('update') !== -1,
              'update was triggered');

    done();
  });
});

test('highlighting heading text activates toolbar button', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.assertVisible(assert);
    Helpers.toolbar.assertInactiveButton(assert, 'heading');

    Helpers.toolbar.clickButton(assert, 'heading');

    Helpers.toolbar.assertActiveButton(assert, 'heading');

    // FIXME must actually trigger the mouseup
    Helpers.dom.clearSelection();
    Helpers.dom.triggerEvent(document, 'mouseup');

    setTimeout(() => {
      Helpers.toolbar.assertHidden(assert);

      Helpers.dom.selectText(selectedText, editorElement);
      Helpers.dom.triggerEvent(document, 'mouseup');

      setTimeout(() => {
        Helpers.toolbar.assertActiveButton(assert, 'heading',
                                  'heading button is active when text is selected');

        done();
      });
    });
  });
});

test('when heading text is highlighted, clicking heading button turns it to plain text', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'heading');
    assert.hasElement('#editor h2:contains(THIS IS A TEST)');

    setTimeout(() => {
      Helpers.toolbar.clickButton(assert, 'heading');

      setTimeout(() => {
        assert.hasNoElement('#editor h2:contains(THIS IS A TEST)');
        assert.hasElement('#editor p:contains(THIS IS A TEST)');

        done();
      });
    });
  });
});

test('clicking multiple heading buttons keeps the correct ones active', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    // click subheading, makes its button active, changes the display
    Helpers.toolbar.clickButton(assert, 'subheading');
    assert.hasElement('#editor h3:contains(THIS IS A TEST)');
    Helpers.toolbar.assertActiveButton(assert, 'subheading');
    Helpers.toolbar.assertInactiveButton(assert, 'heading');

    // click heading, makes its button active and no others, changes display
    Helpers.toolbar.clickButton(assert, 'heading');
    assert.hasElement('#editor h2:contains(THIS IS A TEST)');
    Helpers.toolbar.assertActiveButton(assert, 'heading');
    Helpers.toolbar.assertInactiveButton(assert, 'subheading');

    // click heading again, removes headline from display, no active buttons
    Helpers.toolbar.clickButton(assert, 'heading');
    assert.hasElement('#editor p:contains(THIS IS A TEST)');
    Helpers.toolbar.assertInactiveButton(assert, 'heading');
    Helpers.toolbar.assertInactiveButton(assert, 'subheading');

    done();
  });
});

test('highlight text, click "subheading" button turns text into h3 header', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'subheading');
    assert.hasElement('#editor h3:contains(THIS IS A TEST)');

    done();
  });
});

test('highlight text, click "quote" button turns text into blockquote', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'quote');
    assert.hasElement('#editor blockquote:contains(THIS IS A TEST)');

    done();
  });
});

// FIXME PhantomJS doesn't create keyboard events properly (they have no keyCode or which)
// see https://bugs.webkit.org/show_bug.cgi?id=36423
Helpers.skipInPhantom('highlight text, click "link" button shows input for URL, makes link', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.clickButton(assert, 'link');
    let input = assert.hasElement('.ck-toolbar-prompt input');
    let url = 'http://google.com';
    $(input).val(url);
    Helpers.dom.triggerKeyEvent(input[0], 'keyup');

    assert.hasElement(`#editor a[href="${url}"]:contains(${selectedText})`);

    done();
  });
});

test('highlighting bold text shows bold button as active', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.assertInactiveButton(assert, 'bold', 'precond - bold button is not active');
    Helpers.toolbar.clickButton(assert, 'bold');
    Helpers.toolbar.assertActiveButton(assert, 'bold');

    Helpers.dom.clearSelection();
    Helpers.dom.triggerEvent(document, 'mouseup');

    setTimeout(() => {
      Helpers.toolbar.assertHidden(assert);

      Helpers.dom.selectText(selectedText, editorElement);
      Helpers.dom.triggerEvent(document, 'mouseup');

      setTimeout(() => {
        Helpers.toolbar.assertVisible(assert);
        Helpers.toolbar.assertActiveButton(assert, 'bold');

        done();
      });
    });
  });
});

test('click bold button applies bold to selected text', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.assertInactiveButton(assert, 'bold', 'precond - bold button is not active');
    Helpers.toolbar.clickButton(assert, 'bold');
    Helpers.toolbar.assertActiveButton(assert, 'bold');

    assert.hasNoElement('#editor strong:contains(THIS)');
    assert.hasNoElement('#editor strong:contains(TEST)');
    assert.hasElement('#editor strong:contains(IS A)');

    assert.selectedText(selectedText);

    Helpers.toolbar.clickButton(assert, 'bold');

    assert.hasNoElement('#editor strong:contains(IS A)', 'bold text is no longer bold');
    Helpers.toolbar.assertInactiveButton(assert, 'bold');

    done();
  });
});

test('can unbold part of a larger set of bold text', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.assertInactiveButton(assert, 'bold', 'precond - bold button is not active');
    Helpers.toolbar.clickButton(assert, 'bold');
    Helpers.toolbar.assertActiveButton(assert, 'bold');

    assert.hasElement('#editor strong:contains(IS A)');

    Helpers.dom.selectText('S A', editorElement);
    Helpers.dom.triggerEvent(document, 'mouseup');

    setTimeout(() => {
      Helpers.toolbar.assertVisible(assert);
      Helpers.toolbar.assertActiveButton(assert, 'bold');
      Helpers.toolbar.clickButton(assert, 'bold');

      assert.hasElement('#editor strong:contains(I)', 'unselected text is bold');
      assert.hasNoElement('#editor strong:contains(IS A)', 'unselected text is bold');
      assert.hasElement('#editor p:contains(S A)', 'unselected text is bold');

      done();
    });
  });
});

test('can italicize text', (assert) => {
  const done = assert.async();

  setTimeout(() => {
    Helpers.toolbar.assertInactiveButton(assert, 'italic');
    Helpers.toolbar.clickButton(assert, 'italic');

    assert.hasElement('#editor em:contains(IS A)');
    assert.selectedText('IS A');
    Helpers.toolbar.assertActiveButton(assert, 'italic');

    Helpers.toolbar.clickButton(assert, 'italic');
    assert.hasNoElement('#editor em:contains(IS A)');
    Helpers.toolbar.assertInactiveButton(assert, 'italic');

    done();
  });
});

// test selecting across markers and boldening
// test selecting across markers in sections and bolding


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.cloudasset.v1p1beta1.model;

/**
 * An allowed method or permission of a service specified in ApiOperation.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Asset API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleIdentityAccesscontextmanagerV1MethodSelector extends com.google.api.client.json.GenericJson {

  /**
   * Value for `method` should be a valid method name for the corresponding `service_name` in
   * ApiOperation. If `*` used as value for `method`, then ALL methods and permissions are allowed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String method;

  /**
   * Value for `permission` should be a valid Cloud IAM permission for the corresponding
   * `service_name` in ApiOperation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String permission;

  /**
   * Value for `method` should be a valid method name for the corresponding `service_name` in
   * ApiOperation. If `*` used as value for `method`, then ALL methods and permissions are allowed.
   * @return value or {@code null} for none
   */
  public java.lang.String getMethod() {
    return method;
  }

  /**
   * Value for `method` should be a valid method name for the corresponding `service_name` in
   * ApiOperation. If `*` used as value for `method`, then ALL methods and permissions are allowed.
   * @param method method or {@code null} for none
   */
  public GoogleIdentityAccesscontextmanagerV1MethodSelector setMethod(java.lang.String method) {
    this.method = method;
    return this;
  }

  /**
   * Value for `permission` should be a valid Cloud IAM permission for the corresponding
   * `service_name` in ApiOperation.
   * @return value or {@code null} for none
   */
  public java.lang.String getPermission() {
    return permission;
  }

  /**
   * Value for `permission` should be a valid Cloud IAM permission for the corresponding
   * `service_name` in ApiOperation.
   * @param permission permission or {@code null} for none
   */
  public GoogleIdentityAccesscontextmanagerV1MethodSelector setPermission(java.lang.String permission) {
    this.permission = permission;
    return this;
  }

  @Override
  public GoogleIdentityAccesscontextmanagerV1MethodSelector set(String fieldName, Object value) {
    return (GoogleIdentityAccesscontextmanagerV1MethodSelector) super.set(fieldName, value);
  }

  @Override
  public GoogleIdentityAccesscontextmanagerV1MethodSelector clone() {
    return (GoogleIdentityAccesscontextmanagerV1MethodSelector) super.clone();
  }

}


text:
'use strict';

class listNode {
    constructor(value) {
        this._value = value;
        this._next = null;
    }

    get value(){
        return this._value;
    }

    set value(x){
        this._value = x;
    }

    get next(){
        return this._next;
    }
}

class LinkedList {
    constructor() {
        this._lenght = 0;
        this._first = null;
        this._last = null;
    }

    get first(){
        return this._first;
    }

    get last(){
        return this._last;
    }

    get length(){
        return this._lenght;
    }

    append(...x) {
        if (!this._first) {
            this._first = new listNode(arguments[0]);
        }
    }
}

var list = new LinkedList();

console.log(list.first);

module.exports = LinkedList;