text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef __ARCH_SYS_ARCH_H__
#define __ARCH_SYS_ARCH_H__

#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"

typedef xSemaphoreHandle sys_sem_t;
typedef xQueueHandle sys_mutex_t;
typedef xQueueHandle sys_mbox_t;
typedef xTaskHandle sys_thread_t;

#define SYS_MBOX_NULL (xQueueHandle)0
#define SYS_SEM_NULL  (xSemaphoreHandle)0

typedef unsigned long int sys_prot_t;

/* This optional function does a "fast" critical region protection and returns
the previous protection level. This function is only called during very short
critical regions. An embedded system which supports ISR-based drivers might want
to implement this function by disabling interrupts. Task-based systems might want
to implement this by using a mutex or disabling tasking. This function should
support recursive calls from the same task or interrupt. In other words,
sys_arch_protect() could be called while already protected. In that case the
return value indicates that it is already protected. */
extern sys_prot_t sys_arch_protect(void);

/* This optional function does a "fast" set of critical region protection to the
value specified by pval. See the documentation for sys_arch_protect() for more
information. This function is only required if your port is supporting an
operating system. */
extern void sys_arch_unprotect(sys_prot_t pval);

#endif /* __ARCH_SYS_ARCH_H__ */

redpajama_set_name: RedPajamaGithub


text:
package teamroots.emberroot.entity.ai;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.pathfinding.Path;
import net.minecraft.pathfinding.PathNavigate;
import net.minecraft.pathfinding.PathPoint;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;

public class EntityAIMountedAttackOnCollide extends EntityAIBase {
  World worldObj;
  EntityCreature attacker;
  int attackPause;
  double speedTowardsTarget;
  double speedTowardsTargetMounted;
  /**
   * When true, the mob will continue chasing its target, even if it can't find
   * a path to them right now.
   */
  boolean longMemory;
  Path entityPathEntity;
  Class<?> classTarget;
  private int pathUpdateTimer;
  private double targetPosX;
  private double targetPosY;
  private double targetPosZ;
  private int failedPathFindingPenalty;
  public EntityAIMountedAttackOnCollide(EntityCreature attacker, Class<?> targetClass, double speedTowardsTarget, double speedTowardsTargetMounted, boolean longMemory) {
    this(attacker, speedTowardsTarget, speedTowardsTargetMounted, longMemory);
    this.classTarget = targetClass;
  }
  public EntityAIMountedAttackOnCollide(EntityCreature attacker, double speedTowardsTarget, double speedTowardsTargetMounted, boolean longMemory) {
    this.attacker = attacker;
    this.worldObj = attacker.world;
    this.speedTowardsTarget = speedTowardsTarget;
    this.speedTowardsTargetMounted = speedTowardsTargetMounted;
    this.longMemory = longMemory;
    this.setMutexBits(3);
  }
  /**
   * Returns whether the EntityAIBase should begin execution.
   */
  public boolean shouldExecute() {
    EntityLivingBase entitylivingbase = attacker.getAttackTarget();
    if (entitylivingbase == null) {
      return false;
    }
    else if (!entitylivingbase.isEntityAlive()) {
      return false;
    }
    else if (this.classTarget != null && !classTarget.isAssignableFrom(entitylivingbase.getClass())) {
      return false;
    }
    else {
      if (--pathUpdateTimer <= 0) {
        entityPathEntity = getNavigator().getPathToEntityLiving(entitylivingbase);
        pathUpdateTimer = 4 + attacker.getRNG().nextInt(7);
        return entityPathEntity != null;
      }
      else {
        return true;
      }
    }
  }
  /**
   * Returns whether an in-progress EntityAIBase should continue executing
   */
  public boolean continueExecuting() {
    EntityLivingBase entitylivingbase = attacker.getAttackTarget();
    return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (!longMemory ? !getNavigator().noPath()
        : attacker.isWithinHomeDistanceCurrentPosition()));
  }
  /**
   * Execute a one shot task or start executing a continuous task
   */
  public void startExecuting() {
    PathNavigate nav = getNavigator();
    nav.setPath(entityPathEntity, speedTowardsTarget);
    pathUpdateTimer = 0;
  }
  /**
   * Resets the task
   */
  public void resetTask() {
    getNavigator().clearPathEntity();
  }
  /**
   * Updates the task
   */
  public void updateTask() {
    EntityLivingBase target = attacker.getAttackTarget();
    attacker.getLookHelper().setLookPositionWithEntity(target, 30.0F, 30.0F);
    --pathUpdateTimer;
    double distanceFromAttackerSq = attacker.getDistanceSq(target.posX, target.getEntityBoundingBox().minY, target.posZ);
    if ((longMemory || attacker.getEntitySenses().canSee(target))
        && pathUpdateTimer <= 0
        && (targetPosX == 0.0D && targetPosY == 0.0D && targetPosZ == 0.0D
            || target.getDistanceSq(targetPosX, targetPosY, targetPosZ) >= 1.0D || attacker.getRNG().nextFloat() < 0.05F)) {
      targetPosX = target.posX;
      targetPosY = target.getEntityBoundingBox().minY;
      targetPosZ = target.posZ;
      pathUpdateTimer = failedPathFindingPenalty + 4 + attacker.getRNG().nextInt(7);
      if (getNavigator().getPath() != null) {
        PathPoint finalPathPoint = getNavigator().getPath().getFinalPathPoint();
        if (finalPathPoint != null && target.getDistanceSq(finalPathPoint.x, finalPathPoint.y, finalPathPoint.z) < 1) {
          failedPathFindingPenalty = 0;
        }
        else {
          failedPathFindingPenalty += 10;
        }
      }
      else {
        failedPathFindingPenalty += 10;
      }
      if (distanceFromAttackerSq > 1024.0D) {
        pathUpdateTimer += 10;
      }
      else if (distanceFromAttackerSq > 256.0D) {
        pathUpdateTimer += 5;
      }
      if (!getNavigator().tryMoveToEntityLiving(target, getAttackSpeed())) {
        pathUpdateTimer += 15;
      }
    }
    attackPause = Math.max(attackPause - 1, 0);
    double d1 = getAttackReach(target);
    if (distanceFromAttackerSq <= d1 && attackPause <= 20) {
      attackPause = 20;
      if (attacker.getHeldItem(EnumHand.MAIN_HAND) != null) {
        attacker.swingArm(EnumHand.MAIN_HAND);
      }
      attacker.attackEntityAsMob(target);
    }
  }
  private double getAttackSpeed() {
    if (attacker.isRiding()) { return speedTowardsTargetMounted; }
    return speedTowardsTarget;
  }
  protected PathNavigate getNavigator() {
    return attacker.getNavigator();
  }
  protected double getAttackReach(EntityLivingBase target) {
    double res = attacker.width * 2.0 * attacker.width * 2.0 + target.width;
    if (attacker.isRiding()) {
      res += 1;
    }
    return res;
  }
}


text:
\section{Aufbau und Durchführung}
\subsection{Aufbau}
\label{sec:Aufbau}

Der Franck-Hertz-Versuch, Abbildung \ref{lel}, wird in einer Röhre durchgeführt, in der sich zwei Elektroden sowie ein Glühdraht befinden.
Der Glühdraht, auf dem eine konstante Heizspannung gegeben wird, dient durch den auftretenden glühelektrischen Effekt als Elektronenquelle.
Hierzu wird ein Metall mit einem hohen Schmelzpunkt, beispielsweise Wolfram, verwendet, so dass eine Elektronenwolke entsteht.
Diese Elektronen werden zu einer gitterförmigen Beschleunigungselektrode beschleunigt, welche sich in der Mitte der Röhre befindet.
Durch Wahl einer passenden Beschleunigungsspannung $U_B$ kann die Energiezufuhr der Elektronen gesteuert werden.
Am Ende des Gefäßes befindet sich zudem eine Auffängerelektrode, welche die Elektronen durch eine zwischen der Beschleunigungs- und Auffängerelektrode anliegenden Spannung $U_A$ abbremst.
Die Anzahl der auftreffenden Elektronen kann mithilfe eines Picoamperemeters anhand des Auffängerstroms $I_A$ bestimmt werden.
Dieses Messgerät verstärkt und wandelt den geringen Eingangsstrom um, so dass dieser als Spannung auf die Y-Achse eines XY-Schreibers gegeben werden kann.
Durch das zusätzliche Anlegen von $U_A$ oder $U_B$ am X-Eingang wird somit der Eingangsstrom in Abhängigkeit einer variablen Beschleunigungs- oder Bremsspannung graphisch dargestellt.
\\

Zudem ist in der evakuierten Röhre eine geringe Menge Quecksilber platziert, welches je nach gewählter Umgebungstemperatur $T$ einen variablen Dampfdruck $p_\text{sät}$ besitzt.
Die Temperatur wird mittels eines elektronischen Temperaturreglers geregelt und anhand eines zusätzlich angebrachten Thermometers kontrolliert.

\begin{figure}[H]
  \centering
  \includegraphics[height=6cm]{ressources/aufbau2.png}
  \caption{Aufbau des Franck-Hertz-Versuchs. \cite{skript}}
  \label{lel}
\end{figure}


text:
 package afk.frontend.swing.postgame;

import afk.frontend.swing.RootWindow;
import afk.game.GameMaster;
import afk.game.TournamentGameResult;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;

/**
 *
 * @author Jessica
 */
public class TournamentPostGamePanel extends JPanel
{
    public static final int TIMEOUT = 5000;

    private RootWindow parent;
    private JPanel pnlTop, pnlBottom;
    private JLabel lblTitle;
    private JButton btnNextGame;
    private TournamentTree tTree;
    private TournamentGameResult result;
    private GameMaster gm;
    private Timer timer;

    public TournamentPostGamePanel(RootWindow parent, TournamentGameResult result, GameMaster gm)
    {
        this.result = result;
        this.gm = gm;
        this.parent = parent;

        LayoutManager layout = new PostGamePanel_Layout();

        this.setLayout(layout);
        setup();
    }

