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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Datacenter.Router</title>
<meta name="date" content="2016-06-09">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

gmc_hdfs.replicationsimulator

Class Datacenter.Router

java.lang.Object

gmc_hdfs.replicationsimulator.Datacenter.Router

Enclosing class:

Datacenter

public class Datacenter.Router
extends java.lang.Object

The routers do the routing in the data centers. They are used for the
 routing of the requests and their answers and displacement of data
 between data centers.

Constructor Summary

Constructors

Constructor and Description

Datacenter.Router(int id)

Create a new object of Router

Method Summary

Methods

Modifier and Type
Method and Description

int
findDataitemPlace(int dataitemInfoId)

The router has a mechanism that takes the data unit ID and returns
 the closest data center which has a version of this data.

int
getId()

java.util.Queue<java.lang.Integer>
getRoutingPath(int sourceId,
              int destinationId)

This method takes ID of source data center and destination data center
 and gives the route between those two.

java.util.Map<java.lang.Integer,java.lang.Integer>
getRoutingTable()

int
nextHop(int sourceId,
       int destinationId)

This method takes ID of source data center and destination data center
 and gives the next hop in routing path.

int
route(Datacenter distination)

This method takes the destination data center as its input and
 routes to the destination.

void
setId(int id)

void
start()

This method starts the router

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Datacenter.Router

public Datacenter.Router(int id)

Create a new object of Router

Parameters:

id - ID for router

Method Detail

getRoutingTable

public java.util.Map<java.lang.Integer,java.lang.Integer> getRoutingTable()

start

public void start()

This method starts the router

route

public int route(Datacenter distination)

This method takes the destination data center as its input and
 routes to the destination.

Parameters:

distination - Destination data center

Returns:

route to Destination data center

findDataitemPlace

public int findDataitemPlace(int dataitemInfoId)

The router has a mechanism that takes the data unit ID and returns
 the closest data center which has a version of this data. In order
 to find the destination data center for accessing the data we need
 this method.

Parameters:

dataitemInfoId - ID of Data item

Returns:

ID of the closest data center includes a version of input data unit.

getRoutingPath

public java.util.Queue<java.lang.Integer> getRoutingPath(int sourceId,
                                                int destinationId)

This method takes ID of source data center and destination data center
 and gives the route between those two.

Parameters:

sourceId - ID of source data center

destinationId - ID of destination data center

Returns:

route between source data center and destination data center

nextHop

public int nextHop(int sourceId,
          int destinationId)

This method takes ID of source data center and destination data center
 and gives the next hop in routing path.

Parameters:

sourceId - ID of source data center

destinationId - ID of destination data center

Returns:

Next hop in routing path

getId

public int getId()

setId

public void setId(int id)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
**work in progress**

