text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Natuurwet. Tijdschr. 5: 81 (1923)

#### Original name
Naucoria turfosa Naveau

### Remarks
null


text:
using Newtonsoft.Json.Linq;
using System.Collections.Generic;

namespace Twitch.Base.Models.NewAPI.Bits
{
    /// <summary>
    /// Information about a bits cheermote.
    /// </summary>
    public class BitsCheermoteModel
    {
        /// <summary>
        /// The prefix name of the cheermotes.
        /// </summary>
        public string prefix { get; set; }
        /// <summary>
        /// Shows whether the emote is global_first_party, global_third_party, channel_custom, display_only, or sponsored.
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// Order of the emotes as shown in the bits card, in ascending order.
        /// </summary>
        public int order { get; set; }
        /// <summary>
        /// The data when this Cheermote was last updated.
        /// </summary>
        public string last_updated { get; set; }
        /// <summary>
        /// Indicates whether or not this emote provides a charity contribution match during charity campaigns.
        /// </summary>
        public bool is_charitable { get; set; }
        /// <summary>
        /// An array of Cheermotes with their metadata.
        /// </summary>
        public List<BitsCheermoteTierModel> tiers { get; set; } = new List<BitsCheermoteTierModel>();
    }

    /// <summary>
    /// Information about a bits cheermote tier.
    /// </summary>
    public class BitsCheermoteTierModel
    {
        /// <summary>
        /// ID of the emote tier. Possible tiers are: 1,100,500,1000,5000, 10k, or 100k.
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// Minimum number of bits needed to be used to hit the given tier of emote.
        /// </summary>
        public int min_bits { get; set; }
        /// <summary>
        /// Hex code for the color associated with the bits of that tier. Grey, Purple, Teal, Blue, or Red color to match the base bit type.
        /// </summary>
        public string color { get; set; }
        /// <summary>
        /// Indicates whether or not emote information is accessible to users.
        /// </summary>
        public bool can_cheer { get; set; }
        /// <summary>
        /// Indicates whether or not we hide the emote from the bits card.
        /// </summary>
        public bool show_in_bits_card { get; set; }
        /// <summary>
        /// Structure containing both animated and static image sets, sorted by light and dark.
        /// </summary>
        public JObject images { get; set; }

        /// <summary>
        /// Gets the dark, animated images.
        /// </summary>
        public Dictionary<string, string> DarkAnimatedImages { get { return this.GetCheermoteImages("dark", "animated"); } }
        /// <summary>
        /// Gets the dark, static images.
        /// </summary>
        public Dictionary<string, string> DarkStaticImages { get { return this.GetCheermoteImages("dark", "static"); } }
        /// <summary>
        /// Gets the light, animated images.
        /// </summary>
        public Dictionary<string, string> LightAnimatedImages { get { return this.GetCheermoteImages("light", "animated"); } }
        /// <summary>
        /// Gets the light, static images.
        /// </summary>
        public Dictionary<string, string> LightStaticImages { get { return this.GetCheermoteImages("light", "static"); } }