    private void setup()
    {
        initComponents();
        addComponents();
        styleComponents();
    }

    private void initComponents()
    {
        lblTitle = new JLabel("Tournament Tree");
        btnNextGame = new JButton("Continue");
        tTree = new TournamentTree(result);
        timer = new Timer(TIMEOUT, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                gm.nextGame();
            }
        });
        timer.setRepeats(false);
        timer.start();

        tTree.addMouseListener(new MouseAdapter() {

            @Override
            public void mousePressed(MouseEvent e)
            {
                timer.stop();
            }

        });
    }

    private void addComponents()
    {
        pnlTop = new JPanel();
        pnlTop.add(lblTitle);
        add(pnlTop);
        add(tTree);
        pnlBottom = new JPanel();
        pnlBottom.add(btnNextGame);
        add(pnlBottom);
    }

//    private void removeComponents()
//    {
//        //TODO;
//    }
    private void styleComponents()
    {
        btnNextGame.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e)
            {
                timer.stop();
                gm.nextGame();
            }
        });
    }

    class PostGamePanel_Layout implements LayoutManager
    {

        int panelWidth = 800;
        int panelHeight = 600;

        @Override
        public void addLayoutComponent(String name, Component comp)
        {
        }

        @Override
        public void removeLayoutComponent(Component comp)
        {
        }

        @Override
        public Dimension preferredLayoutSize(Container parent)
        {
            Dimension dim = new Dimension(0, 0);

            Insets insets = parent.getInsets();

            dim.width = panelWidth + insets.left + insets.right;
            dim.height = panelHeight + insets.top + insets.bottom;

            return dim;
        }

        @Override
        public Dimension minimumLayoutSize(Container parent)
        {
            Dimension dim = new Dimension(600, 800);
            return dim;
        }

        @Override
        public void layoutContainer(Container parent)
        {
            Insets insets = parent.getInsets();

            int w = parent.getSize().width;
            int h = parent.getSize().height;

            Component c;

            int topHeight = 50;
            int bottomHeight = 50;
            int centerHeight = h-(topHeight+bottomHeight);

            //pnlTop

            c = parent.getComponent(0);
            if (c.isVisible())
            {
                c.setBounds(0, 0, w, topHeight);
            }

            // tree!

            c = parent.getComponent(1);
            if (c.isVisible())
            {
                c.setBounds(0, topHeight, w, centerHeight);
            }

            //pnlBottom

            c = parent.getComponent(2);
            if (c.isVisible())
            {
                c.setBounds(0, h-bottomHeight, w, bottomHeight);
            }
        }
    }
}


text:
import java.util.Arrays;

/*There are 100 doors in a long hallway. They are all closed.
 * The first time you walk by each door, you open it.
 * The second time around, you close every second door (since they are all opened).
 * On the third pass you stop at every third door and open it if it's closed, close it if it's open.
 * On the fourth pass, you take action on every fourth door. You repeat this pattern for 100 passes.
 * At the end of 100 passes, what doors are opened and what doors are closed?
 */

public class OneHundredDoors {

	static int[] doors= new int [100];

	public static void main(String[] args) {

		//Open all doors
		Arrays.fill(doors, 0);
		for(int i = 1; i<=99; i++){
			passDoors(i);
		}

		System.out.println(printDoors(100));

	}
	public static void passDoors(int pass){
		for(int i = pass-1; i <= 99; i+=pass){

			if(doors[i]==1){
				doors[i]=0;
			}else{
				doors[i]=1;
			}
		}
		//System.out.println(printDoors(pass));
	}
	public static String printDoors(int pass){
		String s="The following doors are open after "+pass+" passes:\n";
		for(int i=0;i<=99;i++){
			if(doors[i]==1){
				s+= i;
				s+= ", ";
			}
		}
		return s;
	}

}


text:
Mushroom is a super simple wrapper around ActiveSupport Instrumentation introduced in Rails 3.

Mushroom allows any component of your application to trigger events which later get subscribed to by any
other component in your application.

The returned event can be used to handle follow up behaviour, profile running code, and event dispatch requests to
other services.

## Installation

Add this line to your application's Gemfile:

    gem 'mushroom'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install mushroom

## Usage

**Simple example: Dispatch an event and receive it somewhere else**

```ruby

# app/models/server.rb
class Server
  include Mushroom

  def run
    notify :start #=> Dispatches a 'server:start' event with the current server instance as the event target.
  end
end

# lib/my_app/event_handler.rb
class EventHandler < Mushroom::Subscriber
  events :start, :on => Server

  def notify
    # Handle event here
    puts name     #=> "server:start"
    puts target   #=> <Server id:1 ...>
    puts duration #=> 0.001
  end
end

Server.new.run
```

**Slightly more advanced example: Instrument a method running, and display its duration:**

```ruby
class Server
  include Mushroom

  def start
    sleep 1
  end
  instrument :start
end

# lib/my_app/event_handler.rb
class EventHandler < Mushroom::Subscriber
  events :start, :on => Server

  def notify
    # Handle event here
    puts name     #=> "server:start"
    puts target   #=> <Server id:1 ...>
    puts duration #=> 1000.0
  end
end

Server.new.start
```

**Subscribing to multiple events:**

```ruby
# lib/my_app/event_handler.rb
class EventHandler < Mushroom::Subscriber
  events :start, :stop, :destroy, :on => Server
end
```

**Subscribing events to multiple targets**

```ruby
# lib/my_app/event_handler.rb
class EventHandler < Mushroom::Subscriber
  events :create, :destroy, :on => [Server, User, Account]
end
```

**Passing extra parameters to the subscriber**

```ruby
class Server
  include Mushroom

  def start
    notify :start, Time.now
  end
end

# lib/my_app/event_handler.rb
class EventHandler < Mushroom::Subscriber
  events :start, :on => Server

  def notify(started_at)
    puts started_at #=> 2012-04-26 16:56:54 +1000
  end
end

Server.new.start
```

Remember to declare all the arguments you expect to be received in `#notify` or you won't receive them all. You can also get the same
arguments from the `#payload` method.

## Subscriber API

The following methods are available on your Subscriber subclass:

```ruby
# payload
# name
# time
# transaction_id
# duration
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

# Author

- Ivan Vanderbyl


text:
import { isWritable } from './check'

/**
 * Specialized function for looping an array-like collection with `each={}`
 * @param   { Array } list - collection of items
 * @param   {Function} fn - callback function
 * @returns { Array } the array looped
 */
export function each(list, fn) {
  const len = list ? list.length : 0
  let i = 0
  for (; i < len; ++i) {
    fn(list[i], i)
  }
  return list
}

/**
 * Check whether an array contains an item
 * @param   { Array } array - target array
 * @param   { * } item - item to test
 * @returns { Boolean } -
 */
export function contains(array, item) {
  return array.indexOf(item) !== -1
}

/**
 * Convert a string containing dashes to camel case
 * @param   { String } str - input string
 * @returns { String } my-string -> myString
 */
export function toCamel(str) {
  return str.replace(/-(\w)/g, (_, c) => c.toUpperCase())
}

/**
 * Faster String startsWith alternative
 * @param   { String } str - source string
 * @param   { String } value - test string
 * @returns { Boolean } -
 */
export function startsWith(str, value) {
  return str.slice(0, value.length) === value
}

/**
 * Helper function to set an immutable property
 * @param   { Object } el - object where the new property will be set
 * @param   { String } key - object key where the new property will be stored
 * @param   { * } value - value of the new property
 * @param   { Object } options - set the propery overriding the default options
 * @returns { Object } - the initial object
 */
export function defineProperty(el, key, value, options) {
  Object.defineProperty(el, key, extend({
    value,
    enumerable: false,
    writable: false,
    configurable: true
  }, options))
  return el
}

/**
 * Extend any object with other properties
 * @param   { Object } src - source object
 * @returns { Object } the resulting extended object
 *
 * var obj = { foo: 'baz' }
 * extend(obj, {bar: 'bar', foo: 'bar'})
 * console.log(obj) => {bar: 'bar', foo: 'bar'}
 *
 */
export function extend(src) {
  var obj, args = arguments
  for (var i = 1; i < args.length; ++i) {
    if (obj = args[i]) {
      for (var key in obj) {
        // check if this property of the source object could be overridden
        if (isWritable(src, key))
          src[key] = obj[key]
      }
    }
  }
  return src
}


text:
using System;
using System.Configuration;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Design;
using Microsoft.Web.Services3.Security;
using Microsoft.Web.Services3.Security.Tokens;

namespace WebsitePanel.Server
{
    public class ServerUsernameTokenManager : UsernameTokenManager
    {
        /// <summary>
        /// Constructs an instance of this security token manager.
        /// </summary>
        public ServerUsernameTokenManager()
        {
        }

        /// <summary>
        /// Constructs an instance of this security token manager.
        /// </summary>
        /// <param name="nodes">An XmlNodeList containing XML elements from a configuration file.</param>
        public ServerUsernameTokenManager(XmlNodeList nodes)
            : base(nodes)
        {
        }

        /// <summary>
        /// Returns the password or password equivalent for the username provided.
        /// </summary>
        /// <param name="token">The username token</param>
        /// <returns>The password (or password equivalent) for the username</returns>
        protected override string AuthenticateToken(UsernameToken token)
        {
            string password = ServerConfiguration.Security.Password;
            if (String.IsNullOrEmpty(password))
                throw new Exception("Empty password");
            return password;
        }
    }
}


text:
#import <UIKit/UIKit.h>

#import <MumbleKit/MKServerModel.h>

@interface LogViewController : UITableViewController {
	NSMutableArray *_logEntries;
	MKServerModel *_serverModel;
	NSDateFormatter *_dateFormatter;
}

- (id) initWithServerModel:(MKServerModel *)serverModel;
- (void) dealloc;

@end


text:
$(document).ready(function () {
    $(document).ajaxStart(function () {
        //console.log("add");
        $(".ajax-loader").fadeIn("slow")
        $(".ajax-loader-background").fadeIn("0")
        $(".ajax-loader-foreground").fadeIn("0")
    });
    $(document).ajaxStop(function () {
        //console.log("remove");
        $(".ajax-loader").fadeOut("slow")
        $(".ajax-loader-background").fadeOut("50")
        $(".ajax-loader-foreground").fadeOut("50")
    });
});


text:
package hw.hw5;

import javax.swing.*;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.BoxLayout;

public class BorderTest {
    public static void main(String[] args) {
        GUIFrame1 frame = new GUIFrame1();
        frame.pack();
    }
}

@SuppressWarnings("serial")
class GUIFrame1 extends JFrame {
    private GUIPanel1 panel;

    public GUIFrame1() {
        setTitle("GUI1 Demo");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setLocation(200, 200);
        panel = new GUIPanel1();
        setContentPane(panel);
        setVisible(true);
    }
}

@SuppressWarnings("serial")
class GUIPanel1 extends JPanel {

    public GUIPanel1() {
        Border red = (BorderFactory.createMatteBorder(5, 5, 5, 5, Color.red));
        Border green = (BorderFactory.createMatteBorder(5, 5, 5, 5, Color.green));
        Border blue = (BorderFactory.createMatteBorder(5, 5, 5, 5, Color.blue));

        Border redGreen = BorderFactory.createCompoundBorder(red, green);
        Border redGreenBlue = BorderFactory.createCompoundBorder(redGreen, blue);

        Border greenTitle = BorderFactory.createTitledBorder(green, "A Title");
        Border greenTitleRed = BorderFactory.createCompoundBorder(greenTitle, red);

        Border redGreenTitle = BorderFactory.createTitledBorder(redGreen, "A Title");

        JTextField txt1 = new JTextField("your message here 1", 40);
        txt1.setBorder(redGreen);

        JTextField txt2 = new JTextField("your message here 2", 40);
        txt2.setBorder(redGreenBlue);

        JTextField txt3 = new JTextField("your message here 3", 40);
        txt3.setBorder(greenTitleRed);

        JTextField txt4 = new JTextField("your message here 4", 40);
        txt4.setBorder(redGreenTitle);

        add(new JLabel("A"));
        add(txt1);
        add(new JLabel("B"));
        add(txt2);
        add(new JLabel("C"));
        add(txt3);
        add(new JLabel("D"));
        add(txt4);
        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    }

}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen 2.8.0" />

	<title>Namespace Collection\Habit</title>

	<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />

		Overview

Namespaces

Collection

Habit

Traits

ArrayTrait

AttributeTrait

MagicTrait

MapTrait

SplTrait

	<form id="search">
		<input type="hidden" name="cx" value="" />
		<input type="hidden" name="ie" value="UTF-8" />
		<input type="text" name="q" class="text" />
		<input type="submit" value="Search" />
	</form>

				Overview

Namespace

Class

				Tree

Namespace Collection\Habit

Traits summary

	ArrayTrait

	AttributeTrait

	MagicTrait

	MapTrait

	SplTrait

		 API documentation generated by ApiGen 2.8.0


text:
#pragma once

#include "net/ISocket.h"
#include "base/EventTypes.h"

class IDataSocket;

//! Listen socket interface
/*!
This interface defines the methods common to all network sockets that
listen for incoming connections.
*/
class IListenSocket : public ISocket {
public:
	//! @name manipulators
	//@{

	//! Accept connection
	/*!
	Accept a connection, returning a socket representing the full-duplex
	data stream.  Returns NULL if no socket is waiting to be accepted.
	This is only valid after a call to \c bind().
	*/
	virtual IDataSocket*
						accept() = 0;

	//! Delete connection socket
	/*!
	This is used when the socket was created but not adopted by a client
	proxy.
	*/
	virtual void		deleteSocket(void*) = 0;

	//@}

	// ISocket overrides
	virtual void		bind(const NetworkAddress&) = 0;
	virtual void		close() = 0;
	virtual void*		getEventTarget() const = 0;
};


text:
require 'octodown/renderer/renderable'
require 'octodown/support/persistent_tempfile'
require 'octodown/renderer/github_markdown'
require 'octodown/renderer/html'
require 'octodown/renderer/raw'
require 'octodown/renderer/server'
require 'octodown/support/relative_root_filter'
require 'octodown/support/services/document_presenter'
require 'octodown/support/services/riposter'
require 'octodown/version'

module Octodown
  def self.call(options)
    include Octodown::Support::Services

    DocumentPresenter.call options[:file], options
  end

  def self.root
    Gem::Specification.find_by_name('octodown').gem_dir
  end
end


text:
package com.intellij.ide.actions;

import com.intellij.ide.actions.searcheverywhere.SymbolSearchEverywhereContributor;
import com.intellij.navigation.ChooseByNameRegistry;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

public class GotoSymbolAction extends SearchEverywhereBaseAction implements DumbAware {

  @Override
  public void actionPerformed(@NotNull AnActionEvent e) {
    Project project = e.getProject();
    if (project == null) return;

    boolean dumb = DumbService.isDumb(project);
    if (!dumb || new SymbolSearchEverywhereContributor(e).isDumbAware()) {
      String tabID = SymbolSearchEverywhereContributor.class.getSimpleName();
      showInSearchEverywherePopup(tabID, e, true, true);
    }
    else {
      GotoClassAction.invokeGoToFile(project, e);
    }
  }

  @Override
  protected boolean hasContributors(@NotNull DataContext dataContext) {
    return ChooseByNameRegistry.getInstance().getSymbolModelContributors().size() > 0;
  }
}


text:
    <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"
            aria-haspopup="true" aria-expanded="true">
        {{title}}
    </button>

                <input ng-model="content" style=" width:200px" type="text" class="form-control input-sm"
                       placeholder="{{placeHolder}}"
                       ng-click="$event.stopPropagation()">

                <button class="btn btn-xs btn-primary" type="submit" ng-click="submit()"> 确认
                </button>
                <button class="btn btn-xs  btn-default"> 取消</button>


text:
#include "config.h"
#include "StyleCachedImageSet.h"

#if ENABLE(CSS_IMAGE_SET)

#include "CSSImageSetValue.h"
#include "CachedImage.h"
#include "RenderElement.h"

namespace WebCore {

StyleCachedImageSet::StyleCachedImageSet(CachedImage* image, float imageScaleFactor, CSSImageSetValue* value)
    : m_bestFitImage(image)
    , m_imageScaleFactor(imageScaleFactor)
    , m_imageSetValue(value)
{
    m_isCachedImageSet = true;
    m_bestFitImage->addClient(this);
}

StyleCachedImageSet::~StyleCachedImageSet()
{
    m_bestFitImage->removeClient(this);
}

PassRefPtr<CSSValue> StyleCachedImageSet::cssValue() const
{
    return m_imageSetValue;
}

bool StyleCachedImageSet::canRender(const RenderObject* renderer, float multiplier) const
{
    return m_bestFitImage->canRender(renderer, multiplier);
}

bool StyleCachedImageSet::isLoaded() const
{
    return m_bestFitImage->isLoaded();
}

bool StyleCachedImageSet::errorOccurred() const
{
    return m_bestFitImage->errorOccurred();
}

FloatSize StyleCachedImageSet::imageSize(const RenderElement* renderer, float multiplier) const
{
    FloatSize scaledImageSize = m_bestFitImage->imageSizeForRenderer(renderer, multiplier);
    scaledImageSize.scale(1 / m_imageScaleFactor);
    return scaledImageSize;
}

bool StyleCachedImageSet::imageHasRelativeWidth() const
{
    return m_bestFitImage->imageHasRelativeWidth();
}

bool StyleCachedImageSet::imageHasRelativeHeight() const
{
    return m_bestFitImage->imageHasRelativeHeight();
}

void StyleCachedImageSet::computeIntrinsicDimensions(const RenderElement*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
{
    m_bestFitImage->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
}

bool StyleCachedImageSet::usesImageContainerSize() const
{
    return m_bestFitImage->usesImageContainerSize();
}

void StyleCachedImageSet::setContainerSizeForRenderer(const RenderElement* renderer, const FloatSize& imageContainerSize, float imageContainerZoomFactor)
{
    m_bestFitImage->setContainerSizeForRenderer(renderer, LayoutSize(imageContainerSize), imageContainerZoomFactor);
}

void StyleCachedImageSet::addClient(RenderElement* renderer)
{
    m_bestFitImage->addClient(renderer);
}

void StyleCachedImageSet::removeClient(RenderElement* renderer)
{
    m_bestFitImage->removeClient(renderer);
}

PassRefPtr<Image> StyleCachedImageSet::image(RenderElement* renderer, const FloatSize&) const
{
    return m_bestFitImage->imageForRenderer(renderer);
}

bool StyleCachedImageSet::knownToBeOpaque(const RenderElement* renderer) const
{
    return m_bestFitImage->currentFrameKnownToBeOpaque(renderer);
}

} // namespace WebCore

#endif // ENABLE(CSS_IMAGE_SET)


text:
//
//  TableViewController.m
//  LionAndLamb
//
//  Created by Peter Jensen on 5/18/15.
//  Copyright (c) 2015 Peter Christian Jensen.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

#import "TableViewController.h"

@import Darwin.C.tgmath; // For fmax
#import "UIFont+CloudSettings.h" // For +lal_preferredContentSizeDelta

@interface TableViewController ()

@property (nonatomic, assign, readwrite) CGFloat preferredContentSizeDelta;

@end

@implementation TableViewController

@synthesize preferredContentSizeDelta = _preferredContentSizeDelta;

#pragma mark - Initialization

// Override to support custom initialization.
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self)
    {
        // Custom initialization
        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
        [notificationCenter addObserver:self
                               selector:@selector(contentSizeCategoryDidChange:)
                                   name:UIContentSizeCategoryDidChangeNotification
                                 object:nil];
    }
    return self;
}

- (void)dealloc
{
    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
    [notificationCenter removeObserver:self name:UIContentSizeCategoryDidChangeNotification object:nil];
}

#pragma mark - Getters and setters

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    self.tableView.rowHeight = [self p_determineRowHeightForPreferredFont];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - <UITableviewDataSource>

- (BOOL)tableView:(UITableView *)__unused tableView canEditRowAtIndexPath:(NSIndexPath *)__unused indexPath
{
    // Return NO if you do not want the specified item to be editable.
    return NO;
}

#pragma mark - <UITableViewDelegate>

#pragma mark - <UIStateRestoring>

- (void)encodeRestorableStateWithCoder:(NSCoder *)coder
{
    [super encodeRestorableStateWithCoder:coder];
}

- (void)decodeRestorableStateWithCoder:(NSCoder *)coder
{
    [super decodeRestorableStateWithCoder:coder];
}

#pragma mark - Notification handlers

/**
 Calculate a new estimated row height when the content size changes
 */
- (void)contentSizeCategoryDidChange:(NSNotification *)__unused notification
{
    self.tableView.rowHeight = [self p_determineRowHeightForPreferredFont];
    [self.tableView reloadData];
}

#pragma mark - Actions

#pragma mark - Private methods

- (CGFloat)p_determineRowHeightForPreferredFont
{
    // Cap delta to non-accessibility max size

    self.preferredContentSizeDelta = fmin(3.0, [UIFont lal_preferredContentSizeDelta]);

    return 44.0 + self.preferredContentSizeDelta;
}

@end


text:
typedef DirectX::XMFLOAT4 float4;
typedef DirectX::XMFLOAT3 float3;

// forward declarations
namespace AMD
{
    class ShaderCache;
}

namespace AMD
{

class TressFXSimulation
{
public:
    TressFXSimulation(void);
    ~TressFXSimulation(void);

    HRESULT OnCreateDevice(ID3D11Device* pd3dDevice, TressFX_CollisionCapsule *pCollision);
    HRESULT Simulate(ID3D11DeviceContext* pd3dContext, float fElapsedTime, float density,
                     tressfx_vec3 &windDir, float windMag, DirectX::XMMATRIX *pModelTransformForHead,
                     ID3D11UnorderedAccessView *pSkinningTransforms,
                     float targetFrameRate = 1.0f / 60.0f, bool singleHeadTransform = true, bool bAlwaysSimulate = false);
    HRESULT GenerateTransforms(ID3D11DeviceContext* pd3dContext, TressFX_SceneMesh sceneMesh,
                               ID3D11UnorderedAccessView** ppSkinningTransformationsUAV,
                               DirectX::XMMATRIX *pModelTransformForHead);
    HRESULT ApplyTransformGlobally(ID3D11DeviceContext* pd3dContext, ID3D11UnorderedAccessView* pSkinningTransforms,
                                   float density, bool singleHeadTransform, DirectX::XMMATRIX *pModelTransformForHead);
    void OnDestroy(bool destroyShaders);
    TressFXMesh*                m_pTressFXMesh;
    float                       m_elapsedTimeSinceLastSim;

private:
    bool                        m_bGuideFollowHairPrev;

    // hair simulation params
    TressFX_SimulationParams m_simParams;

    // Compute Shader
    //data for compute shaders
    ID3D11ComputeShader*        m_CSIntegrationAndGlobalShapeConstraints;
    ID3D11ComputeShader*        m_CSApplyHairTransformGlobally;
    ID3D11ComputeShader*        m_CSComputeTangents;
    ID3D11ComputeShader*        m_CSLocalShapeConstraints;
    ID3D11ComputeShader*        m_CSLocalShapeConstraintsSingleDispatch;
    ID3D11ComputeShader*        m_CSLengthConstraintsWindAndCollision;
    ID3D11ComputeShader*        m_CSUpdateFollowHairVertices;
    ID3D11ComputeShader*        m_CSPrepareFollowHairBeforeTurningIntoGuide;
    ID3D11ComputeShader*        m_CSGenerateTransforms;

    // const buffers for CS
    ID3D11Buffer*               m_pCBCSPerFrame;
    ID3D11Buffer*               m_pCBCSCollisionCapsule;
    ID3D11Buffer*               m_pCBGenerateTransforms;
    ID3D11Buffer*               m_pCBHeadTransforms;

    HRESULT CreateComputeShaderConstantBuffers(ID3D11Device* pd3dDevice, TressFX_CollisionCapsule *pCollision);

public:
    void SetSimulationParams(const TressFX_SimulationParams& simParams) { m_simParams = simParams; }
};

} // namespace AMD


text:
using NT.Core;
using NT.Infrastructure.EntityFrameworkCore;

namespace NT.CustomerService.Infrastructure
{
    public class GenericEfRepository<TEntity> : EfRepository<CustomerDbContext, TEntity>
        where TEntity : EntityBase
    {
        public GenericEfRepository(CustomerDbContext dbContext)
            : base(dbContext)
        {
        }
    }
}


text:
<TITLE>Review for Stir of Echoes (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Stir of Echoes (1999)

reviewed by
Michael Dequina

(out of ****)

_Stir_of_Echoes_ (R) ** 1/2

_Stigmata_ (R) ***

"If you liked _The_Sixth_Sense_, then you'll love _Stir_of_Echoes_."
I'm actually a bit surprised that Artisan Entertainment isn't going that
cornball route with their film's publicity, for David Koepp's adaptation
of the Richard Matheson novel shares a remarkable amount in common with
the surprise box office phenomenon of the summer.  Unfortunately, one of
those common traits is falling short of complete success.

For all their similarities, _Stir_of_Echoes_ is a completely different
animal from M. Night Shyamalan's film, especially in terms of style.
Koepp approaches his material in a much more conventional fashion than
Shyamalan, a fact that can best be summed up by a simple comparison.  In
_The_Sixth_Sense_, the now-famous "I see dead people" is spoken roughly
an hour into the film.  In _Stir_of_Echoes_, the psychically gifted
child, Jake Witzky (Zachary David Cope), asks "Does it hurt to be dead?"
to an invisible (but not to him) apparition at about the five-minute
mark.

This sixth sense also comes to be possessed by Jake's father Tom (Kevin
Bacon) after he is put under hypnosis by his sister-in-law Lisa (Illeana
Douglas).  What is meant as a harmless lark during a party turns natural
skeptic Tom into a true believer, for he soon has haunting visions of a
mysterious stranger lurking about his house--apparently the same
heretofore invisible one with whom his son has been regularly conversing.

The reasons for the ghostly stranger's visits recall similar points in
_The_Sixth_Sense_, and that's about where the similarities end.  There is
a more menacing edge here that was fairly absent in that film.  A point
that comes into play in _Stir_of_Echoes is how ghosts get angry when not
paid attention to, resulting in some effective scare scenes where Tom and
his family are actually threatened.  The darker shades are reinforced by
Koepp, who employs an effectively flashy visual style that lends an
eeriness to even the more sedate sequences, such as the clever staging of
Tom's hypnosis experience.

The absorbing style and urgent pace of _Stir_of_Echoes_ kept me
interested as it progressed, as opposed to the glacial crawl of
_The_Sixth_Sense_.  In the end, though, my reaction to _Echoes_ was the
inverse of mine to _Sense_: where the latter's much-talked-about ending
nearly redeemed the entire slow-going film for me, the dismayingly
conventional conclusion to _Echoes_ left me soured on the picture.  It's
a contrived standoff/hostage setup that belongs in much lesser film, and
needless to say it completely kills the otherworldly atmosphere that
Koepp had meticulously created.  Never have I seen reality come crashing
down in a film in a more literal--and disappointing--way.

For all its fantastic elements, Rupert Wainwright's supernatural
thriller _Stigmata_ will hold a grounding in reality for a lot of viewers
due to its religious themes.  Any film that deals with religious issues
inevitably comes under fire (witness the storm surrounding Kevin Smith's
forthcoming _Dogma_), and _Stigmata_, which touches upon a fictional
conspiracy within the Vatican, has already been denounced by the Catholic
League.  However, I think the film provides something
valuable--surprisingly serious and intelligent food for thought about
faith and supernatural phenomena.

While the film deals with serious themes, _Stigmata_ is foremost a
thriller, and Wainwright delivers the requisite shocks in telling the
story of Frankie Paige (Patricia Arquette), an unreligious young
Pittsburgh woman who becomes violently afflicted with the wounds of
Christ on the cross, or stigmata.  Wainwright--perhaps not an obvious
choice for a thriller, given that his last credit was for directing
_Blank_Check_, a Disney vehicle for former _Family_Ties_ moppet Brian
Bonsall--stages these bloody scenes in quick-cut MTV style (not
surprising, since he's also a veteran of music videos), and the usually
annoying effect of such a style works quite well in this context,
succeeding in jolting the audience.

Naturally, a priest enters the scene--Father Andrew Kiernan (Gabriel
Byrne), a onetime scientist who now serves as an investigator for the
Vatican.  In dealing with Frankie, Father Andrew must come to terms with
his own doubts about his faith.  Sounds very much like _The_Exorcist_,
and much of _Stigmata_, including some of the special effects scenes,
recall that classic.  Also like that film, _Stigmata_'s effects are
lavish without feeling particularly exploitative.  However derivative
some individual aspects are, the fresh ideas of Wainwright and writers
Tom Lazarus and Rick Ramage, along with the believable performances of
the cast, give _Stigmata_ its own identity.

Not all of the ideas work, however.  Wainwright's visual style careens
into overkill during the quieter scenes; there are one too many shots of
drops of blood falling into water, not to mention some unnecessarily
emblematic closeups of menial things, such as coffee being poured into a
cup.  He also overuses a device that repeats dialogue spoken in a scene
as a voiceover on the following scene.  The virtual absence of any police
hasn't stopped Lazarus and Ramage from indulging in the reliable cop
cliché where an officer is taken off the case by a superior (in this
instance, Father Andrew by Cardinal Daniel Houseman, played by Jonathan
Pryce).

Even so, _Stigmata_ leaves the audience with more to chew on afterward
that any of the other thrillers currently crowding theatres--including
_The_Sixth_Sense_.  While that film makes one think about things you've
seen during the course of its progression, _Stigmata_ makes one reflect
upon one's personal beliefs and values--and therein lies all the
difference.

Michael Dequina
twotrey@juno.com | michael_jordan@geocities.com |
jordan_host@sportsmail.com | mrbrown@iname.com
Mr. Brown's Movie Site:  http://welcome.to/mrbrown
CompuServe Hollywood Hotline:  http://www.HollywoodHotline.com
on ICQ: #25289934  |  on AOL Instant Messenger: MrBrown23

Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
namespace Halley
{
	class InboundNetworkPacket;
	class OutboundNetworkPacket;

	enum class ConnectionStatus
	{
		Undefined,
		Connecting,
		Connected,
		Closing,
		Closed
	};

	class IConnection
	{
	public:
		enum class TransmissionType {
			Unreliable,
			Reliable
		};

		virtual ~IConnection() {}

		virtual void close() = 0;
		virtual ConnectionStatus getStatus() const = 0;

		virtual bool isSupported(TransmissionType type) const = 0;

		virtual void send(TransmissionType type, OutboundNetworkPacket packet) = 0;
		virtual bool receive(InboundNetworkPacket& packet) = 0;
	};
}


text:
IMAGENAME := $(shell basename `git rev-parse --show-toplevel`)
SHA := $(shell git rev-parse --short HEAD)
#targz_file := $(shell cat FILEPATH)
timestamp := $(shell date +"%Y%m%d%H%M")
VERSION :=$(shell cat VERSION)
default: create push

create:
	IMAGENAME=$(NAMESPACE)/$(IMAGENAME) REL=$(VERSION) ./mkimage-alpine.sh

docker: loadS3_and_extract dockerbuild push

loadS3_and_extract:
	aws s3 cp s3://$(AWS_BUCKET)/$(targz_file) ./binary.tar.gz
	mkdir content/
	tar xzf binary.tar.gz -C content/
	ls -la content/

dockerbuild:
	docker rmi -f $(NAMESPACE)/$(IMAGENAME):bak || true
	docker tag $(NAMESPACE)/$(IMAGENAME) $(NAMESPACE)/$(IMAGENAME):bak || true
	docker rmi -f $(NAMESPACE)/$(IMAGENAME) || true
	docker build -t $(NAMESPACE)/$(IMAGENAME) .

testimg:
	docker rm -f new-$(IMAGENAME) || true
	docker run -d --name new-$(IMAGENAME) $(NAMESPACE)/$(IMAGENAME):latest
	docker inspect -f '{{.NetworkSettings.IPAddress}}' new-$(IMAGENAME)
	docker logs -f new-$(IMAGENAME)

push:
	# push VERSION
	docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(VERSION)
	docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(VERSION)
	docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(VERSION) || true
	# push commit SHA
	docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(SHA)
	docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(SHA)
	docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(SHA) || true
	# push timestamp
	docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(timestamp)
	docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(timestamp)
	docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):$(timestamp) || true
	# push latest
	docker tag -f $(NAMESPACE)/$(IMAGENAME):latest $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):latest
	docker push $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):latest
	docker rmi $(REGISTRY_URL)/$(NAMESPACE)/$(IMAGENAME):latest || true


text:
title: Overflow
localeTitle: перелив
---
# перелив

Свойство `overflow` указывает, что произойдет, если содержимое переполняет поле элемента (это свойство работает только для элементов блока с указанной высотой).

Это свойство указывает, следует ли клип-контент или добавлять полосы прокрутки, когда содержимое элемента слишком велико, чтобы вписаться в указанную область.

Например, заданный элемент уровня блока ( `<div>` ), установленный на ширину 300 пикселей, содержит изображение шириной 400 пикселей. Изображение будет выходить из div и быть видимым по умолчанию. Однако, если значение переполнения установлено в скрытое, изображение будет отключено на 300 пикселей.

## Значения

*   `visible` : Это значение по умолчанию для свойства. Содержимое не обрезается, если оно больше, чем поле.
*   `hidden` : переполненное содержимое будет скрыто.
*   `scroll` : похоже на скрытый, но пользователи смогут прокручивать скрытый контент.
*   `auto` : Если содержимое выходит за пределы его поля, то это содержимое будет скрыто, в то время как полоса прокрутки должна быть видимой для пользователей, чтобы прочитать остальную часть содержимого.
*   `initial` : Использует значение по умолчанию, которое видно.
*   `inherit` : Устанавливает переполнение для значения его родительского элемента.

## Примеры

### Видимых:

```css
.box-element { overflow: visible; }
```

![Пример изображения](https://s26.postimg.org/gweu6g5yh/1-vissible.png)

### Скрытые:

```css
.box-element { overflow: hidden; }
```

![Пример изображения](https://s26.postimg.org/l49mf77e1/2-hidden.png)

### Прокрутка:

```css
.box-element { overflow: scroll; }
```

![Пример изображения](https://s26.postimg.org/d8z30dxrd/3-scroll.png)

### Авто:

```css
.box-element { overflow: auto; }
```

![Пример изображения](https://s26.postimg.org/z5q7ei0bt/4-autoank.png)

## переполнение-x и переполнение-y

*   `overflow-x` : позволяет пользователю прокручивать содержимое, которое выходит за пределы высоты элемента box.
*   `overflow-y` : позволяет пользователю прокручивать содержимое, выходящее за пределы ширины окна.

```css
  .box-element {
    overflow-x: scroll;
    overflow-y: auto;
  }