This document defines a high level roadmap for rkt development.
The dates below should not be considered authoritative, but rather indicative of the projected timeline of the project.
The [milestones defined in GitHub](https://github.com/coreos/rkt/milestones) represent the most up-to-date state of affairs.

rkt is an implementation of the [App Container spec](https://github.com/appc/spec), which is still under active development on an approximately similar timeframe.
Until the specification reaches version 1.0, rkt's major/minor versions will trail that of the spec.

### rkt 0.8 (July?)
- integrated alternative kvm stage1
- Smarter image discovery: cache control and etag handling
- stable on-disk format
- stage1 split out from coreos/rkt
  - stable and documented stage0/stage1 ABI
- rkt can run applications as non-root

### rkt 0.9 (August?)
- rkt registers pods with systemd-machined where possible
  - machinectl {status,terminate,login,...}
- Better UX around trust
- rkt packaged for other distributions (e.g. Fedora)
- rkt can retrieve images via BitTorrent

### rkt 1.0 (September?)
- IPv6 support

redpajama_set_name: RedPajamaGithub


text:
#include "Token.h"

#include "CommonTokenStream.h"

using namespace antlr4;

CommonTokenStream::CommonTokenStream(TokenSource *tokenSource) : BufferedTokenStream(tokenSource) {
  InitializeInstanceFields();
}

CommonTokenStream::CommonTokenStream(TokenSource *tokenSource, int channel) : BufferedTokenStream(tokenSource) {
  this->channel = channel;
}

ssize_t CommonTokenStream::adjustSeekIndex(size_t i) {
  return nextTokenOnChannel(i, channel);
}

Token* CommonTokenStream::LB(size_t k) {
  if (k == 0 || k > _p) {
    return nullptr;
  }

  ssize_t i = (ssize_t)_p;
  size_t n = 1;
  // find k good tokens looking backwards
  while (n <= k) {
    // skip off-channel tokens
    i = previousTokenOnChannel(i - 1, channel);
    n++;
  }
  if (i < 0) {
    return nullptr;
  }

  return _tokens[i].get();
}

Token* CommonTokenStream::LT(ssize_t k) {
  lazyInit();
  if (k == 0) {
    return nullptr;
  }
  if (k < 0) {
    return LB((size_t)-k);
  }
  size_t i = _p;
  ssize_t n = 1; // we know tokens[p] is a good one
                 // find k good tokens
  while (n < k) {
    // skip off-channel tokens, but make sure to not look past EOF
    if (sync(i + 1)) {
      i = nextTokenOnChannel(i + 1, channel);
    }
    n++;
  }

  return _tokens[i].get();
}

int CommonTokenStream::getNumberOfOnChannelTokens() {
  int n = 0;
  fill();
  for (size_t i = 0; i < _tokens.size(); i++) {
    Token *t = _tokens[i].get();
    if (t->getChannel() == channel) {
      n++;
    }
    if (t->getType() == Token::EOF) {
      break;
    }
  }
  return n;
}

void CommonTokenStream::InitializeInstanceFields() {
  channel = Token::DEFAULT_CHANNEL;
}


text:
<?php
namespace Ext\Grid\Column;

use Ext\Component;

class Widget extends Column
{

	public function setWidget(Component $widget){
		return $this->setProperty('widget',$widget);
	}

	public function getWidget(){
		return $this->getProperty('widget');
	}

}


text:
Introduction
==========
h2bench is a tool for testing how response size affects throughput when using HTTP/1.1 and/or HTTP/2. The tool is a minimalistic web server that only supports one request, `GET /random/{byteCount}` where `{byteCount}` is the number of bytes that will be returned from the web server. This can e.g. be used to measure the difference in throughput of 10000 requests that each returns 1k response versus 1000 requests each returning 100k response.

In order to test performance I recommend [h2load](https://nghttp2.org/documentation/h2load-howto.html).

Installation
============
You'll need [go][https://www.golang.org/] and [glide][https://github.com/Masterminds/glide] to build h2bench.
```
glide install
go build
```

Command line usage
==================
Usage of ./h2bench:
  -cert string
    	TLS certificate to use to secure the HTTP link.
  -key string
    	TLS private key to use to secure the HTTP link.
  -serverAddress string
    	The address to bind to (default ":8000")

Generating certificate
==================
You'll need a TLS certificate in order to use HTTP/2. To generate one, use:
```
openssl genrsa 2048 > server.key
chmod 400 server.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key server.key > server.cert
```

Enter the address of your server when asked for FQDN.


text:
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Orleans;
using Presence.Grains;
using Presence.PlayerWatcher;
using Presence.Shared;

Console.Title = "PlayerWatcher";

await Host.CreateDefaultBuilder()
    .ConfigureServices(services =>
    {
        // add regular services
        services.AddTransient<IGameObserver, LoggerGameObserver>();

        // this hosted service connects and disconnects from the cluster along with the host
        // it also exposes the cluster client to other services that request it
        services.AddSingleton<ClusterClientHostedService>();
        services.AddSingleton<IHostedService>(_ => _.GetService<ClusterClientHostedService>());
        services.AddSingleton(_ => _.GetService<ClusterClientHostedService>().Client);

        // this hosted service runs the sample logic
        services.AddSingleton<IHostedService, PlayerWatcherHostedService>();
    })
    .RunConsoleAsync();


text:
import express from 'express';
import path from 'path';
import open from 'open';
import compression from 'compression';
import bodyParser from 'body-parser';
/*eslint-disable no-console */

const port = 3000;
const app = express();

app.use(compression());
app.use(express.static('dist-server'));

app.use(bodyParser.urlencoded({ express: true }));
app.use(bodyParser.json());

import blogRouter from './controllers/blogs';
import consultationRouter from './controllers/consultations';
import classTypeRouter from './controllers/classTypes';
import costRouter from './controllers/costs';
import eventRouter from './controllers/events';
import massageTypeRouter from './controllers/massageTypes';
import scheduleRouter from './controllers/schedules';
import testimonialRouter from './controllers/testimonials';
import navbarRouter from './controllers/navbars';
import uploadRouter from './controllers/uploads';
import usersRouter from './controllers/users';
import loginRouter from './controllers/login';

app.use('/api', blogRouter(),
    consultationRouter(),
    classTypeRouter(),
    costRouter(),
    eventRouter(),
    massageTypeRouter(),
    scheduleRouter(),
    testimonialRouter(),
    navbarRouter(),
    uploadRouter(),
    usersRouter(),
    loginRouter());

app.get('*', function(req, res) {
  res.sendFile(path.join(__dirname, '../dist-server/index.html'));
});

app.listen(port, function(err) {
  if (err) {
    console.log(err);
  } else {
    open(`http://localhost:${port}`);
  }
});


text:
module Dragon
  class GameSession < Driver
    extend Forwardable

    attr_reader :client, :world

    def_delegators :client, :send, :delete
    def_delegators :console, :content, :clear

    def initialize(world: nil, client: nil)
      @client = client
      super(world)
    end

    def self.all
      @_sessions ||= []
    end

    def self.create(client: nil, world: nil)
      session = new(client: client, world: world)
      all.push(session)
      session
    end

    def self.find_by_client(client)
      all.find { |s| s.client == client }
    end

    def self.delete_by_client(client)
      all.delete find_by_client(client)
    end

    def step!(data=nil)
      clear

      if data
        message = ClientRequestMessage.new(data)
        handle(message) if message.action_record
      end

      describe
      engine.prompt_player

      @params = {} # clear out params...
      self
    rescue => ex
      puts ex.message
      puts ex.backtrace
      raise ex
    end

    def handle(message)
      actions = engine.last_prompted_actions

      unless actions.nil?
        action  = actions.detect do |act|
          act.label == message.action
        end

        if action
          message.hydrate(action) if message.params.any?
          engine.react(action)
        end
      end

      self
    end

    def output
      JSON.dump(content: content.join + "</div>") if content
    end

    def console
      @console ||= StreamingVirtualConsole.new(self)
    end

    def first_time?
      @first_time
    end
  end
end


text:
(function(CoreWM, Panel, PanelItem, Utils, API, VFS) {
  'use strict';

  /////////////////////////////////////////////////////////////////////////////
  // ITEM
  /////////////////////////////////////////////////////////////////////////////

  /**
   * PanelItem: Buttons
   */
  var PanelItemButtons = function() {
    PanelItem.apply(this, ['PanelItemButtons PanelItemFill']);

    this.$container = null;
  };

  PanelItemButtons.prototype = Object.create(PanelItem.prototype);
  PanelItemButtons.Name = 'Buttons'; // Static name
  PanelItemButtons.Description = 'Button Bar'; // Static description
  PanelItemButtons.Icon = 'actions/stock_about.png'; // Static icon

  PanelItemButtons.prototype.init = function() {
    var root = PanelItem.prototype.init.apply(this, arguments);

    this.$container = document.createElement('ul');
    root.appendChild(this.$container);

    this.addButton(API._('LBL_APPLICATIONS'), 'osjs.png', function(ev) {
      ev.stopPropagation();

      OSjs.Applications.CoreWM.showMenu(ev);
      return false;
    });

    this.addButton(API._('LBL_SETTINGS'), 'categories/applications-system.png', function(ev) {
      var wm = OSjs.Core.getWindowManager();
      if ( wm ) {
        wm.showSettings();
      }
      return false;
    });

    this.addButton(API._('DIALOG_LOGOUT_TITLE'), 'actions/exit.png', function(ev) {
      OSjs.Session.signOut();
    });

    return root;
  };

  PanelItemButtons.prototype.destroy = function() {
    PanelItem.prototype.destroy.apply(this, arguments);
  };

  PanelItemButtons.prototype.addButton = function(title, icon, callback) {
    icon = API.getIcon(icon);

    var sel = document.createElement('li');
    sel.className = 'Button';
    sel.title = title;
    sel.innerHTML = '<img alt="" src="' + icon + '" />';
    sel.onclick = callback;
    sel.oncontextmenu = function(ev) {
      ev.stopPropagation();
      return false;
    };

    this.$container.appendChild(sel);
  };

  /////////////////////////////////////////////////////////////////////////////
  // EXPORTS
  /////////////////////////////////////////////////////////////////////////////

  OSjs.Applications                                    = OSjs.Applications || {};
  OSjs.Applications.CoreWM                             = OSjs.Applications.CoreWM || {};
  OSjs.Applications.CoreWM.PanelItems                  = OSjs.Applications.CoreWM.PanelItems || {};
  OSjs.Applications.CoreWM.PanelItems.Buttons          = PanelItemButtons;

})(OSjs.Applications.CoreWM.Class, OSjs.Applications.CoreWM.Panel, OSjs.Applications.CoreWM.PanelItem, OSjs.Utils, OSjs.API, OSjs.VFS);


text:
from __future__ import absolute_import

from wtforms import *

from . import fields
from .fields import *


text:
package org.keycloak.representations;

import org.keycloak.util.Time;

/**
 * @author Stian Thorgersen
 */
public class PasswordToken {

    private String realm;
    private String user;
    private int timestamp;

    public PasswordToken() {
    }

    public PasswordToken(String realm, String user) {
        this.realm = realm;
        this.user = user;
        this.timestamp = Time.currentTime();
    }

    public String getRealm() {
        return realm;
    }

    public void setRealm(String realm) {
        this.realm = realm;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public int getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(int timestamp) {
        this.timestamp = timestamp;
    }

}


text:
.. mdgt documentation master file, created by
   sphinx-quickstart on Wed Feb 24 10:48:45 2016.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to mdgt's documentation!
================================

Contents:

.. toctree::
   :maxdepth: 2

   readme
   mdgt
   api
   contributing
   license

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
package org.apache.ibatis.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * The maker annotation that invoke a flush statements via Mapper interface.
 *
 * @author Kazuki Shimizu
 * @since 3.3.0
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Flush {
}


text:
//
// Copyright (c) LightBuzz Software.
// All rights reserved.
//
// http://lightbuzz.com
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
// WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//

namespace LightBuzz.Vitruvius
{
    /// <summary>
    /// Represents an axis from the 3D space.
    /// </summary>
    public enum Axis
    {
        /// <summary>
        /// The X axis.
        /// </summary>
        X = 0,

        /// <summary>
        /// The Y axis.
        /// </summary>
        Y = 1,

        /// <summary>
        /// The Z axis.
        /// </summary>
        Z = 2
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="@color/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways|snap"/>

        <android.support.design.widget.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/toolbar"
            android:background="@color/colorPrimary"
            android:scrollbars="horizontal"
            app:tabMode="scrollable"/>

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

</android.support.design.widget.CoordinatorLayout>


text:
class GURL;
class Profile;

// This namespace provides various helpers around handling Google-related URLs
// and state relating to Google Chrome distributions (such as RLZ).
namespace google_util {

// The query key that identifies a Google Extended API request for Instant.
const char kInstantExtendedAPIParam[] = "espv";

GURL LinkDoctorBaseURL();
void SetMockLinkDoctorBaseURLForTesting();

// Adds the Google locale string to the URL (e.g., hl=en-US).  This does not
// check to see if the param already exists.
GURL AppendGoogleLocaleParam(const GURL& url);

// String version of AppendGoogleLocaleParam.
std::string StringAppendGoogleLocaleParam(const std::string& url);

// Adds the Google TLD string for the given profile to the URL (e.g., sd=com).
// This does not check to see if the param already exists.
GURL AppendGoogleTLDParam(Profile* profile, const GURL& url);

// Returns in |brand| the brand code or distribution tag that has been
// assigned to a partner. Returns false if the information is not available.
bool GetBrand(std::string* brand);

// Returns in |brand| the reactivation brand code or distribution tag
// that has been assigned to a partner for reactivating a dormant chrome
// install. Returns false if the information is not available.
bool GetReactivationBrand(std::string* brand);

// WARNING: The following IsGoogleXXX() functions use heuristics to rule out
// "obviously false" answers.  They do NOT guarantee that the string in question
// is actually on a Google-owned domain, just that it looks plausible.  If you
// need to restrict some behavior to only happen on Google's officially-owned
// domains, use TransportSecurityState::IsGooglePinnedProperty() instead.

// Designate whether or not a URL checking function also checks for specific
// subdomains, or only "www" and empty subdomains.
enum SubdomainPermission {
  ALLOW_SUBDOMAIN,
  DISALLOW_SUBDOMAIN,
};

// Designate whether or not a URL checking function also checks for standard
// ports (80 for http, 443 for https), or if it allows all port numbers.
enum PortPermission {
  ALLOW_NON_STANDARD_PORTS,
  DISALLOW_NON_STANDARD_PORTS,
};

// True if |url| is an HTTP[S] request with host "[www.]google.<TLD>". If
// |subdomain_permission| is ALLOW_SUBDOMAIN, this checks against host
// "*.google.<TLD>" instead. If |port_permission| is ALLOW_NON_STANDARD_PORTS,
// this also allows ports other than 80 for http or 443 for https.
bool IsGoogleDomainUrl(const std::string& url,
                       SubdomainPermission subdomain_permission,
                       PortPermission port_permission);
// True if |host| is "[www.]google.<TLD>" with a valid TLD. If
// |subdomain_permission| is ALLOW_SUBDOMAIN, we check against host
// "*.google.<TLD>" instead.
bool IsGoogleHostname(const std::string& host,
                      SubdomainPermission subdomain_permission);
// True if |url| represents a valid Google home page URL.
bool IsGoogleHomePageUrl(const std::string& url);
// True if |url| represents a valid Google search URL.
bool IsGoogleSearchUrl(const std::string& url);
// True if |url| represents a valid Google search URL used by the Instant
// Extended API.
bool IsInstantExtendedAPIGoogleSearchUrl(const std::string& url);

// True if a build is strictly organic, according to its brand code.
bool IsOrganic(const std::string& brand);

// True if a build should run as organic during first run. This uses
// a slightly different set of brand codes from the standard IsOrganic
// method.
bool IsOrganicFirstRun(const std::string& brand);

// True if |brand| is an internet cafe brand code.
bool IsInternetCafeBrandCode(const std::string& brand);

// This class is meant to be used only from test code, and sets the brand
// code returned by the function GetBrand() above while the object exists.
class BrandForTesting {
 public:
  explicit BrandForTesting(const std::string& brand);
  ~BrandForTesting();

 private:
  std::string brand_;
  DISALLOW_COPY_AND_ASSIGN(BrandForTesting);
};

}  // namespace google_util

#endif  // CHROME_BROWSER_GOOGLE_GOOGLE_UTIL_H__


text:
package eu.addicted2random.a2rclient.jsonrpc;

/**
 * Interface for all JSON-RPC request endpoints.
 *
 * @author Alexander Jentz, beyama.de
 *
 */
public interface RPCEndpoint {
  Response call(Request request);
}


text:
/*
 *  @(#)PersonaInterfaz.java
 *
 *  Fundamentos de Programacion II. GITT.
 *  Departamento de Ingenieria Telematica
 *  Universidad de Sevilla
 *
 */

package fp2.poo.utilidades;

/**
 * Descripcion: Esta es una clase que representa una persona
 *              asociada a un contacto de agenda.
 *
 * @version version 1.0 Abril 2012
 * @author  Fundamentos de Programacion II
 */
public interface PersonaInterfaz {

    /*
     *  Metodo de configuracion del atributo nombre.
     */
    public void setNombre( String nombre );

    /*
     *  Metodo de obtencion del nombre.
     */
    public String getNombre( );

    /*
     *  Metodo de configuracion del atributo
     *  relacionado con el primer apellido.
     */
    public void setPrimerApellido( String primerApellido);

    /*
     *  Metodo de obtencion del primer apellido.
     */
    public String getPrimerApellido( );

    /*
     *  Metodo de configuracion del atributo
     *  relacionado con el segundo apellido.
     */
    public void setSegundoApellido( String segundoApellido);

    /*
     *  Metodo de obtencion del segundo apellido.
     */
    public String getSegundoApellido( );

}


text:
/**
 *  \file CMenuInput.cpp
 *  \brief Handling inputs during the menu
 */

#include "STDAFX.H"
#include "CMenuInput.h"
#include "CDisplay.h"
#include "CInput.h"
#include "COptions.h"
#include "CFont.h"
#include "CMenu.h"
#include "CSound.h"

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

#define MENUINPUT_SPRITELAYER       1       //!< Sprite layer where to draw sprites

#ifdef USE_32_PIXELS_PER_BLOCK
#define TITLE_TEXT_POSITION_Y       90      //!< Position Y of the title text that is centered on the X axis
#else
#define TITLE_TEXT_POSITION_Y       45      //!< Position Y of the title text that is centered on the X axis
#endif

#ifdef USE_32_PIXELS_PER_BLOCK
#define INITIAL_TEXT_POSITION_X     191     //!< Initial position of the player input's name
#define INITIAL_TEXT_POSITION_Y     (77+90)
#else
#define INITIAL_TEXT_POSITION_X     91      //!< Initial position of the player input's name
#define INITIAL_TEXT_POSITION_Y     77
#endif
#define TEXT_SPACE_Y                21      //!< Y Space in pixels between each text Y position

#define BOMBER_HEAD_SPACE_X         -29     //!< Space in pixels between the player input name text position
#define BOMBER_HEAD_SPACE_Y         -7      //!< and the corresponding bomber head
#define BOMBER_HEAD_SPRITE_TABLE    30      //!< Sprite table where the menu's bomber head sprites are contained
#define BOMBER_HEAD_PRIORITY        0
#define BOMBER_HEAD_PRIORITY        0       //!< Priority to use when drawing the menu's bomber head sprites

#define CURSOR_HAND_SPACE_X         -54     //!< Space in pixels between the player input name text position
#define CURSOR_HAND_SPACE_Y         -2      //!< and the cursor hand pointing to the corresponding bomber head
#define CURSOR_HAND_SPRITE_TABLE    32      //!< Sprite table where the menu's cursor hand sprites are contained
#define CURSOR_HAND_SPRITE          0       //!< Sprite number of the cursor hand in the sprite table
#define CURSOR_HAND_PRIORITY        0       //!< Priority to use when drawing the menu's bomber hand sprites

#define TITLE_STRING                "INPUT" //!< String of the menu's title centered on the X axis

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

CMenuInput::CMenuInput (void) : CMenuBase ()
{
    // Nothing to do
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

CMenuInput::~CMenuInput (void)
{
    // Nothing to do
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnCreate (void)
{
    // Make the hand cursor point to the first player
    m_CursorPlayer = 0;

    // While the cursor is not pointing on a human player
    while (m_pOptions->GetBomberType(m_CursorPlayer) != BOMBERTYPE_MAN)
    {
        // Make the cursor go down
        m_CursorPlayer++;
    }
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnDestroy (void)
{
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnUp (void)
{
    do
    {
        // Make the cursor go up
        m_CursorPlayer--;

        // If it is now out of bounds
        if (m_CursorPlayer < 0)
        {
            // Wrap : make the cursor point to the last player
            m_CursorPlayer = MAX_PLAYERS - 1;
        }
    }
    // While the cursor is not pointing on a human player
    while (m_pOptions->GetBomberType(m_CursorPlayer) != BOMBERTYPE_MAN);
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnDown (void)
{
    do
    {
        // Make the cursor go down
        m_CursorPlayer++;

        // If it is now out of bounds
        if (m_CursorPlayer > MAX_PLAYERS - 1)
        {
            // Wrap : make the cursor point to the first player
            m_CursorPlayer = 0;
        }
    }
    // While the cursor is pointing on a human player
    while (m_pOptions->GetBomberType(m_CursorPlayer) != BOMBERTYPE_MAN);
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnLeft (void)
{
    // If the current player's current player input is the first one
    if (m_pOptions->GetPlayerInput(m_CursorPlayer) - 1 < 0)
    {
        // Set the last player input for the current player
        m_pOptions->SetPlayerInput (m_CursorPlayer, m_pInput->GetPlayerInputCount() - 1);
    }
    // If the current player's current player input is not the first one
    else
    {
        // Set the previous player input for the current player
        m_pOptions->SetPlayerInput (m_CursorPlayer, m_pOptions->GetPlayerInput(m_CursorPlayer) - 1);
    }
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnRight (void)
{
    // If the current player's current player input is the last one
    if (m_pOptions->GetPlayerInput(m_CursorPlayer) + 1 >= m_pInput->GetPlayerInputCount())
    {
        // Set the first player input for the current player
        m_pOptions->SetPlayerInput (m_CursorPlayer, 0);
    }
    // If the current player's current player input is not the last one
    else
    {
        // Set the next player input for the current player
        m_pOptions->SetPlayerInput (m_CursorPlayer, m_pOptions->GetPlayerInput(m_CursorPlayer) + 1);
    }
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnPrevious (void)
{
    // Go to the previous screen
    Exit (MENUACTION_PREVIOUS);
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnNext (void)
{
    // Play the menu next sound
    m_pSound->PlaySample (SAMPLE_MENU_NEXT);

    // Go to the next screen
    Exit (MENUACTION_NEXT);
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnUpdate (void)
{
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************

void CMenuInput::OnDisplay (void)
{
    // Set the right font text color and write the menu title string
    m_pFont->SetTextColor (FONTCOLOR_WHITE);
    m_pFont->DrawCenteredX (0, VIEW_WIDTH - 1, TITLE_TEXT_POSITION_Y, TITLE_STRING);

    // Y Position where to write the text with the font object
    int PositionY = INITIAL_TEXT_POSITION_Y;

    // Scan the players
    for (int Player = 0 ; Player < MAX_PLAYERS ; Player++)
    {
        // If the current player is a human
        if (m_pOptions->GetBomberType(Player) == BOMBERTYPE_MAN)
        {
            int PlayerInput = m_pOptions->GetPlayerInput(Player);

            // If the current input is a joystick, verify that this joystick is plugged in
            if (PlayerInput >= m_pInput->GetPlayerInputCount())
            {
                // reset to keyboard 1
                PlayerInput = 0;
                m_pOptions->SetPlayerInput (Player, PlayerInput);
            }

            // Set the right font text color and write the current player input name
            m_pFont->SetTextColor (FONTCOLOR_GREEN);
            m_pFont->Draw (INITIAL_TEXT_POSITION_X,
                           PositionY,
                           m_pInput->GetPlayerInput(PlayerInput).GetName());

            // Draw the bomber head corresponding to the current player
            m_pDisplay->DrawSprite (INITIAL_TEXT_POSITION_X + BOMBER_HEAD_SPACE_X,
                                    PositionY + BOMBER_HEAD_SPACE_Y,
                                    NULL,
                                    NULL,
                                    BOMBER_HEAD_SPRITE_TABLE,
                                    Player,
                                    MENUINPUT_SPRITELAYER,
                                    BOMBER_HEAD_PRIORITY);

            // If the cursor hand is pointing to the current player
            if (m_CursorPlayer == Player)
            {
                // Draw the cursor hand sprite in front of the corresponding bomber head
                m_pDisplay->DrawSprite (INITIAL_TEXT_POSITION_X + CURSOR_HAND_SPACE_X,
                                        PositionY + CURSOR_HAND_SPACE_Y,
                                        NULL,
                                        NULL,
                                        CURSOR_HAND_SPRITE_TABLE,
                                        CURSOR_HAND_SPRITE,
                                        MENUINPUT_SPRITELAYER,
                                        CURSOR_HAND_PRIORITY);
            }

            // Go down
            PositionY += TEXT_SPACE_Y;
        }
    }
}

//******************************************************************************************************************************
//******************************************************************************************************************************
//******************************************************************************************************************************


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

namespace TwainDotNet.TwainNative
{
    class TwainConstants
    {
        public const short ProtocolMajor = 1;
        public const short ProtocolMinor = 9;
    }
}


text:
"""
cookiecutter.utils
------------------

Helper functions used throughout Cookiecutter.
"""

from __future__ import unicode_literals
import contextlib
import errno
import logging
import os
import stat
import shutil

def force_delete(func, path, exc_info):
    """
    Error handler for `shutil.rmtree()` equivalent to `rm -rf`
    Usage: `shutil.rmtree(path, onerror=force_delete)`
    From stackoverflow.com/questions/1889597
    """

    os.chmod(path, stat.S_IWRITE)
    func(path)

def rmtree(path):
    """
    Removes a directory and all its contents. Like rm -rf on Unix.

    :param path: A directory path.
    """

    shutil.rmtree(path, onerror=force_delete)

def make_sure_path_exists(path):
    """
    Ensures that a directory exists.

    :param path: A directory path.
    """

    logging.debug('Making sure path exists: {0}'.format(path))
    try:
        os.makedirs(path)
    except OSError as exception:
        if exception.errno != errno.EEXIST:
            return False
    return True

@contextlib.contextmanager
def work_in(dirname=None):
    """
    Context manager version of os.chdir. When exited, returns to the working
    directory prior to entering.
    """
    curdir = os.getcwd()
    try:
        if dirname is not None:
            os.chdir(dirname)
        yield
    finally:
        os.chdir(curdir)

def make_executable(script_path):
    """
    Makes `script_path` executable

    :param script_path: The file to change
    """
    status = os.stat(script_path)
    os.chmod(script_path, status.st_mode | stat.S_IEXEC)


text:
require 'time'
require 'memoizable'

module Eventbrite
  module Changeable
    include Memoizable

    # Time when the object was updated on Eventbrite
    #
    # @return [Time]
    def changed
      Time.parse(@attrs[:changed]) unless @attrs[:changed].nil?
    end
    memoize :changed

    # @return [Boolean]
    def changed?
      !!@attrs[:changed]
    end
    memoize :changed?
  end
end


text:
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="x"/>
    <variable name="y"/>
  </head>
  <results>
    <result>
      <binding name="x"><literal>1</literal></binding>
      <binding name="y"><uri>http://example.org</uri></binding>
    </result>
  </results>
</sparql>


text:
  Chammes est
       un village
       géographiquement positionné dans le département de Mayenne en Pays de la Loire. Elle totalisait 333 habitants en 2008.

Le parc de logements, à Chammes, se décomposait en 2011 en sept appartements et 181 maisons soit
 un marché plutôt équilibré.

Si vous envisagez de demenager à Chammes, vous pourrez aisément trouver une maison à acheter.

La ville propose quelques  équipements, elle dispose, entre autres, de un terrain de sport.

À proximité de Chammes sont localisées les villes de
Évron localisée à 8 km, 7 152 habitants,
Thorigné-en-Charnie à 8 km, 161 habitants,
Saint-Pierre-sur-Erve à 7 km, 136 habitants,
Torcé-Viviers-en-Charnie à 8 km, 730 habitants,
Saint-Christophe-du-Luat à 8 km, 703 habitants,
Blandouet à 4 km, 189 habitants,
 entre autres. De plus, Chammes est située à seulement 29 km de Laval.


text:
import * as types from '../actions/action-types';
const initialState = {
    showQuestions: false,
    showChooseCategory: true
};
const showQuestionsReducer = function (state = initialState, action) {
    switch (action.type) {
        case types.DISPLAY_QUESTIONS:
            return Object.assign({}, state, { showQuestions: action.payload });

        case types.CHOOSE_CATEGORY_STATUS:
            return Object.assign({}, state, { showChooseCategory: action.payload });
        default:
            return state;
    }

}

export default showQuestionsReducer;


text:
ActiveRecord::Schema.define(version: 20130906050242) do

  create_table "tasks", force: true do |t|
    t.string   "name"
    t.string   "priority"
    t.string   "status"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

end


text:
// Code generated by client-gen. DO NOT EDIT.

package v1

type StorageClassExpansion interface{}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Cake.Common.Tests.Fixtures.Tools.SpecFlow.TestExecutionReport;
using Cake.Common.Tools.MSTest;
using Cake.Common.Tools.NUnit;
using Cake.Common.Tools.XUnit;
using Cake.Core;
using Cake.Core.IO;
using Cake.Testing;
using Xunit;

namespace Cake.Common.Tests.Unit.Tools.SpecFlow.TestExecutionReport
{
    public sealed class SpecFlowTestExecutionReporterTests
    {
        public sealed class TheRunMethod
        {
            [Fact]
            public void Should_Throw_If_Context_Is_Null()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Context = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "context");
            }

            [Fact]
            public void Should_Throw_If_Action_Is_Null()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Action = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "action");
            }

            [Fact]
            public void Should_Throw_If_Project_File_Is_Null()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.ProjectFile = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "projectFile");
            }

            [Fact]
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Settings = null;

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsArgumentNullException(result, "settings");
            }

            [Fact]
            public void Should_Throw_If_No_Tool_Was_Intercepted()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Action = context => { };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "No tool was started.");
            }

            [Fact]
            public void Should_Capture_Tool_And_Arguments_From_Action()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("mstestexecutionreport \"/Working/Tests.csproj\" " +
                             "/testResult:\"/Working/TestResult.trx\"", result.Args);
            }

            [Fact]
            public void Should_Throw_If_Action_Is_Not_Supported()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Action = context =>
                {
                    context.ProcessRunner.Start(
                        new FilePath("/Working/tools/Test.exe"),
                        new ProcessSettings
                        {
                            Arguments = null
                        });
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "Unsupported tool /Working/tools/Test.exe.");
            }

            [Theory]
            [InlineData(null)]
            [InlineData(" ")]
            public void Should_Throw_If_Action_Does_Not_Contain_Arguments(string arguments)
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Action = context =>
                {
                    context.ProcessRunner.Start(
                        new FilePath("/Working/tools/MSTest.exe"),
                        new ProcessSettings
                        {
                            Arguments = arguments
                        });
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "No arguments were found for tool.");
            }

            [Fact]
            public void Should_Append_Out()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Settings.Out = "/Working/out.html";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("mstestexecutionreport \"/Working/Tests.csproj\" " +
                             "/testResult:\"/Working/TestResult.trx\" " +
                             "/out:\"/Working/out.html\"", result.Args);
            }

            [Fact]
            public void Should_Append_XsltFile()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Settings.XsltFile = "/Working/template.xslt";

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("mstestexecutionreport \"/Working/Tests.csproj\" " +
                             "/testResult:\"/Working/TestResult.trx\" " +
                             "/xsltFile:\"/Working/template.xslt\"", result.Args);
            }

            [Fact]
            public void Should_Rethrow_Exception_From_Action()
            {
                // Given
                var exception = new CakeException("The exception message");
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Settings.ThrowOnTestFailure = true;
                var intercepting = true;

                fixture.Action = context =>
                {
                    context.ProcessRunner.Start(
                        new FilePath("/Working/tools/MSTest.exe"),
                        new ProcessSettings()
                        {
                            Arguments = "/resultsfile:\"/Working/TestResult.trx\""
                        });

                    // Quick fix to avoid throwing exception while intercepting action
                    if (intercepting)
                    {
                        intercepting = false;
                    }
                    else
                    {
                        throw exception;
                    }
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, exception.Message);
            }

            [Fact]
            public void Should_Not_Rethrow_Exception_From_Action()
            {
                // Given
                var exception = new CakeException("The exception message");
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.Settings.ThrowOnTestFailure = false;
                var intercepting = true;

                fixture.Action = context =>
                {
                    var process = context.ProcessRunner.Start(
                        new FilePath("/Working/tools/MSTest.exe"),
                        new ProcessSettings()
                        {
                            Arguments = "/resultsfile:\"/Working/TestResult.trx\""
                        });

                    // Quick fix to avoid throwing exception while intercepting action
                    if (intercepting)
                    {
                        intercepting = false;
                    }
                    else
                    {
                        throw exception;
                    }
                };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("mstestexecutionreport \"/Working/Tests.csproj\" " +
                             "/testResult:\"/Working/TestResult.trx\"", result.Args);
            }

            [Fact]
            public void Should_Capture_XUnit2()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/xunit.console.exe");

                var xUnit2Settings = new XUnit2Settings { ShadowCopy = false };
                xUnit2Settings.ArgumentCustomization = builder => builder.Append("-nunit \"/Working/TestResult.xml\"");

                fixture.Action = context =>
                {
                    context.XUnit2(new FilePath[] { "./Test.dll" }, xUnit2Settings);
                };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("nunitexecutionreport \"/Working/Tests.csproj\" " +
                             "/xmlTestResult:\"/Working/TestResult.xml\"", result.Args);
            }

            [Fact]
            public void Should_Capture_XUnit2_And_Throw_If_NUnit_Is_Missing()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/xunit.console.exe");

                fixture.Action = context =>
                {
                    context.XUnit2(new FilePath[] { "./Test.dll" }, new XUnit2Settings { ShadowCopy = false });
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "XUnit2 must contain argument \"-nunit <filename>\"");
            }

            [Fact]
            public void Should_Capture_NUnit3()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/nunit3-console.exe");

                var nUnit3Settings = new NUnit3Settings
                {
                    ShadowCopy = false,
                    Results = "/Working/TestResult.xml",
                    ResultFormat = "nunit2",
                    Labels = NUnit3Labels.All,
                    OutputFile = "/Working/TestResult.txt"
                };

                fixture.Action = context =>
                {
                    context.NUnit3(new FilePath[] { "./Test.dll" }, nUnit3Settings);
                };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("nunitexecutionreport \"/Working/Tests.csproj\" " +
                             "/xmlTestResult:\"/Working/TestResult.xml\" " +
                             "/testOutput:\"/Working/TestResult.txt\"", result.Args);
            }

            [Fact]
            public void Should_Capture_NUnit3_And_Throw_If_Result_Is_Missing()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/nunit3-console.exe");

                var nUnit3Settings = new NUnit3Settings
                {
                    ShadowCopy = false,
                    Labels = NUnit3Labels.All,
                    OutputFile = "/Working/TestResult.txt"
                };

                fixture.Action = context =>
                {
                    context.NUnit3(new FilePath[] { "./Test.dll" }, nUnit3Settings);
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "NUnit3 must contain argument \"--result=<filename>;format=nunit2\"");
            }

            [Fact]
            public void Should_Capture_NUnit3_And_Throw_If_Output_Is_Missing()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/nunit3-console.exe");

                var nUnit3Settings = new NUnit3Settings
                {
                    ShadowCopy = false,
                    Results = "/Working/TestResult.xml",
                    ResultFormat = "nunit2"
                };

                fixture.Action = context =>
                {
                    context.NUnit3(new FilePath[] { "./Test.dll" }, nUnit3Settings);
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "NUnit3 must contain argument \"--out=<filename>\"");
            }

            [Fact]
            public void Should_Capture_NUnit3_And_Throw_If_Labels_Is_Missing()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/nunit3-console.exe");

                var nUnit3Settings = new NUnit3Settings
                {
                    ShadowCopy = false,
                    Results = "/Working/TestResult.xml",
                    ResultFormat = "nunit2",
                    OutputFile = "/Working/TestResult.txt"
                };

                fixture.Action = context =>
                {
                    context.NUnit3(new FilePath[] { "./Test.dll" }, nUnit3Settings);
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "NUnit3 must contain argument \"--labels=All\"");
            }

            [Fact]
            public void Should_Capture_MSTest()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/MSTest.exe");

                var msTestSettings = new MSTestSettings
                {
                    NoIsolation = true
                };
                msTestSettings.ArgumentCustomization = builder => builder.Append("/resultsfile:/Working/TestResult.trx");
                msTestSettings.ToolPath = "/Working/tools/MSTest.exe";

                fixture.Action = context =>
                {
                    context.MSTest(new FilePath[] { "./Test.dll" }, msTestSettings);
                };

                // When
                var result = fixture.Run();

                // Then
                Assert.Equal("mstestexecutionreport \"/Working/Tests.csproj\" " +
                             "/testResult:/Working/TestResult.trx", result.Args);
            }

            [Fact]
            public void Should_Capture_MSTest_And_Throw_If_ResultsFile_Is_Missing()
            {
                // Given
                var fixture = new SpecFlowTestExecutionReporterFixture();
                fixture.FileSystem.CreateFile("/Working/tools/MSTest.exe");

                var msTestSettings = new MSTestSettings
                {
                    NoIsolation = true
                };
                msTestSettings.ToolPath = "/Working/tools/MSTest.exe";

                fixture.Action = context =>
                {
                    context.MSTest(new FilePath[] { "./Test.dll" }, msTestSettings);
                };

                // When
                var result = Record.Exception(() => fixture.Run());

                // Then
                Assert.IsCakeException(result, "MSTest must contain argument \"/resultsfile:<filename>\"");
            }
        }
    }
}