        private Dictionary<string, string> GetCheermoteImages(string color, string imageType)
        {
            Dictionary<string, string> results = new Dictionary<string, string>();
            if (this.images != null && this.images.ContainsKey(color))
            {
                JObject colorJObj = (JObject)this.images[color];
                if (colorJObj != null && colorJObj.ContainsKey(imageType))
                {
                    JObject imageTypeJObj = (JObject)colorJObj[imageType];
                    foreach (var kvp in imageTypeJObj)
                    {
                        results[kvp.Key] = kvp.Value.ToString();
                    }
                }
            }
            return results;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * ステージリンクコンポーネント。
 * @module ./app/shared/stage-link.component
 */
import { Component, Input } from '@angular/core';
import { Stage } from '../stages/stage.model';

/**
 * ステージリンクコンポーネントクラス。
 */
@Component({
	selector: 'stage-link',
	template: ""
		+ "<stage-label [stage]=\"stage\" [permission]=\"permission\"></stage-label>"
		+ ""
		+ "<stage-label [stage]=\"stage\" [permission]=\"permission\"></stage-label>",
})
export class StageLinkComponent {
	/** 表示するステージ */
	@Input() stage: Stage = null;
	/** プライベートを表示する場合true */
	@Input() permission = false;
}


text:
% by Siddharth Raja
% Returns a set of feature descriptors for a given set of interest points.

function [features] = get_features(image, x, y, feature_width)

    f_number = length(x);
    g = fspecial('Gaussian', feature_width , feature_width/2);
    gw = fspecial('Gaussian', feature_width/2 , 2); % window weights
    features = zeros(f_number, 128);
    win_step = 16;
    subwin_step = 4;
    bins = [0:45:360] * pi/180; % buckets
    [magnitudes, angles] = imgradient(image);
    angles = angles + 180;
    angles = angles .* pi/180;
    % magnitudes = imfilter(magnitudes, gw);

    for i=1:f_number
        descriptors = zeros(1,128);
        step = 1;
        iterator = 1:subwin_step:win_step;

        win = angles(y(i)-feature_width/2+1 : y(i)+feature_width/2, x(i)-feature_width/2+1 : x(i)+feature_width/2);

        for I = iterator
            for J = iterator
                subwin_ang = win(I:I + subwin_step - 1, J:J + subwin_step - 1);
                % subwin_mag = magnitudes(I:I + subwin_step - 1, J:J + subwin_step - 1);
                orientations = subwin_ang(:);
                % ang = zeros(length(orientations), 1);
                hist = histcounts(orientations', bins);
                % Normalize, clipping and renormalize
                hist = hist / norm(hist);
                hist(hist > 0.2) = 0.2;
                hist = hist / norm(hist);
                descriptors(step:step+7) = hist;
                step = step + 8;

            end
        end
        features(i, :) = descriptors;
    end
    fprintf('finished get_features\n');

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>cynomys</artifactId>
        <groupId>cn.howardliu.monitor</groupId>
        <version>0.1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>cynomys-common</artifactId>
    <version>0.1.0-SNAPSHOT</version>

    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>


text:
import React, { Component } from 'react'
import { Link, Route, Router, Switch } from 'react-router-dom'
import { Grid, Menu, Segment } from 'semantic-ui-react'

import Auth from './auth/Auth'
import { EditTodo } from './components/EditTodo'
import { LogIn } from './components/LogIn'
import { NotFound } from './components/NotFound'
import { Todos } from './components/Todos'

export interface AppProps {}

export interface AppProps {
  auth: Auth
  history: any
}

export interface AppState {}

export default class App extends Component<AppProps, AppState> {
  constructor(props: AppProps) {
    super(props)

    this.handleLogin = this.handleLogin.bind(this)
    this.handleLogout = this.handleLogout.bind(this)
  }

  handleLogin() {
    this.props.auth.login()
  }

  handleLogout() {
    this.props.auth.logout()
  }

  render() {
    return (
      <div>
        <Segment style={{ padding: '8em 0em' }} vertical>
          <Grid container stackable verticalAlign="middle">
            <Grid.Row>
              <Grid.Column width={16}>
                <Router history={this.props.history}>
                  {this.generateMenu()}

                  {this.generateCurrentPage()}
                </Router>
              </Grid.Column>
            </Grid.Row>
          </Grid>
        </Segment>
      </div>
    )
  }

  generateMenu() {
    return (
      <Menu>
        <Menu.Item name="home">
          <Link to="/">Home</Link>
        </Menu.Item>

        <Menu.Menu position="right">{this.logInLogOutButton()}</Menu.Menu>
      </Menu>
    )
  }

  logInLogOutButton() {
    if (this.props.auth.isAuthenticated()) {
      return (
        <Menu.Item name="logout" onClick={this.handleLogout}>
          Log Out
        </Menu.Item>
      )
    } else {
      return (
        <Menu.Item name="login" onClick={this.handleLogin}>
          Log In
        </Menu.Item>
      )
    }
  }

  generateCurrentPage() {
    if (!this.props.auth.isAuthenticated()) {
      return <LogIn auth={this.props.auth} />
    }

    return (
      <Switch>
        <Route
          path="/"
          exact
          render={props => {
            return <Todos {...props} auth={this.props.auth} />
          }}
        />

        <Route
          path="/todos/:todoId/edit"
          exact
          render={props => {
            return <EditTodo {...props} auth={this.props.auth} />
          }}
        />

        <Route component={NotFound} />
      </Switch>
    )
  }
}


text:
package com.intellij.javaee.oss.util;

import com.intellij.openapi.actionSystem.AnActionEvent;

import javax.swing.*;

public class TreeSourceAction extends OpenSourceAction {

    private final JTree tree;

    public TreeSourceAction(JTree tree) {
        super(tree);
        this.tree = tree;
    }

    @Override
    public void update(AnActionEvent event) {
        event.getPresentation().setEnabled(tree.getSelectionCount() > 0);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/dateDisplay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text=""
        android:textSize="24sp" />

    <Button
        android:id="@+id/pickDate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/change_the_date_string"
        android:textSize="24sp" />

</LinearLayout>


text:
<!DOCTYPE html>

	<title>Web Interativa com Ajax e PHP</title>

O nodo filho do documento é...


text:
module Rimpact
  class Railtie < Rails::Railtie
    rake_tasks do
      Dir.glob(File.dirname(File.expand_path(__FILE__))+'/../recipes/**/*.rake').each {|f| load f}
    end
  end
end


text:
#include <config.h>
#include <iostream>
#include <stdexcept>
#include <gnutls/gnutls.h>
#include <gnutls/gnutlsxx.h>
#include <cstring> /* for strlen */

/* A very basic TLS client, with anonymous authentication.
 * written by Eduardo Villanueva Che.
 */

#define MAX_BUF 1024
#define SA struct sockaddr

#define CAFILE "ca.pem"
#define MSG "GET / HTTP/1.0\r\n\r\n"

extern "C"
{
    int tcp_connect(void);
    void tcp_close(int sd);
}

int main(void)
{
    int sd = -1;
    gnutls_global_init();

    try
    {

        /* Allow connections to servers that have OpenPGP keys as well.
         */
        gnutls::client_session session;

        /* X509 stuff */
        gnutls::certificate_credentials credentials;

        /* sets the trusted cas file
         */
        credentials.set_x509_trust_file(CAFILE, GNUTLS_X509_FMT_PEM);
        /* put the x509 credentials to the current session
         */
        session.set_credentials(credentials);

        /* Use default priorities */
        session.set_priority ("NORMAL", NULL);

        /* connect to the peer
         */
        sd = tcp_connect();
        session.set_transport_ptr((gnutls_transport_ptr_t) (ptrdiff_t)sd);

        /* Perform the TLS handshake
         */
        int ret = session.handshake();
        if (ret < 0)
        {
            throw std::runtime_error("Handshake failed");
        }
        else
        {
            std::cout << "- Handshake was completed" << std::endl;
        }

        session.send(MSG, strlen(MSG));
        char buffer[MAX_BUF + 1];
        ret = session.recv(buffer, MAX_BUF);
        if (ret == 0)
        {
            throw std::runtime_error("Peer has closed the TLS connection");
        }
        else if (ret < 0)
        {
            throw std::runtime_error(gnutls_strerror(ret));
        }

        std::cout << "- Received " << ret << " bytes:" << std::endl;
        std::cout.write(buffer, ret);
        std::cout << std::endl;

        session.bye(GNUTLS_SHUT_RDWR);
    }
    catch (std::exception &ex)
    {
        std::cerr << "Exception caught: " << ex.what() << std::endl;
    }

    if (sd != -1)
        tcp_close(sd);

    gnutls_global_deinit();

    return 0;
}


text:
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <style>
      body {
        font-family: Monospace;
        background-color: #fff;
        color: #000;
        margin: 0px;
        overflow: hidden;
      }
      #info {
        color: #000;
        position: absolute;
        top: 10px;
        width: 100%;
        text-align: center;
        display:block;
      }
      #info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
    </style>
    <script type="text/javascript" src="build/nes.js"></script>
    <script type="text/javascript" src="https://rawgit.com/mrdoob/three.js/r87/build/three.min.js"></script>
    <script type="text/javascript" src="https://rawgit.com/mrdoob/three.js/r87/examples/js/controls/OrbitControls.js"></script>

    <!-- CRT effect shader from https://github.com/hizzlekizzle/quark-shaders/tree/master/CRT-Simple.shader -->

    <script id="vertexShader" type="x-shader/x-vertex">
      uniform vec2 tDiffuseSize;
      varying vec2 vUv;
      varying vec2 one;
      varying float mod_factor;

      #define PI 3.141592653589

      void main() {
        vUv = uv;
        one = 1.0 / tDiffuseSize.xy;
        mod_factor = uv.x * uv.x;
        vec3 pos = position;
        pos.z += sin(uv.x * PI) * 0.5 + sin(uv.y * PI) * 0.5;
        gl_Position = projectionMatrix * modelViewMatrix * vec4( pos, 1.0 );
      }
    </script>
    <script id="fragmentShader" type="x-shader/x-fragment">
      uniform sampler2D tDiffuse;
      uniform vec2 tDiffuseSize;
      varying vec2 vUv;
      varying vec2 one;
      varying float mod_factor;

      #define inputGamma  2.4
      #define outputGamma 2.2
      #define TEX2D(c) pow(texture2D(tDiffuse, (c)), vec4(inputGamma))

      vec4 scanlineWeights(float distance, vec4 color) {
        vec4 wid = 2.0 + 2.0 * pow(color, vec4(4.0));
        vec4 weights = vec4(distance / 0.3);
        return 1.4 * exp(-pow(weights * inversesqrt(0.5 * wid), wid)) / (0.6 + 0.2 * wid);
      }

      void main() {
        vec2 xy = vUv;

        vec2 ratio_scale = xy * tDiffuseSize.xy - vec2(0.5);
        vec2 uv_ratio = fract(ratio_scale);

        xy.y = (floor(ratio_scale.y) + 0.5) / tDiffuseSize.y;

        vec4 col = TEX2D(xy);
        vec4 col2 = TEX2D(xy + vec2(0.0, one.y));

        vec4 weights = scanlineWeights(uv_ratio.y, col);
        vec4 weights2 = scanlineWeights(1.0 - uv_ratio.y, col2);
        vec3 mul_res = (col * weights + col2 * weights2).rgb;

        vec3 dotMaskWeights = mix(
          vec3(1.0, 0.7, 1.0),
          vec3(0.7, 1.0, 0.7),
          floor(mod(mod_factor, 2.0))
        );

        mul_res *= dotMaskWeights;

        gl_FragColor = vec4(pow(mul_res, vec3(1.0 / outputGamma)), 1.0);
      }
    </script>
    <script type="text/javascript">
      var nes;

      /**
       *
       */
      function init() {
        var url = './roms/Sgt. Helmet - Training Day (2013)(The Mojon Twins)[!].nes';

        var request = new XMLHttpRequest();
        request.responseType = 'arraybuffer';

        request.onload = function() {
          initNes(request.response);
        };

        request.onerror = function(e) {
        };

        request.open('GET', url, true);
        request.send(null);
      }

      /**
       *
       */
      function initNes(buffer) {
	var canvas = document.createElement('canvas')

        nes = new NesJs.Nes();

        nes.setRom(new NesJs.Rom(buffer));
        nes.setDisplay(new NesJs.Display(canvas));
	nes.setAudio(new NesJs.Audio());

        window.onkeydown = function(e) { nes.handleKeyDown(e); };
        window.onkeyup = function(e) { nes.handleKeyUp(e); };

        nes.bootup();
        nes.run();

        start(canvas);
      }

      /**
       *
       */
      function start(canvas) {

        canvas.width = canvas.height = 256;

        var scene, camera, screen, renderer;

        function initScene() {

          scene = new THREE.Scene();
          scene.background = new THREE.Color( 0xffffff );

	  var light = new THREE.DirectionalLight( 0xffffff );
	  light.position.set( 20, 20, 20 );
	  scene.add( light );

          var gridHelper = new THREE.PolarGridHelper( 100, 20 );
          gridHelper.position.y = -15;
          scene.add( gridHelper );

          camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
          camera.position.z = 15;

          var geometry = new THREE.PlaneBufferGeometry( 16, 15, 50, 50 );
          var material = new THREE.ShaderMaterial( {
            uniforms: {
              tDiffuse: { value: new THREE.Texture( canvas ) },
              tDiffuseSize: { value: new THREE.Vector2( canvas.width, canvas.height ) }
            },
            vertexShader: document.getElementById( 'vertexShader' ).textContent,
            fragmentShader: document.getElementById( 'fragmentShader' ).textContent
          } );

          material.uniforms.tDiffuse.value.needsUpdate = true;

          screen = new THREE.Mesh( geometry, material );
          scene.add( screen );

          var box = new THREE.Mesh(
            new THREE.BoxBufferGeometry(19, 19, 5),
            new THREE.MeshStandardMaterial( {color: 0xFFFFFF, roughness: 0.8, metalness: 0.0 } ),
          );

          box.position.z = -2.5;

          var box2 = new THREE.Mesh(
            new THREE.BoxBufferGeometry(18, 18, 10),
            new THREE.MeshStandardMaterial( {color: 0xDDDDDD, roughness: 0.9, metalness: 0.0 } ),
          );

          box2.position.z = -10;

          scene.add( box );
          scene.add( box2 );

          renderer = new THREE.WebGLRenderer( { antialias: true } );
          renderer.setSize( window.innerWidth, window.innerHeight );

          var controls = new THREE.OrbitControls( camera, renderer.domElement );
          controls.enableKeys = false;

          document.body.appendChild( renderer.domElement );

        }

        function animate() {

          requestAnimationFrame( animate );
          screen.material.uniforms.tDiffuse.value.needsUpdate = true;
          renderer.render( scene, camera );

        }

        function onWindowResize() {

          camera.aspect = window.innerWidth / window.innerHeight;
          camera.updateProjectionMatrix();
          renderer.setSize( window.innerWidth, window.innerHeight );

        }

        initScene();
        animate();

        window.addEventListener( 'resize', onWindowResize, false );

      }
    </script>
  </head>
  <body onload="init()">
  </body>
</html>


text:
using as_autotyper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;

namespace AlliSharp
{
    //[Flags]
    //public enum ModifierKeys : uint
    //{
    //    Alt = 1,
    //    Control = 2,
    //    Shift = 4,
    //    Win = 8
    //}

    public interface IHotKeyOwner
    {
        void HotKeyPressed(int id);
    }

    public class HotKeyManager
    {
        private IHotKeyOwner owner;
        private const int WM_HOTKEY = 0x312;
        private HwndSourceHook hook;
        private HwndSource hwndsource;
        //private IntPtr handle;
        private int nextid = 1;
        //private Window window;

        //stack overflow http://stackoverflow.com/questions/2450373/set-global-hotkeys-using-c-sharp
        //private class Window : NativeWindow, IDisposable
        //{
        //    private static int WM_HOTKEY = 0x0312;
        //    private IHotKeyOwner owner;
        //    public Window(IHotKeyOwner owner)
        //    {
        //        this.owner = owner;
        //        // create the handle for the window.
        //        this.CreateHandle(new CreateParams());
        //    }

        //    /// <summary>
        //    /// Overridden to get the notifications.
        //    /// </summary>
        //    /// <param name="m"></param>
        //    protected override void WndProc(ref Message m)
        //    {
        //        base.WndProc(ref m);

        //        // check if we got a hot key pressed.
        //        if (m.Msg == WM_HOTKEY)
        //        {
        //            MessageBox.Show("asdasd");
        //            // get the keys.
        //            Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
        //            ModifierKeys modifier = (ModifierKeys)((int)m.LParam & 0xFFFF);

        //            owner.HotKeyPressed(0);
        //        }
        //    }

        //    #region IDisposable Members

        //    public void Dispose()
        //    {
        //        this.DestroyHandle();
        //    }

        //    #endregion
        //}

        public HotKeyManager(IHotKeyOwner owner, IntPtr handle)
        {
            this.owner = owner;
            this.hook = new HwndSourceHook(WndProc);
            this.hwndsource = HwndSource.FromHwnd(handle);
            hwndsource.AddHook(hook);
        }

        public int RegisterFKey(int index)
        {

            if (index < 1 || index > 12) return 0;
            Keys key = (new Keys[] { Keys.F1, Keys.F2, Keys.F3, Keys.F4, Keys.F5, Keys.F6, Keys.F7, Keys.F8, Keys.F9, Keys.F10, Keys.F11, Keys.F12 })[index - 1];
            NativeMethods.RegisterHotKey(hwndsource.Handle, nextid, 0x4000, (int)key);
            nextid++;
            return nextid - 1;
        }

        public void UnregisterFKey(int id)
        {
            NativeMethods.UnregisterHotKey(hwndsource.Handle, id);
        }

        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == WM_HOTKEY)
            {
                owner.HotKeyPressed((int)wParam);
            }

            return new IntPtr(0);
        }
    }
}


text:
@implementation CTAssetsPickerController

@dynamic delegate;

- (instancetype)init{
    if(self = [super initWithRootViewController:[[CTAssetsGroupViewController alloc] init]]){
        [self _init];
    }
    return self;
}

- (instancetype)initWithAssetsType:(CTAssetsPickerControllerAssetsType)assetsType{
    if(self = [super initWithRootViewController:[[CTAssetsGroupViewController alloc] init]]){
        [self _init];
        _assetsType = assetsType;
        switch (assetsType) {
            case CTAssetsPickerControllerAssetsTypePhoto:{
                _assetsFilter = [ALAssetsFilter allPhotos];
            }
                break;
            case CTAssetsPickerControllerAssetsTypeVideo:{
                _assetsFilter = [ALAssetsFilter allVideos];
            }
                break;
            case CTAssetsPickerControllerAssetsTypeAllAsset:{
                _assetsFilter = [ALAssetsFilter allAssets];
            }
                break;
            default:
                break;
        }
    }
    return self;
}

- (instancetype)initWithRootViewController:(UIViewController *)rootViewController{
    if(self = [super initWithRootViewController:[[CTAssetsGroupViewController alloc] init]]){
        [self _init];
    }
    return self;
}

- (void)_init{
    _assetsType = CTAssetsPickerControllerAssetsTypePhoto;
    _assetsFilter = [ALAssetsFilter allPhotos];
    _finishDismissViewController = YES;
}

- (void)viewDidLoad{
    [super viewDidLoad];

    self.navigationBar.hidden = NO;
}

- (NSArray *)selectedAssets{
    CTAssetsGroupViewController *assetsGroupViewController = (CTAssetsGroupViewController *)self.topViewController;
    return assetsGroupViewController.selectedAssets;
}

- (void)deselectAssetAtIndex:(NSUInteger)index{
    CTAssetsGroupViewController *assetsGroupViewController = (CTAssetsGroupViewController *)self.topViewController;
    [assetsGroupViewController deselectAssetAtIndex:index];
}

- (void)setToolbarItemBackgroundColor:(UIColor *)toolbarItemBackgroundColor{
    CTAssetsGroupViewController *assetsGroupViewController = (CTAssetsGroupViewController *)self.topViewController;
    [assetsGroupViewController setToolbarItemBackgroundColor:toolbarItemBackgroundColor];
}

- (void)setToolbarItemFontColor:(UIColor *)toolbarItemFontColor{
    CTAssetsGroupViewController *assetsGroupViewController = (CTAssetsGroupViewController *)self.topViewController;
    [assetsGroupViewController setToolbarItemFontColor:toolbarItemFontColor];
}

- (BOOL)shouldAutorotate{
    return NO;
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
    return UIInterfaceOrientationPortrait;
}

@end


text:
package org.dice.solrenhancements.tokenfilters;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.util.TokenFilterFactory;

import java.util.Map;

/**
 * Created by simon.hughes on 7/30/15.
 */
public class PayloadQueryBoostTokenFilterFactory extends TokenFilterFactory {

    public PayloadQueryBoostTokenFilterFactory(Map<String, String> args) {
        super(args);
    }

    @Override
    public TokenStream create(TokenStream tokenStream) {
        return new PayloadQueryBoostTokenFilter(tokenStream);
    }

}


text:
package com.dgreenshtein.yelp.challenge.entity;

/**
 * Created by davidgreenshtein on 04.07.17.
 */
public class Edge {
    private String src;
    private String dst;

    public Edge(String src, String dst) {
        super();
        this.src = src;
        this.dst = dst;
    }

    public String getSrc() {
        return src;
    }

    public String getDst() {
        return dst;
    }
}


text:
(function(){
    "use strict";

    var nativeSandbox = document.createElement("div"),
        jquerySandbox = jQuery(nativeSandbox),
        domSandbox = DOM.constructor(nativeSandbox)[0],
        className = "t" + new Date().getTime();

    document.body.appendChild(nativeSandbox);

    suite("toggleClass", function() {
        benchmark("jquery#toggleClass", function() {
            jquerySandbox.toggleClass(className);
        });

        benchmark("DOMElement#toggleClass", function() {
            domSandbox.toggleClass(className);
        });

        benchmark("native", function() {
            nativeSandbox.classList.toggle(className);
        });
    }, {
        onComplete: function() {
            document.body.removeChild(nativeSandbox);
        }
    });
}());


text:
<?php

namespace JMS\TranslationBundle\Tests\Translation\Extractor;

use Symfony\Component\HttpKernel\Log\NullLogger;
use Doctrine\Common\Annotations\DocParser;
use JMS\TranslationBundle\Translation\Extractor\File\FormExtractor;
use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Validator\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Validator\Mapping\ClassMetadataFactory;
use JMS\TranslationBundle\Translation\Extractor\File\ValidationExtractor;
use JMS\TranslationBundle\Model\FileSource;
use JMS\TranslationBundle\Model\Message;
use JMS\TranslationBundle\Model\MessageCatalogue;
use JMS\TranslationBundle\Translation\Extractor\File\TwigFileExtractor;
use JMS\TranslationBundle\Translation\Extractor\File\TranslationContainerExtractor;
use JMS\TranslationBundle\Translation\Extractor\File\DefaultPhpFileExtractor;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\IdentityTranslator;
use Symfony\Bridge\Twig\Extension\TranslationExtension as SymfonyTranslationExtension;
use JMS\TranslationBundle\Twig\TranslationExtension;
use JMS\TranslationBundle\Translation\Extractor\FileExtractor;

class FileExtractorTest extends \PHPUnit_Framework_TestCase
{
    public function testExtractWithSimpleTestFixtures()
    {
        $expected = array();
        $basePath = __DIR__.'/Fixture/SimpleTest/';

        // Controller
        $message = new Message('controller.foo');
        $message->addSource(new FileSource($basePath.'Controller/DefaultController.php', 27));
        $message->setDesc('Foo');
        $expected['controller.foo'] = $message;

        // Form Model
        $expected['form.foo'] = new Message('form.foo');
        $expected['form.bar'] = new Message('form.bar');

        // Templates
        foreach (array('php', 'twig') as $engine) {
            $message = new Message($engine.'.foo');
            $message->addSource(new FileSource($basePath.'Resources/views/'.$engine.'_template.html.'.$engine, 1));
            $expected[$engine.'.foo'] = $message;

            $message = new Message($engine.'.bar');
            $message->setDesc('Bar');
            $message->addSource(new FileSource($basePath.'Resources/views/'.$engine.'_template.html.'.$engine, 3));
            $expected[$engine.'.bar'] = $message;

            $message = new Message($engine.'.baz');
            $message->setMeaning('Baz');
            $message->addSource(new FileSource($basePath.'Resources/views/'.$engine.'_template.html.'.$engine, 5));
            $expected[$engine.'.baz'] = $message;

            $message = new Message($engine.'.foo_bar');
            $message->setDesc('Foo');
            $message->setMeaning('Bar');
            $message->addSource(new FileSource($basePath.'Resources/views/'.$engine.'_template.html.'.$engine, 7));
            $expected[$engine.'.foo_bar'] = $message;
        }

        $actual = $this->extract(__DIR__.'/Fixture/SimpleTest/')->getDomain('messages')->all();

        asort($expected);
        asort($actual);

        $this->assertEquals($expected, $actual);
    }

    private function extract($directory)
    {
        $twig = new \Twig_Environment();
        $twig->addExtension(new SymfonyTranslationExtension($translator = new IdentityTranslator(new MessageSelector())));
        $twig->addExtension(new TranslationExtension($translator));

        $docParser = new DocParser();
        $docParser->setImports(array(
                        'desc' => 'JMS\TranslationBundle\Annotation\Desc',
                        'meaning' => 'JMS\TranslationBundle\Annotation\Meaning',
                        'ignore' => 'JMS\TranslationBundle\Annotation\Ignore',
        ));
        $docParser->setIgnoreNotImportedAnnotations(true);

        $factory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));

        $extractor = new FileExtractor($twig, new NullLogger(), array(
            new DefaultPhpFileExtractor($docParser),
            new TranslationContainerExtractor(),
            new TwigFileExtractor($twig),
            new ValidationExtractor($factory),
            new FormExtractor($docParser),
        ));
        $extractor->setDirectory($directory);

        return $extractor->extract();
    }
}


text:
package hudson.plugins.git;

import hudson.Extension;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.plugins.git.opt.PreBuildMergeOptions;
import hudson.util.ListBoxModel;
import org.jenkinsci.plugins.gitclient.MergeCommand;
import org.kohsuke.stapler.DataBoundConstructor;

import java.io.Serializable;

/**
 * User-provided configuration that dictates which branch in which repository we'll be
 * merging (to the commit being built.)
 *
 */
public class UserMergeOptions extends AbstractDescribableImpl<UserMergeOptions>  implements Serializable {