```

`.box-element` будет выглядеть так: ![Пример изображения](https://s26.postimg.org/ff2kmdfzd/5-_Xand_Y.png)

Если содержимое переполняет ось Y, то это содержимое будет скрыто, в то время как полоса прокрутки должна быть видимой для пользователей, чтобы прочитать остальную часть содержимого.

#### Дополнительная информация:

CSS-трюки: [переполнение](https://css-tricks.com/almanac/properties/o/overflow/)


text:
class ClassDesignation < ActiveRecord::Base

  HUMANIZED_COLUMNS = {:cgpa => "CGPA"}

  validates_presence_of :name
  validates_numericality_of :cgpa, if: :has_gpa
  validates_numericality_of :marks, if: :has_cwa

  belongs_to :course

  def has_gpa
    self.course.gpa_enabled?
  end

  def has_cwa
    self.course.cwa_enabled? or self.course.normal_enabled?
  end

#   def self.human_attribute_name(attribute)
#     HUMANIZED_COLUMNS[attribute.to_sym] || super
#   end
end


text:
using System;
using System.Globalization;

namespace LinqToTwitter.Json
{
    public static class StringExtensions
    {
        public static bool GetBool(this string val)
        {
            return GetBool(val, false);
        }

        public static bool GetBool(this string val, bool defaultValue /* = false*/)
        {
            bool result;

            return String.IsNullOrWhiteSpace(val) ||
                !bool.TryParse(val, out result)
                    ? defaultValue
                    : result;
        }

        public static int GetInt(this string val)
        {
            return GetInt(val, 0);
        }

        public static int GetInt(this string val, int defaultValue /* = 0*/)
        {
            int result;
            return String.IsNullOrWhiteSpace(val) ||
                !int.TryParse(val, out result)
                    ? defaultValue
                    : result;
        }

        public static long GetLong(this string val)
        {
            return GetLong(val, 0L);
        }

        public static long GetLong(this string val, long defaultValue /* = 0*/)
        {
            long result;

            return String.IsNullOrWhiteSpace(val) ||
                !long.TryParse(val, out result)
                    ? defaultValue
                    : result;
        }

        public static ulong GetULong(this string val)
        {
            return GetULong(val, 0ul);
        }

        public static ulong GetULong(this string val, ulong defaultValue /* = 0*/)
        {
            ulong result;

            return String.IsNullOrWhiteSpace(val) ||
                !ulong.TryParse(val, out result)
                    ? defaultValue
                    : result;
        }

        public static double GetDouble(this string val)
        {
            return GetDouble(val, 0d);
        }

        public static double GetDouble(this string val, double defaultValue /* = 0*/)
        {
            double result;

            return String.IsNullOrWhiteSpace(val) ||
                !double.TryParse(val, NumberStyles.Any, CultureInfo.InvariantCulture, out result)
                    ? defaultValue
                    : result;
        }

        public static DateTime GetDate(this string date)
        {
            return GetDate(date, DateTime.MinValue);
        }

        public static readonly string[] DateFormats = { "ddd MMM dd HH:mm:ss %zzzz yyyy",
                                                         "yyyy-MM-dd\\THH:mm:ss\\Z",
                                                         "yyyy-MM-dd HH:mm:ss",
                                                         "yyyy-MM-dd HH:mm"};

        public static DateTime GetDate(this string date, DateTime defaultValue)
        {
            DateTime result;

            return String.IsNullOrWhiteSpace(date) ||
                !DateTime.TryParseExact(date,
                        DateFormats,
                        CultureInfo.InvariantCulture,
                        DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal, out result)
                    ? defaultValue
                    : result;
        }

        public static readonly DateTime EpochBase = new DateTime(1970, 1, 1, 0, 0, 0, 0);

        public static DateTime GetEpochDate(this string date, DateTime defaultValue)
        {
            var epochSeconds = date.GetULong(ulong.MaxValue);

            if (epochSeconds == ulong.MaxValue)
                return defaultValue;

            return EpochBase + TimeSpan.FromSeconds(epochSeconds);
        }
    }
}


text:
import zipfile
import os

def write_nodes_recursive(archive, nodes, parent_path=''):
    for node in nodes:
        arcname = os.path.join(parent_path, node.name)
        if node.is_file():
            archive.write(node.file.path, arcname)
        elif node.is_folder():
            write_nodes_recursive(archive, node.get_children(), arcname)

def compress_nodes(file, nodes):
    archive = zipfile.ZipFile(file, "w", zipfile.ZIP_DEFLATED)
    write_nodes_recursive(archive, nodes)
    archive.close()
    return archive


text:
package apps

import (
	"crypto"
	"crypto/rand"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/pem"
	"fmt"
	"math/big"
	"net"
	"time"

	"github.com/golang/glog"
	"github.com/infrmods/xbus/utils"
)

// SerialGenerator serial generator
type SerialGenerator interface {
	Generate() (*big.Int, error)
}

// CertsConfig certs config
type CertsConfig struct {
	RootCert string `default:"rootcert.pem"`
	RootKey  string `default:"rootkey.pem"`
}

// CertsCtrl certs ctrl
type CertsCtrl struct {
	rootCert        *x509.Certificate
	rootKey         crypto.Signer
	config          *CertsConfig
	serialGenerator SerialGenerator
}

// NewCertsCtrl new certs ctrl
func NewCertsCtrl(config *CertsConfig, serialGenerator SerialGenerator) (*CertsCtrl, error) {
	certBlock, err := utils.ReadPEM(config.RootCert)
	if err != nil {
		return nil, err
	}
	cert, err := x509.ParseCertificate(certBlock.Bytes)
	if err != nil {
		return nil, fmt.Errorf("parse root cert fail: %v", err)
	}

	keyBlock, err := utils.ReadPEM(config.RootKey)
	if err != nil {
		return nil, err
	}

	var signer crypto.Signer
	switch keyBlock.Type {
	case "RSA PRIVATE KEY":
		if privKey, err := x509.ParsePKCS1PrivateKey(keyBlock.Bytes); err == nil {
			signer = privKey
		} else {
			return nil, fmt.Errorf("parse root key(rsa) fail: %v", err)
		}
	case "EC PRIVATE KEY":
		if privKey, err := x509.ParseECPrivateKey(keyBlock.Bytes); err == nil {
			signer = privKey
		} else {
			return nil, fmt.Errorf("parse root key(ec) fail: %v", err)
		}
	case "PRIVATE KEY":
		if privKey, err := x509.ParsePKCS8PrivateKey(keyBlock.Bytes); err == nil {
			signer = privKey.(crypto.Signer)
		} else {
			return nil, fmt.Errorf("parse root key(pkcs8) fail: %v", err)
		}
	default:
		return nil, fmt.Errorf("unsupported key type: %s", keyBlock.Type)
	}

	mgr := &CertsCtrl{rootCert: cert, rootKey: signer,
		config: config, serialGenerator: serialGenerator}
	return mgr, nil
}

// CertPool cert poll
func (mgr *CertsCtrl) CertPool() *x509.CertPool {
	pool := x509.NewCertPool()
	pool.AddCert(mgr.rootCert)
	return pool
}

// NewCert new cert
func (mgr *CertsCtrl) NewCert(pubkey crypto.PublicKey, subject pkix.Name,
	dnsNames []string, ips []net.IP, days int) ([]byte, error) {
	serialNumber, err := mgr.serialGenerator.Generate()
	if err != nil {
		return nil, err
	}

	template := x509.Certificate{
		SerialNumber: serialNumber,
		Subject:      subject,
		DNSNames:     dnsNames,
		IPAddresses:  ips,

		NotBefore: time.Now(),
		NotAfter:  time.Now().Add(time.Duration(days) * time.Hour * 24),
		KeyUsage:  x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment,
		ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth,
			x509.ExtKeyUsageServerAuth},
	}

	data, err := x509.CreateCertificate(rand.Reader, &template, mgr.rootCert,
		pubkey, mgr.rootKey)
	if err != nil {
		glog.Errorf("create cert fail: %v", err)
		return nil, utils.NewSystemError("create cert fail")
	}
	return pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: data}), nil
}


text:
using System.Collections;
using System.Collections.Generic;
using Azure.Core;

namespace Azure.Analytics.Synapse.Artifacts.Models
{
    /// <summary> Catalog information for managed dedicated integration runtime. </summary>
    public partial class IntegrationRuntimeSsisCatalogInfo : IDictionary<string, object>
    {
        /// <summary> Initializes a new instance of IntegrationRuntimeSsisCatalogInfo. </summary>
        public IntegrationRuntimeSsisCatalogInfo()
        {
            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
        }

        /// <summary> Initializes a new instance of IntegrationRuntimeSsisCatalogInfo. </summary>
        /// <param name="catalogServerEndpoint"> The catalog database server URL. </param>
        /// <param name="catalogAdminUserName"> The administrator user name of catalog database. </param>
        /// <param name="catalogAdminPassword"> The password of the administrator user account of the catalog database. </param>
        /// <param name="catalogPricingTier"> The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/. </param>
        /// <param name="additionalProperties"> . </param>
        internal IntegrationRuntimeSsisCatalogInfo(string catalogServerEndpoint, string catalogAdminUserName, SecureString catalogAdminPassword, IntegrationRuntimeSsisCatalogPricingTier? catalogPricingTier, IDictionary<string, object> additionalProperties)
        {
            CatalogServerEndpoint = catalogServerEndpoint;
            CatalogAdminUserName = catalogAdminUserName;
            CatalogAdminPassword = catalogAdminPassword;
            CatalogPricingTier = catalogPricingTier;
            AdditionalProperties = additionalProperties;
        }

        /// <summary> The catalog database server URL. </summary>
        public string CatalogServerEndpoint { get; set; }
        /// <summary> The administrator user name of catalog database. </summary>
        public string CatalogAdminUserName { get; set; }
        /// <summary> The password of the administrator user account of the catalog database. </summary>
        public SecureString CatalogAdminPassword { get; set; }
        /// <summary> The pricing tier for the catalog database. The valid values could be found in https://azure.microsoft.com/en-us/pricing/details/sql-database/. </summary>
        public IntegrationRuntimeSsisCatalogPricingTier? CatalogPricingTier { get; set; }
        internal IDictionary<string, object> AdditionalProperties { get; }
        /// <inheritdoc />
        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
        /// <inheritdoc />
        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
        /// <inheritdoc />
        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
        /// <inheritdoc />
        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
        /// <inheritdoc />
        public ICollection<string> Keys => AdditionalProperties.Keys;
        /// <inheritdoc />
        public ICollection<object> Values => AdditionalProperties.Values;
        /// <inheritdoc cref="ICollection{T}.Count"/>
        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
        /// <inheritdoc />
        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
        /// <inheritdoc />
        public bool Remove(string key) => AdditionalProperties.Remove(key);
        /// <inheritdoc cref="ICollection{T}.IsReadOnly"/>
        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
        /// <inheritdoc cref="ICollection{T}.Add"/>
        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.Add(value);
        /// <inheritdoc cref="ICollection{T}.Remove"/>
        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalProperties.Remove(value);
        /// <inheritdoc cref="ICollection{T}.Contains"/>
        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalProperties.Contains(value);
        /// <inheritdoc cref="ICollection{T}.CopyTo"/>
        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) => AdditionalProperties.CopyTo(destination, offset);
        /// <inheritdoc cref="ICollection{T}.Clear"/>
        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
        /// <inheritdoc />
        public object this[string key]
        {
            get => AdditionalProperties[key];
            set => AdditionalProperties[key] = value;
        }
    }
}


text:
Examples
========

This page collect useful examples on how to to some things with ``pyasdf``.

* :doc:`examples/create_observed_asdf_file`
* :doc:`examples/process_observed`
* :doc:`examples/parallel_pyflex`

.. toctree::
    :maxdepth: 1
    :hidden:

    examples/create_observed_asdf_file
    examples/process_observed
    examples/parallel_pyflex
    examples/source_receiver_geometry


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Webboard extends Admin_Controller {

	function __construct()
	{
		parent::__construct();
    $this->load->model('Webboard_model','webboard');
		$this->table->set_template(array('table_open'=>'
'));
	}

	function index()
	{
		$post = $this->input->post('type');
		if ($post)
		{
			switch ($post)
			{
				case 'topic':
				$this->webboard->save_topic($this->input->post());
					break;
				case 'category':
				$this->webboard->save_category($this->input->post());
					break;
			}
		}
		$types = $this->input->get('type');
		if ( ! $types)
		{
			redirect('admin/webboard?type=category');
		}
		$webboard_form = $this->input->get('form');
		$category_id = $this->input->get('category_id');
		switch ($types)
		{
			case 'game':
			$this->game();
				break;
			case 'topic':
			$this->topic();
				break;
			case 'category':
			$this->category($category_id);
				break;
		}
	}

	function game()
	{
		$games = $this->db
      ->get('predict')
      ->result_array();
    foreach ($games as $_g=>$g)
    {
      $this->table->add_row(++$_g,anchor('admin/webboard?type=game',$g['id']));
    }
    $this->table->set_heading('ที่','');
    $this->table->set_template(array('table_open'=>'
'));
    $data['games'] = $this->table->generate();
		$this->load->view('admin/webboard_game',$data);
	}

	function topic()
	{
		$latest = $this->db
			->select('wt.*,wc.name,us.fullname')
			->join('user as us','us.id = wt.user_id')
			->join('webboard_category as wc','wc.id = wt.category_id')
			->where('wt.status','')
			->order_by('wt.status DESC')
			->get('webboard_topic as wt')
			->result_array();
		$data['latest'] = $latest;
		$topics = $this->db
			->select('wt.*,wc.name,us.fullname')
			->join('user as us','us.id = wt.user_id')
			->join('webboard_category as wc','wc.id = wt.category_id')
			->where('wt.status >','0')
			->order_by('wt.status DESC','wt.id DESC')
			->get('webboard_topic as wt')
			->result_array();
		$data['topics'] = $topics;
		$this->load->view('admin/webboard_topic',$data);
	}

	function category($category_id='')
	{
		$category = $this->db->order_by('sort','ASC')->get('webboard_category')->result_array();
		foreach ($category as $_c => $c)
		{
			$this->table->add_row(
				++$_c,anchor('admin/webboard?type=category&category_id='.$c['id'],$c['name']),$c['count'],
				($c['sort']>'1')?anchor('admin/webboard/sort_category/'.$c['id'],'เลื่อนขึ้น'):'',
				($c['count'])?'':anchor('admin/webboard/delete_category/'.$c['id'],'ลบประเภท',array('onclick'=>"return confirm('ยืนยันการลบข้อมูล ?');"))
			);
		}
		$this->table->set_heading(array('ที่','ชื่อประเภท','จำนวนรายการ','',''));
		$data['category'] = $this->db->where('id',$category_id)->get('webboard_category')->row_array();
		$data['categories'] = $this->table->generate();
		$this->load->view('admin/webboard_category',$data);
	}

	function sort_category($id)
	{
		if ( ! (int)$id)
		{
			return FALSE;
		}
		$sort_up = $this->db->select('id,sort')->where('id',$id)->get('webboard_category',1)->row_array();
		$sort_down = $this->db->select('id,sort')->where('sort <',$sort_up['sort'])->order_by('sort','DESC')->get('webboard_category',1)->row_array();
		$this->db->trans_start();
			$this->db->set(array('sort'=>$sort_down['sort']))->where('id',$sort_up['id'])->update('webboard_category');
			$this->db->set(array('sort'=>$sort_up['sort']))->where('id',$sort_down['id'])->update('webboard_category');
		$this->db->trans_complete();
		if ($this->db->trans_status === TRUE)
		{
			$this->session->set_flashdata('success','การเรียงลำดับเสร็จสิ้น');
		}
		redirect('admin/webboard?type=category');
	}

	function pin_topic($id,$status)
	{
		if ((int)$id > 0)
		{
			if ($this->webboard->pin_topic($id) === TRUE)
			{
				$this->session->set_flashdata('info',lang('message_form_success'));
			}
		}
    redirect('admin/webboard?type=topic');
	}

	function delete_category($id)
	{
		if ( ! (int)$id)
		{
			return FALSE;
		}
		if ($this->db->where('id',$id)->delete('webboard_category'))
		{
			$this->session->set_flashdata('info',lang('message_form_success'));
		}
    redirect('admin/webboard?type=category');
	}

  function save_terms()
  {
    if ($this->webboard->save_terms())
    {
      redirect('admin/webboard?type=game');
      return TRUE;
    }
    return FALSE;
  }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

// Copied from https://github.com/aspnet/AspNetCore/tree/master/src/Http/WebUtilities/src

using System;
using System.Buffers;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

#pragma warning disable CA1820  // Use IsNullOrEmpty
#pragma warning disable IDE0008 // Use explicit type
#pragma warning disable IDE0016 // Simplify null check
#pragma warning disable IDE0018 // Inline declaration
#pragma warning disable IDE0054 // Use compound assignment
#pragma warning disable IDE0059 // Unnecessary assignment

namespace Azure.Core.Http.Multipart
{
    internal sealed class MultipartReaderStream : Stream
    {
        private readonly MultipartBoundary _boundary;
        private readonly BufferedReadStream _innerStream;
        private readonly ArrayPool<byte> _bytePool;

        private readonly long _innerOffset;
        private long _position;
        private long _observedLength;
        private bool _finished;

        /// <summary>
        /// Creates a stream that reads until it reaches the given boundary pattern.
        /// </summary>
        /// <param name="stream">The <see cref="BufferedReadStream"/>.</param>
        /// <param name="boundary">The boundary pattern to use.</param>
        public MultipartReaderStream(BufferedReadStream stream, MultipartBoundary boundary)
            : this(stream, boundary, ArrayPool<byte>.Shared)
        {
        }

        /// <summary>
        /// Creates a stream that reads until it reaches the given boundary pattern.
        /// </summary>
        /// <param name="stream">The <see cref="BufferedReadStream"/>.</param>
        /// <param name="boundary">The boundary pattern to use.</param>
        /// <param name="bytePool">The ArrayPool pool to use for temporary byte arrays.</param>
        public MultipartReaderStream(BufferedReadStream stream, MultipartBoundary boundary, ArrayPool<byte> bytePool)
        {
            if (stream == null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            if (boundary == null)
            {
                throw new ArgumentNullException(nameof(boundary));
            }

            _bytePool = bytePool;
            _innerStream = stream;
            _innerOffset = _innerStream.CanSeek ? _innerStream.Position : 0;
            _boundary = boundary;
        }

        public bool FinalBoundaryFound { get; private set; }

        public long? LengthLimit { get; set; }

        public override bool CanRead
        {
            get { return true; }
        }

        public override bool CanSeek
        {
            get { return _innerStream.CanSeek; }
        }

        public override bool CanWrite
        {
            get { return false; }
        }

        public override long Length
        {
            get { return _observedLength; }
        }

        public override long Position
        {
            get { return _position; }
            set
            {
                if (value < 0)
                {
                    throw new ArgumentOutOfRangeException(nameof(value), value, "The Position must be positive.");
                }
                if (value > _observedLength)
                {
                    throw new ArgumentOutOfRangeException(nameof(value), value, "The Position must be less than length.");
                }
                _position = value;
                if (_position < _observedLength)
                {
                    _finished = false;
                }
            }
        }

        public override long Seek(long offset, SeekOrigin origin)
        {
            if (origin == SeekOrigin.Begin)
            {
                Position = offset;
            }
            else if (origin == SeekOrigin.Current)
            {
                Position = Position + offset;
            }
            else // if (origin == SeekOrigin.End)
            {
                Position = Length + offset;
            }
            return Position;
        }

        public override void SetLength(long value)
        {
            throw new NotSupportedException();
        }

        public override void Write(byte[] buffer, int offset, int count)
        {
            throw new NotSupportedException();
        }

        public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
        {
            throw new NotSupportedException();
        }

        public override void Flush()
        {
            // Flush is allowed on read-only stream
        }

        private void PositionInnerStream()
        {
            if (_innerStream.CanSeek && _innerStream.Position != (_innerOffset + _position))
            {
                _innerStream.Position = _innerOffset + _position;
            }
        }

        private int UpdatePosition(int read)
        {
            _position += read;
            if (_observedLength < _position)
            {
                _observedLength = _position;
                if (LengthLimit.HasValue && _observedLength > LengthLimit.GetValueOrDefault())
                {
                    throw new InvalidDataException($"Multipart body length limit {LengthLimit.GetValueOrDefault()} exceeded.");
                }
            }
            return read;
        }

        public override int Read(byte[] buffer, int offset, int count)
        {
            if (_finished)
            {
                return 0;
            }

            PositionInnerStream();
            if (!_innerStream.EnsureBuffered(_boundary.FinalBoundaryLength))
            {
                throw new IOException("Unexpected end of Stream, the content may have already been read by another component. ");
            }
            var bufferedData = _innerStream.BufferedData;

            // scan for a boundary match, full or partial.
            int read;
            if (SubMatch(bufferedData, _boundary.BoundaryBytes, out var matchOffset, out var matchCount))
            {
                // We found a possible match, return any data before it.
                if (matchOffset > bufferedData.Offset)
                {
                    read = _innerStream.Read(buffer, offset, Math.Min(count, matchOffset - bufferedData.Offset));
                    return UpdatePosition(read);
                }

                var length = _boundary.BoundaryBytes.Length;
                Debug.Assert(matchCount == length);

                // "The boundary may be followed by zero or more characters of
                // linear whitespace. It is then terminated by either another CRLF"
                // or -- for the final boundary.
                var boundary = _bytePool.Rent(length);
                read = _innerStream.Read(boundary, 0, length);
                _bytePool.Return(boundary);
                Debug.Assert(read == length); // It should have all been buffered

                var remainder = _innerStream.ReadLine(lengthLimit: 100); // Whitespace may exceed the buffer.
                remainder = remainder.Trim();
                if (string.Equals("--", remainder, StringComparison.Ordinal))
                {
                    FinalBoundaryFound = true;
                }
                Debug.Assert(FinalBoundaryFound || string.Equals(string.Empty, remainder, StringComparison.Ordinal), "Un-expected data found on the boundary line: " + remainder);
                _finished = true;
                return 0;
            }

            // No possible boundary match within the buffered data, return the data from the buffer.
            read = _innerStream.Read(buffer, offset, Math.Min(count, bufferedData.Count));
            return UpdatePosition(read);
        }

        public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
        {
            if (_finished)
            {
                return 0;
            }

            PositionInnerStream();
            if (!await _innerStream.EnsureBufferedAsync(_boundary.FinalBoundaryLength, cancellationToken).ConfigureAwait(false))
            {
                throw new IOException("Unexpected end of Stream, the content may have already been read by another component. ");
            }
            var bufferedData = _innerStream.BufferedData;

            // scan for a boundary match, full or partial.
            int matchOffset;
            int matchCount;
            int read;
            if (SubMatch(bufferedData, _boundary.BoundaryBytes, out matchOffset, out matchCount))
            {
                // We found a possible match, return any data before it.
                if (matchOffset > bufferedData.Offset)
                {
                    // Sync, it's already buffered
                    read = _innerStream.Read(buffer, offset, Math.Min(count, matchOffset - bufferedData.Offset));
                    return UpdatePosition(read);
                }

                var length = _boundary.BoundaryBytes.Length;
                Debug.Assert(matchCount == length);

                // "The boundary may be followed by zero or more characters of
                // linear whitespace. It is then terminated by either another CRLF"
                // or -- for the final boundary.
                var boundary = _bytePool.Rent(length);
                read = _innerStream.Read(boundary, 0, length);
                _bytePool.Return(boundary);
                Debug.Assert(read == length); // It should have all been buffered

                var remainder = await _innerStream.ReadLineAsync(lengthLimit: 100, cancellationToken: cancellationToken).ConfigureAwait(false); // Whitespace may exceed the buffer.
                remainder = remainder.Trim();
                if (string.Equals("--", remainder, StringComparison.Ordinal))
                {
                    FinalBoundaryFound = true;
                }
                Debug.Assert(FinalBoundaryFound || string.Equals(string.Empty, remainder, StringComparison.Ordinal), "Un-expected data found on the boundary line: " + remainder);

                _finished = true;
                return 0;
            }

            // No possible boundary match within the buffered data, return the data from the buffer.
            read = _innerStream.Read(buffer, offset, Math.Min(count, bufferedData.Count));
            return UpdatePosition(read);
        }

        // Does segment1 contain all of matchBytes, or does it end with the start of matchBytes?
        // 1: AAAAABBBBBCCCCC
        // 2:      BBBBB
        // Or:
        // 1: AAAAABBB
        // 2:      BBBBB
        private bool SubMatch(ArraySegment<byte> segment1, byte[] matchBytes, out int matchOffset, out int matchCount)
        {
            // clear matchCount to zero
            matchCount = 0;

            // case 1: does segment1 fully contain matchBytes?
            {
                var matchBytesLengthMinusOne = matchBytes.Length - 1;
                var matchBytesLastByte = matchBytes[matchBytesLengthMinusOne];
                var segmentEndMinusMatchBytesLength = segment1.Offset + segment1.Count - matchBytes.Length;

                matchOffset = segment1.Offset;
                while (matchOffset < segmentEndMinusMatchBytesLength)
                {
                    var lookaheadTailChar = segment1.Array[matchOffset + matchBytesLengthMinusOne];
                    if (lookaheadTailChar == matchBytesLastByte &&
                        CompareBuffers(segment1.Array, matchOffset, matchBytes, 0, matchBytesLengthMinusOne) == 0)
                    {
                        matchCount = matchBytes.Length;
                        return true;
                    }
                    matchOffset += _boundary.GetSkipValue(lookaheadTailChar);
                }
            }

            // case 2: does segment1 end with the start of matchBytes?
            var segmentEnd = segment1.Offset + segment1.Count;

            matchCount = 0;
            for (; matchOffset < segmentEnd; matchOffset++)
            {
                var countLimit = segmentEnd - matchOffset;
                for (matchCount = 0; matchCount < matchBytes.Length && matchCount < countLimit; matchCount++)
                {
                    if (matchBytes[matchCount] != segment1.Array[matchOffset + matchCount])
                    {
                        matchCount = 0;
                        break;
                    }
                }
                if (matchCount > 0)
                {
                    break;
                }
            }
            return matchCount > 0;
        }

        private static int CompareBuffers(byte[] buffer1, int offset1, byte[] buffer2, int offset2, int count)
        {
            for (; count-- > 0; offset1++, offset2++)
            {
                if (buffer1[offset1] != buffer2[offset2])
                {
                    return buffer1[offset1] - buffer2[offset2];
                }
            }
            return 0;
        }
    }
}


text:
namespace Store {
  namespace Enumerations {

    /// <summary>
    /// Sort direction for a search or list operation.
    /// </summary>
    public enum SortDirection {
      Asc,
      Desc
    }
  }
}


text:
import java.util.stream.*;

class Test {
  void test() {
    LongStream.range(0, 100).map(x -> x*2).forEach(s -> System.out.println(s));
  }
}


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

    function DashboardController () {
        this.title = "Dashboard";
    };

    angular.module("simpleApp")
        .controller("DashboardController", DashboardController);
})();


text:
class CreateMessages < ActiveRecord::Migration
  def change
    create_table :messages do |t|
      t.references :user
      t.references :stock

      t.timestamps null: false
    end
  end
end


text:
package info.debatty.java.datasets.sift;

import java.util.Iterator;

//import java.util.Iterator;
/**
 * This class implements a 1D map for arbitrary objects with flexible bottom and
 * top index, similar to an array in Pascal. Containers are immutable.
 */
class LinearContainer<T> implements Iterable<T> {

    private final int botIndex, topIndex;
    private final T[] data;

    /**
     * Creates a LinearContainer with the index range [0, n - 1], like an
     * ordinary array.
     *
     * @param n size of the container.
     */
    public LinearContainer(int n) {
        this(0, n - 1);
    }

    /**
     * Creates a LinearContainer with the index range [botIndex, topIndex].
     *
     * @param botIndex bottom (smallest) index.
     * @param topIndex top (largest) index.
     */
    @SuppressWarnings("unchecked")
    public LinearContainer(int botIndex, int topIndex) {
        if (botIndex > topIndex) {
            throw new IllegalArgumentException("LinearContainer: botIndex > topIndex");
        }
        this.botIndex = botIndex;
        this.topIndex = topIndex;
        int n = topIndex - botIndex + 1;
        data = (T[]) new Object[n];
    }

    public T getElement(int k) {
        return data[k - botIndex];
    }

    public void setElement(int k, T elem) {
        // TODO: check for out-of-bounds index k
        data[k - botIndex] = elem;
    }

    public int getBotIndex() {
        return botIndex;
    }

    public int getTopIndex() {
        return topIndex;
    }

    public Iterator<T> iterator() {
        return new ArrayIterator<T>(data);
    }

}


text:
  Für Projekte, die Ant als Build-System verwenden. Dies veranlasst Hudson,
  Ant mit den angegebenen Zielen (targets) und Optionen aufzurufen. Ein Ergebniscode
  ungleich 0 bewirkt, dass Hudson den Build als Fehlschlag markiert.

  Hudson stellt einige
  Umgebungsvariablen bereit, die innerhalb des Build-Skriptes verwendet
  verwendet werden können.


text:
<?php

/**
 * @file
 * Contains \Drupal\update_test\Controller\UpdateTestController.
 */

namespace Drupal\update_test\Controller;
use Symfony\Component\HttpFoundation\Response;

/**
 * Provides different routes of the update_test module.
 */
class UpdateTestController {

  /**
   * Displays an Error 503 (Service unavailable) page.
   *
   * @return \Symfony\Component\HttpFoundation\Response
   *   Returns the response with a special header.
   */
  public function updateError() {
    $response = new Response();
    $response->setStatusCode(503);
    $response->headers->set('Status', '503 Service unavailable');

    return $response;
  }

}


text:
commandHere="$0"
binPath=`dirname $commandHere`
cd $binPath; cd ..
. ./bin/settings.sh

echo '==== stopping comped (in  maintenance)'
cd "$COMPED_HOME"
curl --silent "http://`cat bin/tomcatManagerUserPassword`@${ROOT_HOST}/manager/stop?path=/comped"

echo '==== replacing "in maintenance" by comped'
cd "$TOMCAT_HOME"
mv webapps/comped parking/comped-inmaintenance
mv parking/comped webapps/comped

echo ' ==== activating comped '
cd "$COMPED_HOME"

curl --silent "http://`cat bin/tomcatManagerUserPassword`@${ROOT_HOST}/manager/start?path=/ontoUpdate"
curl --silent "http://`cat bin/tomcatManagerUserPassword`@${ROOT_HOST}/manager/start?path=/comped"


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

package natlab.utils;

import java.util.Set;

import ast.Expr;
import ast.StringLiteralExpr;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;

/**
 * Some helper methods for dealing with the load function.
 */
public class LoadFunction {
  /**
   * Determines what the load function can load.
   * Returns either a set of variables to load or null. If it
   * returns null then it is unknown what variables are loaded. This
   * is a conservative approximation. If a single variable with a
   * wild card or regular expressions are used then it returns
   * null. This might be over an approximation.
   */
  public static Set<String> loadWhat(ast.List<Expr> args) {
    if (args.getNumChild() < 2) {
      return null;
    }

    String arg0 = loadArgument(args.getChild(0));
    String arg1 = loadArgument(args.getChild(1));
    if (arg0 == null || arg1 == null) {
      return null;
    }

    Set<String> set = handleAsciiFlag(arg0, arg1);
    if (set != null) {
      return set;
    }
    set = handleAsciiFlag(arg1, arg0);
    if (set != null) {
      return set;
    }

    set = Sets.newHashSet();

    boolean noFlag = true;
    String filename = arg0;
    if (arg0.equals("-mat")) {
      noFlag = false;
      filename = arg1;
    }
    if (arg1.equals("-mat")) {
      noFlag = noFlag && true;
    }
    filename = genVarName(filename);

    if (noFlag) {
      set.add(arg1);
    }

    for (int i = 2; i < args.getNumChild(); i++) {
      String arg = loadArgument(args.getChild(i));
      if (arg == null) {
        return null;
      }

      Set<String> asciiSet = handleAsciiFlag(arg, filename);
      if (asciiSet != null) {
        return asciiSet;
      }

      if (!arg.equals("-mat")) {
        set.add(arg);
      }
    }
    return set;
  }
  /**
   * Deals with the ascii flag. Returns a set to return if it is an
   * ascii flag, otherwise returns null.
   */
  private static Set<String> handleAsciiFlag(String arg, String filename) {
    if (arg.equals("-ascii")){
      return ImmutableSet.of(genVarName(filename));
    }
    return null;
  }

  /**
   * Processes a single argument to load. If it would cause the load
   * to destroy all info then it returns null, otherwise it returns
   * a string with the literal value of the arg.
   * Things that are rejected are -ascii, -regexp, anything
   * containing a *
   */
  private static String loadArgument(Expr arg) {
    if (!(arg instanceof StringLiteralExpr)) {
      return null;
    }
    String value = ((StringLiteralExpr) arg).getValue();
    if (value.equals("-regexp") || value.contains("*")) {
      return null;
    }
    return value.toLowerCase();
  }

  /**
   * generate a correct variable name from a given string. Strips
   * director, extension and turns any undesirable characters into
   * _. If it starts with a number then prepends an X.
   */
  private static String genVarName(String s) {
    int end = s.lastIndexOf('.');
    end = end != -1 ? end : s.length();
    String name = s.substring(s.lastIndexOf('/') + 1, end);
    name = name.replaceAll( "\\W", "_" );
    name = name.matches("\\A\\d.*") ? "X" + name : name;
    return name;
  }
}