text:
@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) DataSource *dataSource;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

//    [self loadTableView];

//    [self testDuckEntity];

//    [self testDependencyInjection];

//    [self testZombieClass];

    [self testBlock];
}

- (void)testBlock
{
    void (^someBlock)();

    int i = 3;

    if ( i > 1) {

        someBlock = [^{
            NSLog(@"someBlock 1");
        } copy];

    }else {

        someBlock = [^{
            NSLog(@"someBlock 2");
        } copy];
    }
    someBlock();
}

- (void)testZombieClass
{
    testRelease();
}

- (void)testDependencyInjection
{
    LinZhiLing *implementA = [[LinZhiLing alloc] init];
    ZhangYang *implementB = [[ZhangYang alloc] init];

    id<DIProxy,GirlFriend> girl = DIProxyCreate();
    [girl injectDependencyObject:implementA forProtocol:@protocol(GirlFriend)];
    [girl kiss];
    [girl injectDependencyObject:implementB forProtocol:@protocol(GirlFriend)];
    [girl kiss];
}

- (void)testDuckEntity
{
    NSDictionary *dic = @{@"name":@"xiaobai",
                          @"sex":@"man",
                          @"age":@"13",
                          @"teacher":@"teacher Li"};
    NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:0 error:nil];
    NSString *jsonString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

    id<UserDuckEntry> entity = DuckEntityCreateWithJSON(jsonString);
    NSLog(@"name:%@  ",entity.name);

    entity.teacher = @"teacher Luo";
    NSLog(@"teacher: %@",entity.teacher);
}