    private String mergeRemote;
    private String mergeTarget;
    private String mergeStrategy;
    private MergeCommand.GitPluginFastForwardMode fastForwardMode;

    /**
     * @deprecated use the new constructor that allows to set the fast forward mode.
     * @param mergeRemote remote name used for merge
     * @param mergeTarget remote branch to be merged into currnet branch
     * @param mergeStrategy merge strategy to be used
     */
    @Deprecated
    public UserMergeOptions(String mergeRemote, String mergeTarget, String mergeStrategy) {
        this(mergeRemote, mergeTarget, mergeStrategy, MergeCommand.GitPluginFastForwardMode.FF);
    }

    /**
     * @param mergeRemote remote name used for merge
     * @param mergeTarget remote branch to be merged into current branch
     * @param mergeStrategy merge strategy
     * @param fastForwardMode fast forward mode
     */
    @DataBoundConstructor
    public UserMergeOptions(String mergeRemote, String mergeTarget, String mergeStrategy,
            MergeCommand.GitPluginFastForwardMode fastForwardMode) {
        this.mergeRemote = mergeRemote;
        this.mergeTarget = mergeTarget;
        this.mergeStrategy = mergeStrategy;
        this.fastForwardMode = fastForwardMode;
    }

    /**
     * Construct UserMergeOptions from PreBuildMergeOptions.
     * @param pbm pre-build merge options used to construct UserMergeOptions
     */
    public UserMergeOptions(PreBuildMergeOptions pbm) {
        this(pbm.getRemoteBranchName(), pbm.getMergeTarget(), pbm.getMergeStrategy().toString(), pbm.getFastForwardMode());
    }

    /**
     * Repository name, such as 'origin' that designates which repository the branch lives in.
     * @return repository name
     */
    public String getMergeRemote() {
        return mergeRemote;
    }

    /**
     * Ref in the repository that becomes the input of the merge.
     * Normally a branch name like 'master'.
     * @return branch name from which merge will be performed
     */
    public String getMergeTarget() {
        return mergeTarget;
    }

    /**
     * Ref in the repository that becomes the input of the merge, a
     * slash separated concatenation of merge remote and merge target.
     * @return ref from which merge will be performed
     */
    public String getRef() {
        return mergeRemote + "/" + mergeTarget;
    }

    public MergeCommand.Strategy getMergeStrategy() {
        for (MergeCommand.Strategy strategy: MergeCommand.Strategy.values())
            if (strategy.toString().equals(mergeStrategy))
                return strategy;
        return MergeCommand.Strategy.DEFAULT;
    }

    public MergeCommand.GitPluginFastForwardMode getFastForwardMode() {
        for (MergeCommand.GitPluginFastForwardMode ffMode : MergeCommand.GitPluginFastForwardMode.values())
            if (ffMode.equals(fastForwardMode))
                return ffMode;
        return MergeCommand.GitPluginFastForwardMode.FF;
    }

    @Override
    public String toString() {
        return "UserMergeOptions{" +
                "mergeRemote='" + mergeRemote + '\'' +
                ", mergeTarget='" + mergeTarget + '\'' +
                ", mergeStrategy='" + mergeStrategy + '\'' +
                ", fastForwardMode='" + fastForwardMode + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (other instanceof UserMergeOptions) {
            UserMergeOptions that = (UserMergeOptions) other;
            if ((mergeRemote != null && mergeRemote.equals(that.mergeRemote))
                    || (mergeRemote == null && that.mergeRemote == null)) {
                if ((mergeTarget != null && mergeTarget.equals(that.mergeTarget))
                        || (mergeTarget == null && that.mergeTarget == null)) {
                    if ((mergeStrategy != null && mergeStrategy.equals(that.mergeStrategy))
                            || (mergeStrategy == null && that.mergeStrategy == null)) {
                        if ((fastForwardMode != null && fastForwardMode.equals(that.fastForwardMode))
                                || (fastForwardMode == null && that.fastForwardMode == null)) {
                            return true;
                        }
                    }
                }
            }
        }

        return false;
    }