- (void)testProxy
{
    Person *person = [[Person alloc] init];
    [person run];

    DealerProxy *proxy = [DealerProxy dealerProxy];
    [proxy purchaseBookWithTitle:@"horizon"];
    [proxy purchaseClothesWithSize:@"small"];
}

- (void)loadTableView
{
    if (!_tableView) {
        UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height) style:UITableViewStylePlain];
//        tableView.dataSource = (Class <UITableViewDataSource>)[DataSource class];
        _dataSource = [[DataSource alloc] init];
        tableView.dataSource = _dataSource;
        _tableView = tableView;
        [self.view addSubview:_tableView];
    }
}

@end


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace triage.database.install {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class InstallScripts {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal InstallScripts() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("triage.database.install.InstallScripts", typeof(InstallScripts).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to CREATE PROCEDURE [dbo].[Module_Insert]
        ///    @name nvarchar(256)
        ///AS
        ///BEGIN
        ///BEGIN TRANSACTION
        ///    DECLARE @MID as int
        ///    SELECT @MID = [M].[Id]
        ///    FROM [Modules] AS [M]
        ///    WHERE [M].[Name] = @name
        ///
        ///    IF @MID IS NULL -- if the module doesn't exist create it
        ///    BEGIN
        ///        INSERT INTO Modules([Name])
        ///        VALUES ( @name )
        ///        SELECT @MID = SCOPE_IDENTITY()
        ///    END
        ///COMMIT TRANSACTION
        ///SELECT @MID, @name
        ///END.
        /// </summary>
        internal static string Create_Module_Insert {
            get {
                return ResourceManager.GetString("Create_Module_Insert", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to CREATE PROCEDURE [dbo].[Routine_Insert]
        ///    @name nvarchar(256)
        ///AS
        ///BEGIN
        ///BEGIN TRANSACTION
        ///    DECLARE @RID as int
        ///    SELECT @RID = [R].[Id]
        ///    FROM [Routine] AS [R]
        ///    WHERE [R].[Name] = @name
        ///
        ///    IF @RID IS NULL -- if the method wasn't found create it
        ///    BEGIN
        ///        INSERT INTO Routine([Name])
        ///        VALUES ( @name )
        ///        SELECT @RID = SCOPE_IDENTITY()
        ///    END
        ///COMMIT TRANSACTION
        ///SELECT @RID, @name
        ///END.
        /// </summary>
        internal static string Create_Routine_Insert {
            get {
                return ResourceManager.GetString("Create_Routine_Insert", resourceCulture);
            }
        }
    }
}


text:
<!doctype html>

  <title>Photódex</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="description" content="Photódex: Gotta snap 'em all!'">
  <meta name="author" content="JT Atomico">
  <meta property="og:image" content="preview.jpg" />
  <link rel="icon" href="favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="styles/main.css">

PHOTÓDEX

SNAPPED: 0

LOADING


text:
<?php

require_once __DIR__ . '/ProtectedController.class.php';
require_once __DIR__ . '/../models/Image.class.php';

class ImageDeleteController extends ProtectedController {
    /**
     * Display a confirmation page
     *
     * @param Request $request
     * @param array $params
     * @return void
     */
    protected function get($request, $params) {
        $this->image = Image::findRecord($params[0]);

        $this->checkPermission($this->image->galery, $request);

        $this->render('image-delete');
    }

    /**
     * Delete an image
     *
     * @param Request $request
     * @param array $params
     * @return void
     */
    protected function post($request, $params) {
        $image = Image::findRecord($params[0]);

        $this->checkPermission($image->galery, $request);

        $image->delete();

        $this->redirect('/galery/' . $image->galery->id);
    }
}


text:
@interface JLAlertView ()

@property (nonatomic, strong)UIWindow *oldKeyWindow;
@property (nonatomic, strong)UIWindow *alertWindow;
@property (nonatomic, strong)JLAlertBackGroundWindow *alert__BackGroundView;

- (void)initializeView;
+ (UIViewController *)getCurrentViewController:(UIViewController *)vc;
+ (UIWindow *)getBusinessWindow;

@end

@interface JLAlertViewController ()

@property (nonatomic, strong) JLAlertView *alertView;

@end

@implementation JLAlertViewController

#pragma mark - View life cycle
- (void)dealloc
{
    NSLog(@"JLAlertViewConroller--dealloc");
}

- (instancetype)initWithAlertView:(JLAlertView *)alertView
{
    if (self = [super init]) {
        self.alertView = alertView;
    }
    return self;
}

- (void)loadView
{
    if (self.alertView) {
        self.view = self.alertView;
    } else {
        self.view = [[UIView alloc]init];
    }
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor clearColor];

    [self.alertView initializeView];

    [UIApplication sharedApplication].statusBarHidden = _rootViewControllerPrefersStatusBarHidden;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [UIApplication sharedApplication].statusBarHidden = _rootViewControllerPrefersStatusBarHidden;
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];

    [UIApplication sharedApplication].statusBarHidden = _rootViewControllerPrefersStatusBarHidden;
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    [self.alertView setNeedsLayout];
}

- (BOOL)prefersStatusBarHidden
{
    UIViewController *viewController = [[JLAlertView getBusinessWindow] rootViewController];

    UIViewController *temViewController = nil;
    do {
        temViewController = [viewController childViewControllerForStatusBarHidden];
        if (temViewController)
        {
            viewController = temViewController;
        }

    } while (temViewController != nil);
    if ([viewController isEqual:self]) {
        return NO;
    }
    return [viewController prefersStatusBarHidden];
}
- (BOOL)shouldAutorotate
{
    UIViewController *viewController = [[JLAlertView getBusinessWindow] rootViewController];
    UIViewController *disPlayVC = [JLAlertView getCurrentViewController:viewController];
    if ([disPlayVC isEqual:self]) {
        return YES;
    }
    return [disPlayVC shouldAutorotate];
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    UIViewController *viewController = [[JLAlertView getBusinessWindow] rootViewController];
    UIViewController *disPlayVC = [JLAlertView getCurrentViewController:viewController];
    if ([disPlayVC isEqual:self]) {
        return UIInterfaceOrientationMaskAll;
    }
    return [disPlayVC supportedInterfaceOrientations];
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
    UIViewController *viewController = [[JLAlertView getBusinessWindow] rootViewController];

    UIViewController *temViewController = nil;
    do {
        temViewController = [viewController childViewControllerForStatusBarStyle];
        if (temViewController)
        {
            viewController = temViewController;
        }

    } while (temViewController != nil);
    if ([viewController isEqual:self]) {
        return UIStatusBarStyleDefault;
    }
    return [viewController preferredStatusBarStyle];
}

@end


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

namespace Cake.Common.Solution.Project.Properties
{
    /// <summary>
    /// Represents the content in an assembly info file.
    /// </summary>
    public sealed class AssemblyInfoParseResult
    {
        private readonly bool _clsCompliant;
        private readonly string _company;
        private readonly bool _comVisible;
        private readonly string _configuration;
        private readonly string _copyright;
        private readonly string _description;
        private readonly string _assemblyFileVersion;
        private readonly string _guid;
        private readonly string _assemblyInformationalVersion;
        private readonly string _product;
        private readonly string _title;
        private readonly string _trademark;
        private readonly string _assemblyVersion;
        private readonly List<string> _internalsVisibleTo;

        /// <summary>
        /// Gets a value indicating whether the assembly is CLS compliant.
        /// </summary>
        /// <value>
        ///   <c>true</c> if the assembly is CLS compliant; otherwise, <c>false</c>.
        /// </value>
        public bool ClsCompliant
        {
            get { return _clsCompliant; }
        }

        /// <summary>
        /// Gets the assembly company attribute.
        /// </summary>
        /// <value>The assembly company attribute.</value>
        public string Company
        {
            get { return _company; }
        }

        /// <summary>
        /// Gets a value indicating whether the assembly is accessible from COM.
        /// </summary>
        /// <value>
        ///   <c>true</c> if the assembly is accessible from COM; otherwise, <c>false</c>.
        /// </value>
        public bool ComVisible
        {
            get { return _comVisible; }
        }

        /// <summary>
        /// Gets the assembly configuration attribute.
        /// </summary>
        /// <value>The assembly Configuration attribute.</value>
        public string Configuration
        {
            get { return _configuration; }
        }

        /// <summary>
        /// Gets the assembly copyright attribute.
        /// </summary>
        /// <value>The assembly copyright attribute.</value>
        public string Copyright
        {
            get { return _copyright; }
        }

        /// <summary>
        /// Gets the assembly's description attribute.
        /// </summary>
        /// <value>The assembly's Description attribute.</value>
        public string Description
        {
            get { return _description; }
        }

        /// <summary>
        /// Gets the assembly file version.
        /// </summary>
        /// <value>The assembly file version.</value>
        public string AssemblyFileVersion
        {
            get { return _assemblyFileVersion; }
        }

        /// <summary>
        /// Gets the assembly GUID attribute.
        /// </summary>
        /// <value>The assembly GUID attribute.</value>
        public string Guid
        {
            get { return _guid; }
        }

        /// <summary>
        /// Gets the assembly informational version.
        /// </summary>
        /// <value>The assembly informational version.</value>
        public string AssemblyInformationalVersion
        {
            get { return _assemblyInformationalVersion; }
        }

        /// <summary>
        /// Gets the assembly product Attribute.
        /// </summary>
        /// <value>The assembly product attribute.</value>
        public string Product
        {
            get { return _product; }
        }

        /// <summary>
        /// Gets the assembly title Attribute.
        /// </summary>
        /// <value>The assembly Title attribute.</value>
        public string Title
        {
            get { return _title; }
        }

        /// <summary>
        /// Gets the assembly trademark Attribute.
        /// </summary>
        /// <value>The assembly Trademark attribute.</value>
        public string Trademark
        {
            get { return _trademark; }
        }

        /// <summary>
        /// Gets the assembly version.
        /// </summary>
        /// <value>The assembly version.</value>
        public string AssemblyVersion
        {
            get { return _assemblyVersion; }
        }

        /// <summary>
        /// Gets the assemblies that internals are visible to.
        /// </summary>
        /// <value>The assemblies that internals are visible to.</value>
        public ICollection<string> InternalsVisibleTo
        {
            get { return _internalsVisibleTo; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AssemblyInfoParseResult"/> class.
        /// </summary>
        /// <param name="clsCompliant">Whether the assembly is CLS compliant.</param>
        /// <param name="company">The assembly company attribute.</param>
        /// <param name="comVisible">Whether the assembly is accessible from COM.</param>
        /// <param name="configuration">The assembly configuration attribute.</param>
        /// <param name="copyright">The assembly copyright attribute.</param>
        /// <param name="description">The assembly description attribute.</param>
        /// <param name="assemblyFileVersion">The assembly file version.</param>
        /// <param name="guid">The assembly GUID attribute.</param>
        /// <param name="assemblyInformationalVersion">The assembly informational version.</param>
        /// <param name="product">The assembly product attribute.</param>
        /// <param name="title">The assembly title attribute.</param>
        /// <param name="trademark">The assembly trademark attribute.</param>
        /// <param name="assemblyVersion">The assembly version.</param>
        /// <param name="internalsVisibleTo">The assemblies that internals are visible to.</param>
        public AssemblyInfoParseResult(string clsCompliant,
            string company,
            string comVisible,
            string configuration,
            string copyright,
            string description,
            string assemblyFileVersion,
            string guid,
            string assemblyInformationalVersion,
            string product,
            string title,
            string trademark,
            string assemblyVersion,
            IEnumerable<string> internalsVisibleTo)
        {
            _clsCompliant = !string.IsNullOrWhiteSpace(clsCompliant) && bool.Parse(clsCompliant);
            _company = company ?? string.Empty;
            _comVisible = !string.IsNullOrWhiteSpace(comVisible) && bool.Parse(comVisible);
            _configuration = configuration ?? string.Empty;
            _copyright = copyright ?? string.Empty;
            _description = description ?? string.Empty;
            _assemblyFileVersion = assemblyFileVersion ?? string.Empty;
            _guid = guid ?? string.Empty;
            _assemblyInformationalVersion = assemblyInformationalVersion ?? string.Empty;
            _product = product ?? string.Empty;
            _title = title ?? string.Empty;
            _trademark = trademark ?? string.Empty;
            _assemblyVersion = assemblyVersion ?? string.Empty;
            _internalsVisibleTo = new List<string>(internalsVisibleTo ?? Enumerable.Empty<string>());
        }
    }
}


text:
package schedule

import (
	"bytes"
	"fmt"
	"time"
)

type CommitSchedule [7][53]Entry

type Entry struct {
	DateTime   time.Time
	NumCommits int
}

const (
	EMPTY         = 0
	NUM_WEEK_DAYS = 7
)

var NOT_A_FIELD = Entry{NumCommits: -1}

// BuildCommitSchedule returns an empty CommitSchedule, where all fiels are
// initialized with EMPTY except those which are not in the range of days.
// The CommitSchedule is a table of ints.
func BuildCommitSchedule(days []time.Time) CommitSchedule {
	firstWeek := buildFirstWeek(days[0])
	lastWeek := buildLastWeek(days[len(days)-1])
	return connectWeeksToSchedule(firstWeek, lastWeek)
}

// IsNotAField returns true if the given entry has the same datetime as NOT_A_FIELD.
func IsNotAField(entry Entry) bool {
	return entry.DateTime.Equal(NOT_A_FIELD.DateTime)
}

// buildFirstWeek creates NUM_WEEK_DAYS schedule entries, where the entries
// before the given week day are NOT_A_FIELD and EMPTY afterwards (including given day)
func buildFirstWeek(day time.Time) []Entry {
	var firstWeek []Entry
	weekday := day.Weekday()
	for i := 0; i < NUM_WEEK_DAYS; i++ {
		if i < int(weekday) {
			firstWeek = append(firstWeek, NOT_A_FIELD)
		} else {
			firstWeek = append(firstWeek, Entry{day, EMPTY})
			day = day.AddDate(0, 0, 1)
		}
	}
	return firstWeek
}

// buildLastWeek creates NUM_WEEK_DAYS schedule entries, where the entries
// after the given week day are NOT_A_FIELD and EMPTY before (including given day)
func buildLastWeek(day time.Time) []Entry {
	var lastWeek []Entry
	weekday := day.Weekday()
	day = getFirstDayOfWeek(day)
	for i := 0; i < NUM_WEEK_DAYS; i++ {
		if i > int(weekday) {
			lastWeek = append(lastWeek, NOT_A_FIELD)
		} else {
			lastWeek = append(lastWeek, Entry{day, EMPTY})
			day = day.AddDate(0, 0, 1)
		}
	}
	return lastWeek
}

// getFirstDayOfWeek returns the first day of the given days week.
// i.e. we always return the last sunday before the given day.
func getFirstDayOfWeek(day time.Time) time.Time {
	return day.AddDate(0, 0, -int(day.Weekday()))
}

// connectWeeksToSchedule creates a CommitSchedule, by first and last week,
// filling in the weeks inbetween and initializing everything inbetween with EMPTY
func connectWeeksToSchedule(firstWeek, lastWeek []Entry) CommitSchedule {
	schedule := new(CommitSchedule)
	var day = firstWeek[len(firstWeek)-1].DateTime
	// var adjustedDay time.Time
	for rowIndex, row := range schedule {
		for columnIndex := range row {
			if columnIndex == 0 {
				schedule[rowIndex][columnIndex] = firstWeek[rowIndex]
			} else if columnIndex == 52 {
				schedule[rowIndex][columnIndex] = lastWeek[rowIndex]
			} else {
				adjustedDay := day.AddDate(0, 0, getDeltaDays(rowIndex, columnIndex))
				schedule[rowIndex][columnIndex] = Entry{adjustedDay, EMPTY}
			}
		}
	}
	return *schedule
}

// getDeltaDays returns the day which need to be added to the last day of the
// first week to get the date for the position at (rowIndex, columnIndes).
func getDeltaDays(rowIndex, columnIndex int) int {
	return columnIndex*7 - (6 - rowIndex)
}

// String returns a string representing the CommitSchedule.
func (schedule CommitSchedule) String() string {
	var buffer bytes.Buffer
	for _, row := range schedule {
		for _, entry := range row {
			// entryString := fmt.Sprintf("(%s,%d) ", entry.DateTime.String(), entry.NumCommits)
			entryString := fmt.Sprintf("(%s,%d) ", entry.DateTime.Weekday().String(), entry.NumCommits)
			buffer.WriteString(entryString)
		}
		buffer.WriteString("\n")
	}
	return buffer.String()
}


text:
// ==++==
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--==
/*============================================================
**
** Class:  FileAttributes
**
** Purpose: File attribute flags corresponding to NT's flags.
**
**
===========================================================*/
using System;

namespace System.IO {
    // File attributes for use with the FileEnumerator class.
    // These constants correspond to the constants in WinNT.h.
    //
[Serializable]
    [Flags]
[System.Runtime.InteropServices.ComVisible(true)]
    public enum FileAttributes
    {
        // From WinNT.h (FILE_ATTRIBUTE_XXX)
        ReadOnly = 0x1,
        Hidden = 0x2,
        System = 0x4,
        Directory = 0x10,
        Archive = 0x20,
        Device = 0x40,
        Normal = 0x80,
        Temporary = 0x100,
        SparseFile = 0x200,
        ReparsePoint = 0x400,
        Compressed = 0x800,
        Offline = 0x1000,
        NotContentIndexed = 0x2000,
        Encrypted = 0x4000,

#if !FEATURE_CORECLR
#if FEATURE_COMINTEROP
        [System.Runtime.InteropServices.ComVisible(false)]
#endif // FEATURE_COMINTEROP
        IntegrityStream = 0x8000,

#if FEATURE_COMINTEROP
        [System.Runtime.InteropServices.ComVisible(false)]
#endif // FEATURE_COMINTEROP
        NoScrubData = 0x20000,
#endif
    }
}


text:
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.debug.ui.editors;

import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
import org.eclipse.jface.text.rules.EndOfLineRule;
import org.eclipse.jface.text.rules.IRule;
import org.eclipse.jface.text.rules.IWhitespaceDetector;
import org.eclipse.jface.text.rules.IWordDetector;
import org.eclipse.jface.text.rules.MultiLineRule;
import org.eclipse.jface.text.rules.NumberRule;
import org.eclipse.jface.text.rules.SingleLineRule;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WhitespaceRule;
import org.eclipse.jface.text.rules.WordRule;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.RGB;

/**
 * JavaScript code scanner for source code highlighting.
 */
public class JsCodeScanner extends BufferedRuleBasedScanner {

  private Token commentToken;

  private final TextAttribute commentAttribute =
      new TextAttribute(EditorColors.getColor(new RGB(63, 127, 95)), null, SWT.NORMAL);

  private final TextAttribute jsDocAttribute =
      new TextAttribute(EditorColors.getColor(new RGB(127,127,159)), null, SWT.NORMAL);

  public JsCodeScanner() {
    createRules();
  }

  public TextAttribute getCommentAttribute() {
    return commentAttribute;
  }

  public TextAttribute getJsDocAttribute() {
    return jsDocAttribute;
  }

  /**
   * Use the default Eclipse higlighting scheme.
   */
  private void createRules() {
    Token keywordToken = new Token(
        new TextAttribute(EditorColors.getColor(new RGB(127, 0, 85)), null, SWT.BOLD));

    commentToken = new Token(commentAttribute);

    Token jsDocToken = new Token(jsDocAttribute);

    Token stringToken = new Token(
        new TextAttribute(EditorColors.getColor(new RGB(42, 0, 255)), null, SWT.NORMAL));

    RGB blackRgb = new RGB(0, 0, 0);

    Token numberToken = new Token(
        new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));

    Token normalToken = new Token(
        new TextAttribute(EditorColors.getColor(blackRgb), null, SWT.NORMAL));
    setDefaultReturnToken(normalToken);

    setRules(new IRule[] {
        new EndOfLineRule("//", commentToken), //$NON-NLS-1$
        new KeywordRule(keywordToken),
        new MultiLineRule("/**", "*/", jsDocToken, (char) 0, false),  //$NON-NLS-1$ //$NON-NLS-2$
        new MultiLineRule("/*", "*/", commentToken, (char) 0, false),  //$NON-NLS-1$ //$NON-NLS-2$
        new SingleLineRule("\"", "\"", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
        // Regexp
        new SingleLineRule("/", "/", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
        new SingleLineRule("'", "'", stringToken, '\\'), //$NON-NLS-1$ //$NON-NLS-2$
        new WhitespaceRule(new IWhitespaceDetector() {
          public boolean isWhitespace(char c) {
            return Character.isWhitespace(c);
          }
        }),

        new WordRule(new WordDetector(), normalToken),
        new NumberRule(numberToken),
    });
  }

  private static class KeywordRule extends WordRule {

    private static final String[] KEYWORDS = {
      "break", //$NON-NLS-1$
      "case", //$NON-NLS-1$
      "catch", //$NON-NLS-1$
      "const", //$NON-NLS-1$
      "continue", //$NON-NLS-1$
      "debugger", //$NON-NLS-1$
      "default", //$NON-NLS-1$
      "delete", //$NON-NLS-1$
      "do", //$NON-NLS-1$
      "else", //$NON-NLS-1$
      "false", //$NON-NLS-1$
      "finally", //$NON-NLS-1$
      "for", //$NON-NLS-1$
      "function", //$NON-NLS-1$
      "if", //$NON-NLS-1$
      "in", //$NON-NLS-1$
      "instanceof", //$NON-NLS-1$
      "new", //$NON-NLS-1$
      "null", //$NON-NLS-1$
      "return", //$NON-NLS-1$
      "switch", //$NON-NLS-1$
      "this", //$NON-NLS-1$
      "throw", //$NON-NLS-1$
      "true", //$NON-NLS-1$
      "try", //$NON-NLS-1$
      "typeof", //$NON-NLS-1$
      "var", //$NON-NLS-1$
      "void", //$NON-NLS-1$
      "while", //$NON-NLS-1$
      "with", //$NON-NLS-1$

      // Highlight important qualifiers
      "__proto__", //$NON-NLS-1$
      "prototype", //$NON-NLS-1$
    };

    public KeywordRule(Token token) {
      super(new WordDetector());

      for (String word : KEYWORDS) {
        addWord(word, token);
      }
    }
  }

  private static class WordDetector implements IWordDetector {

    public boolean isWordPart(char c) {
      return Character.isJavaIdentifierPart(c);
    }

    public boolean isWordStart(char c) {
      return Character.isJavaIdentifierStart(c);
    }

  }
}


text:
% Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
\noindent
\mbox{}input\ =\ \{torch.\textbf{randn}(3,4),\ torch.\textbf{randn}(3,4),\ torch.\textbf{randn}(3,4)\} \\
\mbox{}\textbf{rnn:forward}(input[1]) \\
\mbox{}\textbf{rnn:forward}(input[2]) \\
\mbox{}\textbf{rnn:forward}(input[3])


text:
<?php

/* FOSUserBundle:Group:show_content.html.twig */
class __TwigTemplate_922a0cd18767c9f61b6ee577fe6a3205b6941ed0a3a4ec415d3aec26e3a23f7e extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 2
        echo "

";
        // line 4
        echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("group.show.name", array(), "FOSUserBundle"), "html", null, true);
        echo ": ";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["group"]) ? $context["group"] : $this->getContext($context, "group")), "getName", array(), "method"), "html", null, true);
        echo "

";
    }

    public function getTemplateName()
    {
        return "FOSUserBundle:Group:show_content.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  23 => 4,  19 => 2,);
    }
}