    @Override
    public int hashCode() {
        int result = mergeRemote != null ? mergeRemote.hashCode() : 0;
        result = 31 * result + (mergeTarget != null ? mergeTarget.hashCode() : 0);
        result = 31 * result + (mergeStrategy != null ? mergeStrategy.hashCode() : 0);
        result = 31 * result + (fastForwardMode != null ? fastForwardMode.hashCode() : 0);
        return result;
    }

    @Extension
    public static class DescriptorImpl extends Descriptor<UserMergeOptions> {

        @Override
        public String getDisplayName() {
            return "";
        }

        public ListBoxModel doFillMergeStrategyItems() {
            ListBoxModel m = new ListBoxModel();
            for (MergeCommand.Strategy strategy: MergeCommand.Strategy.values())
                m.add(strategy.toString(), strategy.toString());
            return m;
        }
    }
}


text:
using ArragroCMS.BusinessLayer.Data.Entities;
using ArragroCMS.BusinessLayer.Interfaces.CacheDomains;
using ArragroCMS.BusinessLayer.Interfaces.Domains;
using ArragroCMS.Core.DataTransformationObjects;
using ArragroCMS.Core.Models;
using ArragroCMS.Core.Web.DataTransformationObjects;
using System;
using System.Threading.Tasks;

namespace ArragroCMS.BusinessLayer.Helpers
{
    public class AssetCdnHelper
    {
        private readonly ICacheUrlRoutes _cacheUrlRoutes;
        private readonly ICacheSites _cacheSites;
        private readonly ISettings _settings;
        private readonly ConfigurationSettings _configurationSettings;

        public AssetCdnHelper(
            ICacheUrlRoutes cacheUrlRoutes,
            ICacheSites cacheSites,
            ISettings settings,
            ConfigurationSettings configurationSettings)
        {
            _cacheUrlRoutes = cacheUrlRoutes;
            _cacheSites = cacheSites;
            _settings = settings;
            _configurationSettings = configurationSettings;
        }

        private async Task<Guid> GetSiteIdAsync(Asset asset)
        {
            if (asset.UrlRoute != null)
                return asset.UrlRoute.SiteId;
            else
            {
                var urlRoute = await _cacheUrlRoutes.FindNoTrackingWithContentsAndAssetsAsync(asset.UrlRouteId).ConfigureAwait(continueOnCapturedContext: true);
                return urlRoute.SiteId;
            }
        }

        private string GetCdnUrl(
            Guid urlRouteId, Guid assetId, string fileName, string physicalLocationUrl,
            SiteDto site, CacheSettingsDto cacheSettings)
        {
            if (_configurationSettings.ApplicationSettings != null && !string.IsNullOrWhiteSpace(_configurationSettings.ApplicationSettings.OverrideAssetUrl))
            {
                return $"{_configurationSettings.ApplicationSettings.OverrideAssetUrl}/assets/{site.SiteId}/{urlRouteId}/{assetId}/{fileName}";
            }

            if (!string.IsNullOrEmpty(site.CdnUrl))
            {
                return $"{site.CdnUrl}/{urlRouteId}/{assetId}/{fileName}";
            }

            if (!string.IsNullOrEmpty(cacheSettings.CdnUrl))
            {
                return $"{cacheSettings.CdnUrl}/{site.SiteId}/{urlRouteId}/{assetId}/{fileName}";
            }

            return $"{physicalLocationUrl}";
        }

        public async Task<string> GetCdnUrlAsync(Asset asset)
        {
            var siteId = await GetSiteIdAsync(asset).ConfigureAwait(continueOnCapturedContext: true);
            var site = await _cacheSites.FindSiteAsync(siteId).ConfigureAwait(continueOnCapturedContext: true);
            var cacheSettings = await _settings.GetCacheSettingsAsync().ConfigureAwait(continueOnCapturedContext: true);
            return GetCdnUrl(asset.ContentUrlRouteId, asset.AssetId, asset.FileName, asset.PhysicalLocationUrl, site, cacheSettings);
        }

        public async Task<string> GetCdnUrlAsync(AssetDto asset)
        {
            var site = await _cacheSites.FindSiteAsync(asset.SiteId).ConfigureAwait(continueOnCapturedContext: true);
            var cacheSettings = await _settings.GetCacheSettingsAsync().ConfigureAwait(continueOnCapturedContext: true);
            return GetCdnUrl(asset.ContentUrlRouteId, asset.AssetId, asset.FileName, asset.PhysicalLocationUrl, site, cacheSettings);
        }

        private string GetCdnUrlThumbnail(
            Guid urlRouteId, Guid assetId, string fileName, string physicalLocationThumbnailUrl,
            SiteDto site, CacheSettingsDto cacheSettings)
        {
            if (_configurationSettings.ApplicationSettings != null && !string.IsNullOrWhiteSpace(_configurationSettings.ApplicationSettings.OverrideAssetUrl))
            {
                return $"{_configurationSettings.ApplicationSettings.OverrideAssetUrl}/assets/{site.SiteId}/thumbnails/{urlRouteId}/{assetId}/{fileName}";
            }

            if (!string.IsNullOrEmpty(site.CdnUrl))
            {
                return $"{site.CdnUrl}/thumbnails/{urlRouteId}/{assetId}/{fileName}";
            }

            if (!string.IsNullOrEmpty(cacheSettings.CdnUrl))
            {
                return $"{cacheSettings.CdnUrl}/{site.SiteId}/thumbnails/{urlRouteId}/{assetId}/{fileName}";
            }

            return $"{physicalLocationThumbnailUrl}";
        }

        public async Task<string> GetCdnUrlThumbnailAsync(Asset asset)
        {
            var siteId = await GetSiteIdAsync(asset).ConfigureAwait(continueOnCapturedContext: true);
            var site = await _cacheSites.FindSiteAsync(siteId).ConfigureAwait(continueOnCapturedContext: true);
            var cacheSettings = await _settings.GetCacheSettingsAsync().ConfigureAwait(continueOnCapturedContext: true);
            return GetCdnUrlThumbnail(asset.ContentUrlRouteId, asset.AssetId, asset.FileName, asset.PhysicalLocationThumbnailUrl, site, cacheSettings);
        }

        public async Task<string> GetCdnUrlThumbnailAsync(AssetDto asset)
        {
            var site = await _cacheSites.FindSiteAsync(asset.SiteId).ConfigureAwait(continueOnCapturedContext: true);
            var cacheSettings = await _settings.GetCacheSettingsAsync().ConfigureAwait(continueOnCapturedContext: true);
            return GetCdnUrlThumbnail(asset.ContentUrlRouteId, asset.AssetId, asset.FileName, asset.PhysicalLocationThumbnailUrl, site, cacheSettings);
        }
    }
}


text:
import pad from 'lodash/padStart';
import get from 'lodash/get';
import { createTranslator, formatList } from 'kolibri.utils.i18n';
import coreStringsMixin from 'kolibri.coreVue.mixins.commonCoreStrings';
import { STATUSES } from '../modules/classSummary/constants';
import { VERBS } from '../views/common/status/constants';
import { learnerProgressTranslators } from '../views/common/status/statusStrings';
import { coachStrings } from '../views/common/commonCoachStrings';

const FieldsMixinStrings = createTranslator('FieldsMixinStrings', {
  allLearners: 'All learners',
  recipientType: {
    message: 'Assigned to',
    context: 'Column header for the quiz report exported as CSV',
  },
  groupsAndIndividuals: {
    message: 'Both individual learners and groups',
    context:
      'One of the options in the quiz report exported as CSV indicating that a quiz or a lesson has been assigned to both individual learners and groups.',
  },
  wholeClass: 'Whole class',
  questionsCorrect: {
    message: 'Questions answered correctly',
    context: 'Column header for the quiz report exported as CSV',
  },
  questionsTotal: 'Total questions',
  questionsAnswered: 'Answered questions',
});

const VERB_MAP = {
  [STATUSES.notStarted]: VERBS.notStarted,
  [STATUSES.started]: VERBS.started,
  [STATUSES.helpNeeded]: VERBS.needHelp,
  [STATUSES.completed]: VERBS.completed,
};
const coreStrings = coreStringsMixin.methods.coreString;

/*
 * Common CSV export fields and formats
 */

/**
 * @param {String|Number} interval
 * @return {string}
 */
function padTime(interval) {
  return pad(interval, 2, '0');
}

export function avgScore(quiz = false) {
  return [
    {
      name: coachStrings.$tr(quiz ? 'avgQuizScoreLabel' : 'avgScoreLabel'),
      key: 'avgScore',
      format(row) {
        if (!row.avgScore && row.avgScore !== 0) {
          return '';
        }

        return coachStrings.$tr('percentage', { value: row.avgScore });
      },
    },
  ];
}

export function helpNeeded() {
  return [
    {
      name: coachStrings.$tr('helpNeededLabel'),
      key: 'helpNeeded',
      format: row => row.total - row.correct,
    },
    {
      name: FieldsMixinStrings.$tr('allLearners'),
      key: 'all',
      format: row => row.total,
    },
  ];
}

export function lastActivity() {
  return [
    {
      name: coachStrings.$tr('lastActivityLabel'),
      key: 'lastActivity',
      format(row) {
        if (!row[this.key]) {
          return '';
        }

        return row[this.key].toISOString();
      },
    },
  ];
}

export function learnerProgress(key = 'status') {
  return [
    {
      name: coreStrings('progressLabel'),
      key,
      format(row) {
        const value = get(row, key);
        const strings = learnerProgressTranslators[VERB_MAP[value]];
        return strings.$tr('labelShort', { count: 1 });
      },
    },
  ];
}

export function list(key, label) {
  return [
    {
      name: coachStrings.$tr(label),
      key,
      format(row) {
        const value = get(row, key);

        if (value && value.length) {
          return formatList(value);
        }

        return '';
      },
    },
  ];
}

export function name(label = 'nameLabel') {
  return [
    {
      name: coachStrings.$tr(label),
      key: 'name',
    },
  ];
}

export function recipients(className) {
  return [
    {
      name: FieldsMixinStrings.$tr('recipientType'),
      key: 'recipientType',
      format(row) {
        const { recipientNames = [] } = row;
        if (recipientNames.length === 0 && row.hasAssignments) {
          return FieldsMixinStrings.$tr('wholeClass');
        } else {
          const numGroups = get(row, 'groupNames.length', -1);
          // If there are more recipients than groups, then there must be some individual learners
          return recipientNames.length > numGroups
            ? FieldsMixinStrings.$tr('groupsAndIndividuals') // At least one individual recipient
            : coachStrings.$tr('groupsLabel'); // Groups only
        }
      },
    },
    {
      name: coachStrings.$tr('recipientsLabel'),
      key: 'groupNames',
      format(row) {
        const { recipientNames = [] } = row;
        if (recipientNames.length === 0 && row.hasAssignments) {
          return className || FieldsMixinStrings.$tr('wholeClass');
        } else {
          return formatList(recipientNames);
        }
      },
    },
  ];
}

export function score() {
  return [
    {
      name: coachStrings.$tr('scoreLabel'),
      key: 'score',
      format: row => {
        if (!row.statusObj.score && row.statusObj.score !== 0) {
          return '';
        }

        return coachStrings.$tr('percentage', { value: row.statusObj.score });
      },
    },
  ];
}

export function tally() {
  return [
    {
      name: coreStrings('notStartedLabel'),
      key: 'tally.notStarted',
    },
    {
      name: coachStrings.$tr('startedLabel'),
      key: 'tally.started',
    },
    {
      name: coreStrings('completedLabel'),
      key: 'tally.completed',
    },
    {
      name: coachStrings.$tr('helpNeededLabel'),
      key: 'tally.helpNeeded',
    },
  ];
}

export function timeSpent(key, label = 'timeSpentLabel') {
  return [
    {
      name: coachStrings.$tr(label),
      key,
      format(row) {
        const value = get(row, key);
        const timeSpent = parseInt(value, 10);

        if (!timeSpent) {
          return '';
        }

        const hours = Math.floor(timeSpent / 3600);
        const minutes = Math.floor((timeSpent - hours * 3600) / 60);
        const seconds = timeSpent - hours * 3600 - minutes * 60;

        return `${padTime(hours)}:${padTime(minutes)}:${padTime(seconds)}`;
      },
    },
  ];
}

export function title() {
  return [
    {
      name: coachStrings.$tr('titleLabel'),
      key: 'title',
    },
  ];
}

export function quizQuestionsAnswered(quiz) {
  return [
    {
      name: FieldsMixinStrings.$tr('questionsAnswered'),
      key: 'quizQuestionsAnswered',
      format(row) {
        return get(row, 'statusObj.num_answered');
      },
    },
    {
      name: FieldsMixinStrings.$tr('questionsCorrect'),
      key: 'quizQuestionsAnswered',
      format(row) {
        return get(row, 'statusObj.num_correct');
      },
    },
    {
      name: FieldsMixinStrings.$tr('questionsTotal'),
      key: 'quizQuestionsTotal',
      format() {
        return quiz.question_count;
      },
    },
  ];
}


text:
function [molecules_out,cid_out] = molecules_from_cluster_definition(clusterlist,nlist,alternativenames)

%initialize molecules structure
molecules_out=[];

system=zeros(1,length(clusterlist));

% generate convolutions for every cluster in clusterlist.
% i.e. [C60]1, [C60]2, [C60]3, [CO2]1, [CO2]2, [CO2]3, [CO2]4
% save them in cluster structure
% cluster{1}.name='C60' (alternative name, if exists)
% cluster{1}.sumformula='C60' (sumformula for monomer)
% cluster{1}.peakdata{i}... masses and abundances for [C60]i, i=1..nend

for i=1:length(alternativenames)-1
    fprintf(' %s +',alternativenames{i});
end
fprintf(' %s... ',alternativenames{end});

for i=1:length(clusterlist)
    cluster(i).nend=nlist{i}(end);
    cluster(i).nstart=nlist{i}(1);
    cluster(i).cid=sum_formula2cid(clusterlist{i});

    system(i)=length(nlist{i});%a number system with varible basis

    cluster(i).name=alternativenames{i};
    cluster(i).sum_formula=clusterlist{i};
end

cid_out=uint16(zeros(prod(system),118));

fprintf('%i combinations. ',prod(system));

parfor i=1:prod(system) %number of combinations=product of basis numbers in varible number system
    moleculename='';
    sum_formula='';
    clusternumbers=ten2variablesystem(i-1,system);

    cid=uint16(zeros(1,118));

    for j=1:length(clusternumbers);
        multimer_number=nlist{j}(clusternumbers(j)+1);
        cid=cid+cluster(j).cid*multimer_number;
        if multimer_number>0
            if multimer_number==1
                moleculename=[moleculename '[' cluster(j).name ']'];
                sum_formula=[sum_formula cluster(j).sum_formula];
            else
                moleculename=[moleculename '[' cluster(j).name ']' num2str(multimer_number)];
                sum_formula=[sum_formula '(' cluster(j).sum_formula ')' num2str(multimer_number)];
            end
        end
    end

    molecules_out(i).name=moleculename;
    molecules_out(i).sum_formula=sum_formula;
    molecules_out(i).cid=cid;
    cid_out(i,:)=cid;
end

if isempty(molecules_out(1).name) % the "zero-cluster"
   molecules_out=molecules_out(2:end);
   cid_out=cid_out(2:end,:);
end

fprintf('done.\n');

end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Enum. critic. lich. europ. (Bern) 77 (1784)

#### Original name
Lichen angustatus Hoffm.

### Remarks
null


text:
package com.pongasoft.kiwidoc.model.tag;

import com.pongasoft.kiwidoc.model.resource.ResolvableResource;

import java.util.Collection;

/**
 * Represents a @see/@link tag.
 *
 * @author yan@pongasoft.com
 */
public class InlineLinkTag implements InlineTag
{
  private final String _text;
  private final LinkReference _linkReference;

  /**
   * Constructor
   */
  public InlineLinkTag(String text,
                       LinkReference linkReference)
  {
    _text = text;
    _linkReference = linkReference;
  }

  /**
   * @return the kind of this tag
   * @see Kind
   */
  public Kind getKind()
  {
    return Kind.LINK;
  }

  /**
   * @return the text
   */
  public String getText()
  {
    return _text;
  }

  /**
   * @return true if it corresponds to the inheritDoc tag from javadoc
   */
  public boolean isInheritDoc()
  {
    return false;
  }

  public LinkReference getLinkReference()
  {
    return _linkReference;
  }

  /**
   * Collect the dependencies in the collection.
   *
   * @param dependencies to add the dependencies to it
   */
  public void collectDependencies(Collection<ResolvableResource> dependencies)
  {
    _linkReference.collectDependencies(dependencies);
  }

  @Override
  public String toString()
  {
    final StringBuilder sb = new StringBuilder();
    sb.append("{@link ");
    sb.append(getLinkReference().getRawReference());
    String text = getText();
    if(!("".equals(text)))
      sb.append(' ').append(text);
    sb.append('}');
    return sb.toString();
  }
}


text:
package com.javarush.task.task37.task3712;

/**
 * Created by Alexey Vedensky on 17.04.2017.
 * MAIL: avedensky@gmail.com
 */
public abstract class Game {
    public abstract void prepareForTheGame();

    public abstract void playGame();

    public abstract void congratulateWinner();

    public void run () {
        prepareForTheGame();
        playGame();
        congratulateWinner();
    }

}


text:
.. _bigWig:

bigWig example
----------------
You can read more about preparing the files necessary for a bigWig track
on `UCSC's bigWig help page
<https://genome.ucsc.edu/goldenPath/help/bigWig.html>`_. The following code
uses the example files provided by UCSC.

This code is automatically run and the built trackhub is uploaded to the
`trackhub-demo <https://github.com/daler/trackhub-demo>`_ repository. You can
view the live hub using `this link <http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&hubUrl=https://raw.githubusercontent.com/daler/trackhub-demo/master/example_bigWig_hub/bigWig.hub.txt&position=chr21:33031597-33041570>`_.

.. code-block:: python

    import trackhub

    hub, genomes_file, genome, trackdb = trackhub.default_hub(
        hub_name="bigWig",
        defaultPos="chr21:33031597-33041570",
        short_label="bigWig",
        long_label="bigWig",
        genome="hg19",
        email="eva.jason@nih.gov",
    )

    track = trackhub.Track(
        name="bigWig",
        tracktype="bigWig",
        bigDataUrl="http://genome.ucsc.edu/goldenPath/help/examples/bigWigExample.bw",
        shortLabel="Example Hub",
        longLabel="Example Hub",
        visibility="full",
    )
    trackdb.add_tracks(track)

    trackhub.upload.upload_hub(
        hub=hub, host="localhost", remote_dir="example_hubs/example_bigWig_hub"
    )


text:
<Type Name="MusicBrainzQueryJob" FullName="Banshee.Metadata.MusicBrainz.MusicBrainzQueryJob">
  <TypeSignature Language="C#" Value="public class MusicBrainzQueryJob : Banshee.Metadata.MetadataServiceJob" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MusicBrainzQueryJob extends Banshee.Metadata.MetadataServiceJob" />
  <AssemblyInfo>
    <AssemblyName>Banshee.Services</AssemblyName>
    <AssemblyVersion>0.90.1.25404</AssemblyVersion>
    <AssemblyVersion>1.3.1.0</AssemblyVersion>
    <AssemblyVersion>1.4.0.0</AssemblyVersion>
    <AssemblyVersion>2.4.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>Banshee.Metadata.MetadataServiceJob</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public MusicBrainzQueryJob (Banshee.Collection.IBasicTrackInfo track);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Banshee.Collection.IBasicTrackInfo track) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.3.1.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>2.4.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters>
        <Parameter Name="track" Type="Banshee.Collection.IBasicTrackInfo" />
      </Parameters>
      <Docs>
        <param name="track">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public MusicBrainzQueryJob (Banshee.Collection.IBasicTrackInfo track, string asin);" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.3.1.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters>
        <Parameter Name="track" Type="Banshee.Collection.IBasicTrackInfo" />
        <Parameter Name="asin" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="track">To be added.</param>
        <param name="asin">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Lookup">
      <MemberSignature Language="C#" Value="public bool Lookup ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool Lookup() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.3.1.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>2.4.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        To be added.
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Run">
      <MemberSignature Language="C#" Value="public override void Run ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Run() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.4.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
package mtr.render;

import mtr.mappings.RenderLayerMapper;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;

public class MoreRenderLayers extends RenderLayerMapper {

	private static final Map<String, RenderType> LIGHT_CACHE = new HashMap<>();
	private static final Map<ResourceLocation, RenderType> INTERIOR_CACHE = new HashMap<>();
	private static final Map<ResourceLocation, RenderType> INTERIOR_TRANSLUCENT_CACHE = new HashMap<>();
	private static final Map<ResourceLocation, RenderType> EXTERIOR_CACHE = new HashMap<>();
	private static final Map<ResourceLocation, RenderType> EXTERIOR_TRANSLUCENT_CACHE = new HashMap<>();

	public static RenderType getLight(ResourceLocation texture, boolean isTranslucent) {
		return checkCache(texture.toString() + isTranslucent, () -> beaconBeam(texture, isTranslucent), LIGHT_CACHE);
	}

	public static RenderType getInterior(ResourceLocation texture) {
		return checkCache(texture, () -> entityCutout(texture), INTERIOR_CACHE);
	}

	public static RenderType getInteriorTranslucent(ResourceLocation texture) {
		return checkCache(texture, () -> entityTranslucentCull(texture), INTERIOR_TRANSLUCENT_CACHE);
	}

	public static RenderType getExterior(ResourceLocation texture) {
		return checkCache(texture, () -> entityCutout(texture), EXTERIOR_CACHE);
	}

	public static RenderType getExteriorTranslucent(ResourceLocation texture) {
		return checkCache(texture, () -> entityTranslucentCull(texture), EXTERIOR_TRANSLUCENT_CACHE);
	}

	private static <T> RenderType checkCache(T identifier, Supplier<RenderType> supplier, Map<T, RenderType> cache) {
		if (cache.containsKey(identifier)) {
			return cache.get(identifier);
		} else {
			final RenderType renderLayer = supplier.get();
			cache.put(identifier, renderLayer);
			return renderLayer;
		}
	}
}


text:
![Logo](https://raw.githubusercontent.com/zendframework/zf2/234b554f2ca202095aea32e4fa557553f8849664/resources/ZendFramework-logo.png)

# Welcome to the *Zend Framework 2.5* Release!

## RELEASE INFORMATION

*Zend Framework 2.5.1*

This is the first maintenance release for the version 2.5 series.

04 June 2015

### UPDATES IN 2.5.1

- [#7571](https://github.com/zendframework/zf2/pull/7571) makes `zend-ldap` an
  optional dependency instead of a hard dependency, as `zend-ldap` has a hard
  requirement on `ext-ldap`, blocking installation for many users. If you use
  `zend-ldap`, you will need to call `composer require zendframework/zend-ldap`
  after upgrading to 2.5.1.

Please see [CHANGELOG.md](CHANGELOG.md).

### SYSTEM REQUIREMENTS

Zend Framework 2 requires PHP 5.5 or later; we recommend using the
latest PHP version whenever possible.

### INSTALLATION

```console
$ composer require zendframework/zendframework
```

#### GETTING STARTED

A great place to get up-to-speed quickly is the Zend Framework
QuickStart:

http://framework.zend.com/manual/current/en/user-guide/overview.html

The QuickStart covers some of the most commonly used components of ZF.
Since Zend Framework is designed with a use-at-will architecture and
components are loosely coupled, you can select and use only those
components that are needed for your project.

### COMPONENTS

This package is a metapackage aggregating the following components:

- [zend-authentication](https://github.com/zendframework/zend-authentication)
- [zend-barcode](https://github.com/zendframework/zend-barcode)
- [zend-cache](https://github.com/zendframework/zend-cache)
- [zend-captcha](https://github.com/zendframework/zend-captcha)
- [zend-code](https://github.com/zendframework/zend-code)
- [zend-config](https://github.com/zendframework/zend-config)
- [zend-console](https://github.com/zendframework/zend-console)
- [zend-crypt](https://github.com/zendframework/zend-crypt)
- [zend-db](https://github.com/zendframework/zend-db)
- [zend-debug](https://github.com/zendframework/zend-debug)
- [zend-di](https://github.com/zendframework/zend-di)
- [zend-dom](https://github.com/zendframework/zend-dom)
- [zend-escaper](https://github.com/zendframework/zend-escaper)
- [zend-eventmanager](https://github.com/zendframework/zend-eventmanager)
- [zend-feed](https://github.com/zendframework/zend-feed)
- [zend-file](https://github.com/zendframework/zend-file)
- [zend-filter](https://github.com/zendframework/zend-filter)
- [zend-form](https://github.com/zendframework/zend-form)
- [zend-http](https://github.com/zendframework/zend-http)
- [zend-i18n](https://github.com/zendframework/zend-i18n)
- [zend-inputfilter](https://github.com/zendframework/zend-inputfilter)
- [zend-json](https://github.com/zendframework/zend-json)
- [zend-ldap](https://github.com/zendframework/zend-ldap)
- [zend-loader](https://github.com/zendframework/zend-loader)
- [zend-log](https://github.com/zendframework/zend-log)
- [zend-mail](https://github.com/zendframework/zend-mail)
- [zend-math](https://github.com/zendframework/zend-math)
- [zend-memory](https://github.com/zendframework/zend-memory)
- [zend-mime](https://github.com/zendframework/zend-mime)
- [zend-modulemanager](https://github.com/zendframework/zend-modulemanager)
- [zend-mvc](https://github.com/zendframework/zend-mvc)
- [zend-navigation](https://github.com/zendframework/zend-navigation)
- [zend-paginator](https://github.com/zendframework/zend-paginator)
- [zend-permissions-acl](https://github.com/zendframework/zend-permissions-acl)
- [zend-permissions-rbac](https://github.com/zendframework/zend-permissions-rbac)
- [zend-progressbar](https://github.com/zendframework/zend-progressbar)
- [zend-serializer](https://github.com/zendframework/zend-serializer)
- [zend-server](https://github.com/zendframework/zend-server)
- [zend-servicemanager](https://github.com/zendframework/zend-servicemanager)
- [zend-session](https://github.com/zendframework/zend-session)
- [zend-soap](https://github.com/zendframework/zend-soap)
- [zend-stdlib](https://github.com/zendframework/zend-stdlib)
- [zend-tag](https://github.com/zendframework/zend-tag)
- [zend-test](https://github.com/zendframework/zend-test)
- [zend-text](https://github.com/zendframework/zend-text)
- [zend-uri](https://github.com/zendframework/zend-uri)
- [zend-validator](https://github.com/zendframework/zend-validator)
- [zend-version](https://github.com/zendframework/zend-version)
- [zend-view](https://github.com/zendframework/zend-view)
- [zend-xmlrpc](https://github.com/zendframework/zend-xmlrpc)
- [ZendXml](https://github.com/zendframework/ZendXml)

### CONTRIBUTING

If you wish to contribute to Zend Framework, please read the
[CONTRIBUTING.md](CONTRIBUTING.md) file.

### QUESTIONS AND FEEDBACK

Online documentation can be found at http://framework.zend.com/manual.
Questions that are not addressed in the manual should be directed to the
appropriate mailing list:

http://framework.zend.com/archives/subscribe/

If you find code in this release behaving in an unexpected manner or
contrary to its documented behavior, please create an issue in our GitHub
issue tracker:

https://github.com/zendframework/zf2/issues

If you would like to be notified of new releases, you can subscribe to
the fw-announce mailing list by sending a blank message to
<fw-announce-subscribe@lists.zend.com>.

## Reporting Potential Security Issues

If you have encountered a potential security vulnerability in Zend Framework, please report it to us at [zf-security@zend.com](mailto:zf-security@zend.com). We will work with you to verify the vulnerability and patch it.

When reporting issues, please provide the following information:

- Component(s) affected
- A description indicating how to reproduce the issue
- A summary of the security vulnerability and impact

We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure; this helps protect Zend Framework users and provides them with a chance to upgrade and/or update in order to protect their applications.

For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).

### LICENSE

The files in this archive are released under the Zend Framework license.
You can find a copy of this license in [LICENSE.md](LICENSE.md).

### ACKNOWLEDGEMENTS

The Zend Framework team would like to thank all the [contributors](https://github.com/zendframework/zf2/contributors) to the Zend
Framework project, our corporate sponsor, and you, the Zend Framework user.
Please visit us sometime soon at http://framework.zend.com.


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>The Wandering Heart Project - Homepage</title>

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

    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Josefin+Slab:100,300,400,600,700,100italic,300italic,400italic,600italic,700italic" rel="stylesheet" type="text/css">

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

The Wandering Heart Project

        The Wandering Heart Project
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">

        </button>

              Home(current)

              About

              Blog

              Contact

Our Story

            Previous

            Next

Welcome To

The Wandering Heart Project

By:
            Ordinary adventurers in an extraordinary world

          This site is currently under construction, Please check back soon :-)

Please check back soon!

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

Copyright © thewanderingheartproject.com 2017


text:
package org.jetbrains.idea.svn.info;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.idea.svn.api.Revision;
import org.jetbrains.idea.svn.api.SvnClient;
import org.jetbrains.idea.svn.api.Target;
import org.jetbrains.idea.svn.commandLine.SvnBindException;

import java.io.File;
import java.util.Collection;

public interface InfoClient extends SvnClient {

  Info doInfo(@NotNull File path, @Nullable Revision revision) throws SvnBindException;

  Info doInfo(@NotNull Target target, @Nullable Revision revision) throws SvnBindException;

  void doInfo(@NotNull Collection<File> paths, @Nullable InfoConsumer handler) throws SvnBindException;
}


text:
#ifndef __curve_h_
#define __curve_h_
#ifdef __cplusplus
extern "C" {
#endif
	/**
		This module is ported from threepp
		Curve
	*/
	#define arcLengthDivisions 200
	typedef struct _Vector2{
		float x, y;
	}Vector2;
	typedef Vector2(*getPoint)(void*, float);
	typedef struct _ArrayNode {
		float* _Head;
		int size;
		int cap;
	}ArrayNode;
	typedef struct _Curve
	{
		ArrayNode _cacheArcLengths;
		int _needsUpdate;
		getPoint getPointFunc;
		void* child;
	} Curve;
	Curve* InitCurve();
	freeCruve(Curve* cur);
	void Vector2normalize(Vector2* vec);
	float distanceTo(Vector2* v1, Vector2* v2);
	void pushArray(ArrayNode* arr, float val);
	void freeArray(ArrayNode* arr);
	// Get total curve arc length
	float getLength(Curve* curve);
	// Get list of cumulative segment lengths
	ArrayNode getLengths(Curve* cruve, unsigned divisions);
	// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant
	float getUtoTmapping(Curve* curve, float u, float distance);
	// Get point at relative position in curve according to arc length
	// - u [0 .. 1]
	Vector2 getPointAt(Curve* curve, float u);
	void updateArcLengths(Curve* curve);
	Vector2 getTangent(Curve* curve, float t);
	void getPoints(Curve* curve, unsigned int divisions, float** x, float** y);
#ifdef __cplusplus
}
#endif
#endif/* __curve_h_ */


text:
import fs from 'fs';
import path from 'path';
import {serial as test} from 'ava';
import del from 'del';
import {directory as tempDirectory} from 'tempy';
import findCacheDir from '.';

test('finds from a list of files', t => {
	process.chdir(path.join(__dirname, '..'));
	const files = ['foo/bar', 'baz/quz'].map(file => path.join(__dirname, file));
	t.is(findCacheDir({files, name: 'blah'}), path.join(__dirname, 'node_modules', '.cache', 'blah'));
});

test('finds from process.cwd', t => {
	process.chdir(path.join(__dirname));
	t.is(findCacheDir({name: 'foo'}), path.join(__dirname, 'node_modules', '.cache', 'foo'));
});

test('finds from options.cwd', t => {
	process.chdir(path.join(__dirname, '..'));
	t.is(findCacheDir({cwd: __dirname, name: 'bar'}), path.join(__dirname, 'node_modules', '.cache', 'bar'));
});

test('creates dir', t => {
	const directory = path.join(__dirname, 'node_modules', '.cache', 'created');
	del.sync(directory);
	findCacheDir({create: true, name: 'created', cwd: __dirname});
	t.true(fs.existsSync(directory));
});

test('thunk', t => {
	const directory = path.join(__dirname, 'node_modules', '.cache', 'thunked');
	del.sync(directory);
	const thunk = findCacheDir({thunk: true, name: 'thunked', cwd: __dirname});
	t.is(thunk('foo'), path.join(directory, 'foo'));
	t.is(thunk('bar'), path.join(directory, 'bar'));
});

test('returns undefined if it can\'t find package.json', t => {
	process.chdir(path.join(__dirname, '..'));
	t.is(findCacheDir({name: 'foo'}), undefined);
});

test('supports CACHE_DIR environment variable', t => {
	const newCacheDirectory = tempDirectory();
	const finalDirectory = path.join(newCacheDirectory, 'some-package');
	process.env.CACHE_DIR = newCacheDirectory;

	t.is(findCacheDir({name: 'some-package'}), finalDirectory);

	findCacheDir({name: 'some-package', create: true});
	t.true(fs.existsSync(finalDirectory));

	const thunk = findCacheDir({name: 'some-package', thunk: true});
	t.is(thunk('foo'), path.join(finalDirectory, 'foo'));
	t.is(thunk('bar'), path.join(finalDirectory, 'bar'));

	delete process.env.CACHE_DIR;
});

test('ignores `false` for CACHE_DIR environment variable', t => {
	process.env.CACHE_DIR = 'false';

	t.not(findCacheDir(), path.resolve(__dirname, 'false', 'find-cache-dir'));
});


text:
const config = require('config');
const Sequelize = require('sequelize');
const debug = require('debug')(`${config.app.tag}:db`);
const Promise = require('bluebird');
const argv = require('yargs').argv;
const path = require('path');
const fs = require('fs');
const Migration = require('./migration');
const Seeder = require('./seeder');
const Emitter = require('events');
const util = require('util');

const options = {
    dialect: config.db.type
};

if (options.dialect === 'sqlite') {
    options.storage = config.db.database;
} else {
    options.database = config.db.database;
}

if (config.db.host) {
    options.host = config.db.host;
}
if (config.db.port) {
    options.host = config.db.port;
}
if (config.db.username) {
    options.username = config.db.username;
}
if (config.db.password) {
    options.password = config.db.password;
}

options.logging = false;

util.inherits(Sequelize, Emitter);
const sequelize = new Sequelize(options);

function execute(dir, callback) {
    const fs = require('fs');
    if (typeof callback !== 'function') {
        callback = m => m;
    }
    return new Promise((resolve, reject) => {
        fs.readdir(dir, (err, files) => {
            if (err) {
                reject(err);
            } else {
                const modules = files.filter(f => /.js$/.test(f)).map(f => path.join(dir, f));
                resolve(Promise.reduce(modules, (t, c) => callback(require(c), t), Promise.resolve(modules)));
            }
        });
    });
}

sequelize.authenticate()
    .then(() => {
        debug('Connection has been established successfully.');
        if (process.env.MIGRATE !== undefined || argv.migrate !== undefined) {
            const dir = path.join(__dirname, '../../', String(process.env.MIGRATE ? process.env.MIGRATE : argv.migrate));
            const force = process.env.FORCE !== undefined || argv.force !== undefined;
            return execute(path.join(__dirname, '../models'))
                .then(() => sequelize.sync({
                    force
                }))
                .then(() => execute(fs.existsSync(dir) ? dir : path.join(__dirname, 'migrations'), (Type, modules) => {
                    if (typeof Type === 'function' && Type.prototype instanceof Migration) {
                        const migration = new Type({
                            force
                        });
                        return migration.up().then(() => modules);
                    }
                }))
                .then(modules => {
                    debug('Migration complete: %O', modules);
                });
        }
    })
    .then(() => {
        if (process.env.SEED !== undefined || argv.seed !== undefined) {
            const dir = path.join(__dirname, '../../', String(process.env.SEED ? process.env.SEED : argv.seed));
            return execute(fs.existsSync(dir) ? dir : path.join(__dirname, 'seeders'), (Type, modules) => {
                    if (typeof Type === 'function' && Type.prototype instanceof Seeder) {
                        const seeder = new Type();
                        return seeder.run().then(() => modules);
                    }
                })
                .then(modules => {
                    debug('Seeding complete: %O', modules);
                });
        }
    })
    .then(() => {
        sequelize.emit('ready');
    })
    .catch(err => {
        debug('Unable to initialize the database: %s', err);
        sequelize.emit('error', err);
    })
    .asCallback(err => sequelize.emit('initialized', err));

module.exports = sequelize;


text:
package proguard.obfuscate;

import proguard.classfile.*;
import proguard.classfile.util.*;
import proguard.classfile.visitor.*;

import java.io.PrintStream;

/**
 * This ClassVisitor prints out the renamed classes and class members with
 * their old names and new names.
 *
 * @see ClassRenamer
 *
 * @author Eric Lafortune
 */
public class MappingPrinter
extends      SimplifiedVisitor
implements   ClassVisitor,
             MemberVisitor
{
    private final PrintStream ps;

    /**
     * Creates a new MappingPrinter that prints to System.out.
     */
    public MappingPrinter()
    {
        this(System.out);
    }

    /**
     * Creates a new MappingPrinter that prints to the given stream.
     * @param printStream the stream to which to print
     */
    public MappingPrinter(PrintStream printStream)
    {
        this.ps = printStream;
    }

    // Implementations for ClassVisitor.

    public void visitProgramClass(ProgramClass programClass)
    {
        String name    = programClass.getName();
        String newName = ClassObfuscator.newClassName(programClass);

        ps.println(ClassUtil.externalClassName(name) +
                   " -> " +
                   ClassUtil.externalClassName(newName) +
                   ":");

        // Print out the class members.
        programClass.fieldsAccept(this);
        programClass.methodsAccept(this);
    }

    public void visitLibraryClass(LibraryClass libraryClass)
    {
    }

    // Implementations for MemberVisitor.

    public void visitProgramField(ProgramClass programClass, ProgramField programField)
    {
        String newName = MemberObfuscator.newMemberName(programField);
        if (newName != null)
        {
            ps.println("    " +
                       //lineNumberRange(programClass, programField) +
                       ClassUtil.externalFullFieldDescription(
                           0,
                           programField.getName(programClass),
                           programField.getDescriptor(programClass)) +
                       " -> " +
                       newName);
        }
    }

    public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
    {
        // Special cases: <clinit> and <init> are always kept unchanged.
        // We can ignore them here.
        String name = programMethod.getName(programClass);
        if (name.equals(ClassConstants.INTERNAL_METHOD_NAME_CLINIT) ||
            name.equals(ClassConstants.INTERNAL_METHOD_NAME_INIT))
        {
            return;
        }

        String newName = MemberObfuscator.newMemberName(programMethod);
        if (newName != null)
        {
            ps.println("    " +
                       lineNumberRange(programClass, programMethod) +
                       ClassUtil.externalFullMethodDescription(
                           programClass.getName(),
                           0,
                           programMethod.getName(programClass),
                           programMethod.getDescriptor(programClass)) +
                       " -> " +
                       newName);
        }
    }

    // Small utility methods.

    /**
     * Returns the line number range of the given class member, followed by a
     * colon, or just an empty String if no range is available.
     */
    private static String lineNumberRange(ProgramClass programClass, ProgramMember programMember)
    {
        String range = programMember.getLineNumberRange(programClass);
        return range != null ?
            (range + ":") :
            "";
    }
}


text:
<?php
/**
 * Elgg Test ElggUser
 *
 * @package Elgg
 * @subpackage Test
 */
class ElggCoreUserTest extends ElggCoreUnitTest {

	/**
	 * Called before each test object.
	 */
	public function __construct() {
		parent::__construct();

		// all code should come after here
	}

	/**
	 * Called before each test method.
	 */
	public function setUp() {
		$this->user = new ElggUserTest();
	}

	/**
	 * Called after each test method.
	 */
	public function tearDown() {

		unset($this->user);
	}

	/**
	 * Called after each test object.
	 */
	public function __destruct() {
		// all code should go above here
		parent::__destruct();
	}

	public function testElggUserConstructor() {
		$attributes = array();
		$attributes['guid'] = null;
		$attributes['type'] = 'user';
		$attributes['subtype'] = null;
		$attributes['owner_guid'] = elgg_get_logged_in_user_guid();
		$attributes['container_guid'] = elgg_get_logged_in_user_guid();
		$attributes['site_guid'] = null;
		$attributes['access_id'] = ACCESS_PRIVATE;
		$attributes['time_created'] = null;
		$attributes['time_updated'] = null;
		$attributes['last_action'] = null;
		$attributes['enabled'] = 'yes';
 		$attributes['name'] = null;
		$attributes['username'] = null;
		$attributes['password'] = null;
		$attributes['salt'] = null;
		$attributes['email'] = null;
		$attributes['language'] = null;
		$attributes['banned'] = 'no';
		$attributes['admin'] = 'no';
		$attributes['prev_last_action'] = null;
		$attributes['last_login'] = null;
		$attributes['prev_last_login'] = null;
		ksort($attributes);

		$entity_attributes = $this->user->expose_attributes();
		ksort($entity_attributes);

		$this->assertIdentical($entity_attributes, $attributes);
	}

	public function testElggUserLoad() {
		// new object
		$object = new ElggObject();
		$this->AssertEqual($object->getGUID(), 0);
		$guid = $object->save();
		$this->AssertNotEqual($guid, 0);

		// fail on wrong type
		$this->assertFalse(get_user($guid));

		// clean up
		$object->delete();
	}

	public function testElggUserConstructorWithGarbage() {
		try {
			$error = new ElggUserTest(array('invalid'));
			$this->assertTrue(false);
		} catch (Exception $e) {
			$this->assertIsA($e, 'InvalidParameterException');
		}
	}

	public function testElggUserConstructorByDbRow() {
		$row = $this->fetchUser(elgg_get_logged_in_user_guid());
		$user = new ElggUser($row);
		$this->assertIdenticalEntities($user, $_SESSION['user']);
	}

	public function testElggUserSave() {
		// new object
		$this->AssertEqual($this->user->getGUID(), 0);
		$guid = $this->user->save();
		$this->AssertNotEqual($guid, 0);

		// clean up
		$this->user->delete();
	}

	public function testElggUserDelete() {
		$guid = $this->user->save();

		// delete object
		$this->assertIdentical(true, $this->user->delete());

		// check GUID not in database
		$this->assertFalse($this->fetchUser($guid));
	}

	public function testElggUserNameCache() {
		// issue https://github.com/elgg/elgg/issues/1305

		// very unlikely a user would have this username
		$name = (string)time();
		$this->user->username = $name;

		$guid = $this->user->save();

		$user = get_user_by_username($name);
		$user->delete();
		$user = get_user_by_username($name);
		$this->assertFalse($user);
	}

	public function testGetUserByUsernameAcceptsUrlEncoded() {
		$username = (string)time();
		$this->user->username = $username;
		$guid = $this->user->save();

		// percent encode first letter
		$first_letter = $username[0];
		$first_letter = str_pad('%' . dechex(ord($first_letter)), 2, '0', STR_PAD_LEFT);
		$username =   $first_letter . substr($username, 1);

		$user = get_user_by_username($username);
		$this->assertTrue((bool) $user);
		$this->assertEqual($guid, $user->guid);

		$this->user->delete();
	}

	public function testElggUserMakeAdmin() {
		global $CONFIG;

		// need to save user to have a guid
		$guid = $this->user->save();

		$this->assertTrue($this->user->makeAdmin());

		$q = "SELECT admin FROM {$CONFIG->dbprefix}users_entity WHERE guid = $guid";
		$r = mysql_query($q);

		$admin = mysql_fetch_assoc($r);
		$this->assertEqual($admin['admin'], 'yes');

		$this->user->delete();
	}

	public function testElggUserRemoveAdmin() {
		global $CONFIG;

		// need to save user to have a guid
		$guid = $this->user->save();

		$this->assertTrue($this->user->removeAdmin());

		$q = "SELECT admin FROM {$CONFIG->dbprefix}users_entity WHERE guid = $guid";
		$r = mysql_query($q);

		$admin = mysql_fetch_assoc($r);
		$this->assertEqual($admin['admin'], 'no');

		$this->user->delete();
	}

	public function testElggUserIsAdmin() {
		// need to grab a real user with a guid and everything.
		$guid = $this->user->save();

		$this->assertTrue($this->user->makeAdmin());

		// this is testing the function, not the SQL.
		// that's been tested above.
		$this->assertTrue($this->user->isAdmin());

		$this->user->delete();
	}

	public function testElggUserIsNotAdmin() {
		// need to grab a real user with a guid and everything.
		$guid = $this->user->save();

		$this->assertTrue($this->user->removeAdmin());

		// this is testing the function, not the SQL.
		// that's been tested above.
		$this->assertFalse($this->user->isAdmin());

		$this->user->delete();
	}

	protected function fetchUser($guid) {
		global $CONFIG;

		return get_data_row("SELECT * FROM {$CONFIG->dbprefix}users_entity WHERE guid = '$guid'");
	}
}

class ElggUserTest extends ElggUser {
	public function expose_attributes() {
		return $this->attributes;
	}
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v11/services/ad_group_criterion_customizer_service.proto

package com.google.ads.googleads.v11.services;

public interface MutateAdGroupCriterionCustomizerResultOrBuilder extends
    // @@protoc_insertion_point(interface_extends:google.ads.googleads.v11.services.MutateAdGroupCriterionCustomizerResult)
    com.google.protobuf.MessageOrBuilder {

  /**
   *

   * Returned for successful operations.
   *

   *
   * string resource_name = 1 [(.google.api.resource_reference) = { ... }
   * @return The resourceName.
   */
  java.lang.String getResourceName();
  /**
   *

   * Returned for successful operations.
   *

   *
   * string resource_name = 1 [(.google.api.resource_reference) = { ... }
   * @return The bytes for resourceName.
   */
  com.google.protobuf.ByteString
      getResourceNameBytes();

  /**
   *

   * The mutated AdGroupCriterionCustomizer with only mutable fields after
   * mutate. The field will only be returned when response_content_type is set
   * to "MUTABLE_RESOURCE".
   *

   *
   * .google.ads.googleads.v11.resources.AdGroupCriterionCustomizer ad_group_criterion_customizer = 2;
   * @return Whether the adGroupCriterionCustomizer field is set.
   */
  boolean hasAdGroupCriterionCustomizer();
  /**
   *

   * The mutated AdGroupCriterionCustomizer with only mutable fields after
   * mutate. The field will only be returned when response_content_type is set
   * to "MUTABLE_RESOURCE".
   *

   *
   * .google.ads.googleads.v11.resources.AdGroupCriterionCustomizer ad_group_criterion_customizer = 2;
   * @return The adGroupCriterionCustomizer.
   */
  com.google.ads.googleads.v11.resources.AdGroupCriterionCustomizer getAdGroupCriterionCustomizer();
  /**
   *

   * The mutated AdGroupCriterionCustomizer with only mutable fields after
   * mutate. The field will only be returned when response_content_type is set
   * to "MUTABLE_RESOURCE".
   *

   *
   * .google.ads.googleads.v11.resources.AdGroupCriterionCustomizer ad_group_criterion_customizer = 2;
   */
  com.google.ads.googleads.v11.resources.AdGroupCriterionCustomizerOrBuilder getAdGroupCriterionCustomizerOrBuilder();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Emma" default="main" description="Emma API wrapper">

    <property name="message" value="Phing Running..."/>
    <property name="php_bin_path" value="/usr/bin/" />

    <!-- Default target - PHP Lint -->
    <target name="main">
        <phplint>
            <fileset dir="src">
                <include name="*.php"/>
            </fileset>
        </phplint>
    </target>

    <!-- PHP Code Sniffer -->
    <target name="phpcs" description="PHP Code Sniffer">
        <phpcodesniffer standard="PEAR" format="summary">
            <fileset dir="src">
                <include name="*.php" />
            </fileset>
        </phpcodesniffer>
    </target>

    <!-- PHPUnit. Includes Code Coverage -->
    <!-- Not working properly -->
    <target name="phpunit" description="PHP Unit Testing">
        <phpunit pharlocation="/usr/local/bin/phpunit" codecoverage="true" haltonfailure="true" haltonerror="true" configuration="phpunit.xml.dist">
            <formatter type="plain" usefile="false"/>
            <batchtest>
                <fileset dir="tests">
                    <include name="*Test.php"/>
                </fileset>
            </batchtest>
        </phpunit>
    </target>

    <!-- phpDocumentor -->
    <target name="phpdoc" description="PHP Documentor">
        <mkdir dir="docs" />
        <phpdoc2 title="API Documentation" destdir="docs">
            <fileset dir="src">
                <include name="*.php" />
            </fileset>
        </phpdoc2>
    </target>

</project>


text:
class FakeUser
  def name
    "Fake User"
  end
end


text:
package spot.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;

import spot.pages.admin.AdminHomePage;
import spot.pages.notAdmin.HomePage;

public class LoginPage extends BasePage {

	@FindBy(xpath =".//*[@id='Header:loginForm']/span/input[1]")
	private WebElement userNameTextField;

	@FindBy(xpath =".//*[@id='Header:loginForm']/span/input[2]")
	private WebElement passwordTextField;

	@FindBy(xpath =".//*[@id='Header:loginForm:lnkLogin']")
	private WebElement submitLoginInfoButton;

	public LoginPage(WebDriver driver) {
		super(driver);

		PageFactory.initElements(driver, this);
	}

	private <T> T login(String userName, String password, Class<T> expectedPage){

		enterUserName(userName);
		enterPassword(password);
		clickOnSignIn();
	    return PageFactory.initElements(driver, expectedPage);
	}

	public AdminHomePage loginAsAdmin(String user, String pw){
	    return login(user, pw, AdminHomePage.class);
	}

	public HomePage loginAsNotAdmin(String user, String pw){
	    return login(user, pw, HomePage.class);
	}

	public LoginPage loginWithBadCredentials(String user, String pw){
	    return login(user, pw, LoginPage.class);
	}

	private void enterUserName(String userName) {
		wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(".//*[@id='Header:loginForm']/span/input[1]")));
		userNameTextField.sendKeys(userName);
	}

	private void enterPassword(String password) {
		passwordTextField.sendKeys(password);
	}

	private void clickOnSignIn() {
		submitLoginInfoButton.click();
	}

}


text:
// Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
/**
 * Config module holds SDK configuration variables
 *
 * Currently its only custom domain - which enabled using
 * sdk from different domain (using CORS)
 *
 * Never set properties directly - always use setter methods
 *
 * @module config
 * @class config
 */

const URL_REGEXP = '(?:(https)://+|(www\\.)?)\\w[:;,\\.?\\[\\]\\w/~%&=+#-@!]*';

export let domain;

/**
 * Sets custom domain. Parameter is url which has always to be https://
 * (if you don't provide it, we will do it for you).
 *
 * RegExp inspired taken from
 * https://github.com/jarib/google-closure-library/blob/master/closure/goog/string/linkify.js
 *
 * @method setCustomDomain
 */
export function setCustomDomain(d) {
    const sanitizedDomain = d || '';
    const link = sanitizedDomain.match(URL_REGEXP);

    if (!link) {
        throw new Error(d + ' is not a valid url');
    }

    // ensure https:// prefix
    // and strip possible trailing /
    domain = 'https://' + link[0]
             .replace(/^https:\/\//, '')
             .replace(/\/$/, '');
}


text:
class CreateRolesUsers < ActiveRecord::Migration
  def self.up
    create_table :roles_users, :options => 'CHARACTER SET=utf8', :id => false do |t|
      t.column :role_id, :integer, :null => false
      t.column :user_id, :integer, :null => false
    end
    add_index :roles_users, [:role_id, :user_id], :unique => true
  end

  def self.down
    drop_table :roles_users
  end
end


text:
<?php

/**
 * Generic_Sniffs_Files_EndFileNewlineSniff.
 *
 * Ensures the file ends with a newline character.
 *
 * @category  PHP
 * @package   PHP_CodeSniffer
 * @author    Greg Sherwood <gsherwood@squiz.net>
 * @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600)
 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
 * @version   Release: @package_version@
 * @link      http://pear.php.net/package/PHP_CodeSniffer
 */
class PSR2_Sniffs_Files_EndFileNewlineSniff implements PHP_CodeSniffer_Sniff
{

    /**
     * Returns an array of tokens this test wants to listen for.
     *
     * @return array
     */
    public function register()
    {
        return array(T_OPEN_TAG);

    }//end register()

    /**
     * Processes this sniff, when one of its tokens is encountered.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
     * @param int                  $stackPtr  The position of the current token in
     *                                        the stack passed in $tokens.
     *
     * @return void
     */
    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        // We are only interested if this is the first open tag and in a file
        // that only contains PHP code.
        if ($stackPtr !== 0) {
            if ($phpcsFile->findPrevious(array(T_OPEN_TAG, T_INLINE_HTML), ($stackPtr - 1)) !== false) {
                return;
            }
        }

        if ($phpcsFile->findNext(T_INLINE_HTML, ($stackPtr + 1)) !== false) {
            return;
        }

        // Skip to the end of the file.
        $tokens   = $phpcsFile->getTokens();
        $stackPtr = ($phpcsFile->numTokens - 1);

        // Hard-coding the expected \n in this sniff as it is PSR-2 specific and
        // PSR-2 enforces the use of unix style newlines.
        if (substr($tokens[$stackPtr]['content'], -1) !== "\n") {
            $error = 'Expected 1 newline at end of file; 0 found';
            $phpcsFile->addError($error, $stackPtr, 'NoneFound');
            return;
        }

        // Go looking for the last non-empty line.
        $lastLine = $tokens[$stackPtr]['line'];
        while ($tokens[$stackPtr]['code'] === T_WHITESPACE) {
            $stackPtr--;
        }

        $lastCodeLine = $tokens[$stackPtr]['line'];
        $blankLines   = ($lastLine - $lastCodeLine);
        if ($blankLines > 0) {
            $error = 'Expected 1 blank line at end of file; %s found';
            $data  = array($blankLines + 1);
            $phpcsFile->addError($error, $stackPtr, 'TooMany', $data);
        }

    }//end process()

}//end class

?>