text:
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using ColorPickerWPF;
using ColorPickerWPF.Code;
using Stamper.DataAccess;
using Stamper.UI.Events;
using Stamper.UI.ViewModels;
using Stamper.UI.ViewModels.Base;

namespace Stamper.UI.Controls
{
    public partial class SpecialControl : UserControl
    {
        private SpecialControlViewModel _vm;

        public SpecialControl()
        {
            InitializeComponent();
            _vm = new SpecialControlViewModel();
            DataContext = _vm;

            _vm.ColorPickCommand = new RelayCommand(o =>
            {
                ColorPickerControl.ColorPickerChangeHandler previewHandler =
                    selectedColor => RaiseEvent(new ColorSelectedEvent(TextManipulationChangedEvent, selectedColor));

                Color color;
                bool ok = SettingsManager.LiveColorPreview
                    ? ColorPickerWindow.ShowDialog(out color, ColorPickerDialogOptions.None, null, _vm.TextColor, previewHandler)
                    : ColorPickerWindow.ShowDialog(out color, ColorPickerDialogOptions.None, null, _vm.TextColor);

                if (ok)
                {
                    _vm.TextColor = color;
                }

                RaiseEvent(new ColorSelectedEvent(TextManipulationChangedEvent, _vm.TextColor));
            });

            _vm.BackdropColorPickCommand = new RelayCommand(o =>
            {
                ColorPickerControl.ColorPickerChangeHandler previewHandler =
                    selectedColor => RaiseEvent(new ColorSelectedEvent(BackdropColorChangedEvent, selectedColor));

                Color color;
                bool ok = SettingsManager.LiveColorPreview
                    ? ColorPickerWindow.ShowDialog(out color, ColorPickerDialogOptions.None, null, _vm.BackdropColor, previewHandler)
                    : ColorPickerWindow.ShowDialog(out color, ColorPickerDialogOptions.None, null, _vm.BackdropColor);

                if (ok)
                {
                    _vm.BackdropColor = color;
                }

                RaiseEvent(new ColorSelectedEvent(BackdropColorChangedEvent, _vm.BackdropColor));
            });

            _vm.SpecialFilterColorPickCommand = new RelayCommand(o =>
            {
                ColorPickerControl.ColorPickerChangeHandler previewHandler =
                    selectedColor => RaiseEvent(new ColorSelectedEvent(SpecialFilterColorChangedEvent, selectedColor));

                Color color;
                bool ok = SettingsManager.LiveColorPreview
                    ? ColorPickerWindow.ShowDialog(out color, ColorPickerDialogOptions.None, null, _vm.SpecialFilterColor, previewHandler)
                    : ColorPickerWindow.ShowDialog(out color, ColorPickerDialogOptions.None, null, _vm.SpecialFilterColor);

                if (ok)
                {
                    _vm.SpecialFilterColor = color;
                }

                RaiseEvent(new ColorSelectedEvent(SpecialFilterColorChangedEvent, _vm.SpecialFilterColor));
            });

            _vm.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(_vm.RotationAngle))
                {
                    if (int.TryParse(_vm.RotationAngle, out int rotationAngle))
                    {
                        RaiseEvent(new RotationChangedEvent(RotationChangedEvent, rotationAngle));
                    }
                }
                if (args.PropertyName == nameof(_vm.TextManipulationShowBorder) ||
                    args.PropertyName == nameof(_vm.TextManipulationShowText) ||
                    args.PropertyName == nameof(_vm.TextRotationAngle) ||
                    args.PropertyName == nameof(_vm.TextContent))
                {
                    int.TryParse(_vm.TextRotationAngle, out int textRotationAngle);

                    var textChangedEvent = new TextManipulationEvent(
                        TextManipulationChangedEvent,
                        _vm.TextManipulationShowBorder,
                        _vm.TextManipulationShowText,
                        _vm.TextContent,
                        textRotationAngle
                    );
                    RaiseEvent(textChangedEvent);
                }
            };
            _vm.ManualZoomImage = new RelayCommand(o =>
            {
                RaiseEvent(new ButtonZoomEvent(ButtonZoomEvent, int.Parse(o.ToString()), Events.ButtonZoomEvent.Target.Image));
            });
            _vm.ManualZoomText = new RelayCommand(o =>
            {
                RaiseEvent(new ButtonZoomEvent(ButtonZoomEvent, int.Parse(o.ToString()), Events.ButtonZoomEvent.Target.Text));
            });
        }

        public void ResetRotation()
        {
            _vm.RotationAngle = "0";
            _vm.TextRotationAngle = "0";
        }

        private void FilterBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RaiseEvent(new RoutedEventArgs(FilterSelectedEvent));
        }

        private void FontBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            RaiseEvent(new FontChangedEvent(TextManipulationChangedEvent, FontBox.SelectedItem as FontFamily));
        }

        private void InputValidation(object sender, TextCompositionEventArgs e)
        {
            //Allow the user to input a minus-sign (but only one)
            if (AngleBox.Text != string.Empty && AngleBox.Text.First() != '-' && e.Text != string.Empty && e.Text.First() == '-' && TextAngle.CaretIndex == 0)
            {
                return;
            }

            SharedEventHandlingLogic.InputValidation_ContrainToInt(sender, e);
        }

        private void InputValidationOnPaste(object sender, DataObjectPastingEventArgs e)
        {
            SharedEventHandlingLogic.InputValidationOnPaste_ContrainToInt(sender, e);
        }

        private void InputValidation_Text(object sender, TextCompositionEventArgs e)
        {
            //Allow the user to input a minus-sign (but only one)
            if (TextAngle.Text != string.Empty && TextAngle.Text.First() != '-' && e.Text != string.Empty && e.Text.First() == '-' && TextAngle.CaretIndex == 0)
            {
                return;
            }

            SharedEventHandlingLogic.InputValidation_ContrainToInt(sender, e);
        }

        private void AngleBox_OnKeyUp(object sender, KeyEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(AngleBox.Text)) _vm.RotationAngle = "0";

            _vm.FireRotationProperty.Execute(null);
        }

        private void TextBox_OnKeyUp(object sender, KeyEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(TextAngle.Text)) _vm.TextRotationAngle = "0";
        }

        public void SetTextRotationAngle(int angleDelta)
        {
            _vm.TextRotationAngle = (int.Parse(_vm.TextRotationAngle) + angleDelta).ToString();
        }

        public void SetRotationAngle(int angleDelta)
        {
            _vm.RotationAngle = (int.Parse(_vm.RotationAngle) + angleDelta).ToString();
        }

        #region EventRouting
        public static readonly RoutedEvent FilterSelectedEvent =
            EventManager.RegisterRoutedEvent(nameof(FilterSelectedEvent), RoutingStrategy.Bubble,
                                             typeof(RoutedEventHandler), typeof(SpecialControl));

        public event RoutedEventHandler FilterSelected
        {
            add { AddHandler(FilterSelectedEvent, value); }
            remove { RemoveHandler(FilterSelectedEvent, value); }
        }

        public static readonly RoutedEvent RotationChangedEvent =
            EventManager.RegisterRoutedEvent(nameof(RotationChangedEvent), RoutingStrategy.Bubble,
                                             typeof(RoutedEventHandler), typeof(SpecialControl));

        public event RoutedEventHandler RotationChanged
        {
            add { AddHandler(RotationChangedEvent, value); }
            remove { RemoveHandler(RotationChangedEvent, value); }
        }

        public static readonly RoutedEvent TextManipulationChangedEvent =
            EventManager.RegisterRoutedEvent(nameof(TextManipulationChangedEvent), RoutingStrategy.Bubble,
                                             typeof(RoutedEventHandler), typeof(SpecialControl));

        public event RoutedEventHandler TextManipulationChanged
        {
            add { AddHandler(TextManipulationChangedEvent, value); }
            remove { RemoveHandler(TextManipulationChangedEvent, value); }
        }

        public static readonly RoutedEvent ButtonZoomEvent =
            EventManager.RegisterRoutedEvent(nameof(ButtonZoomEvent), RoutingStrategy.Bubble,
                                             typeof(RoutedEventHandler), typeof(SpecialControl));

        public event RoutedEventHandler ButtonZoom
        {
            add { AddHandler(ButtonZoomEvent, value); }
            remove { RemoveHandler(ButtonZoomEvent, value); }
        }

        public static readonly RoutedEvent BackdropColorChangedEvent =
            EventManager.RegisterRoutedEvent(nameof(BackdropColorChangedEvent), RoutingStrategy.Bubble,
                                             typeof(RoutedEventHandler), typeof(SpecialControl));

        public event RoutedEventHandler BackdropColorChanged
        {
            add { AddHandler(BackdropColorChangedEvent, value); }
            remove { RemoveHandler(BackdropColorChangedEvent, value); }
        }

        public static readonly RoutedEvent SpecialFilterColorChangedEvent =
            EventManager.RegisterRoutedEvent(nameof(SpecialFilterColorChangedEvent), RoutingStrategy.Bubble,
                                             typeof(RoutedEventHandler), typeof(SpecialControl));

        public event RoutedEventHandler SpecialFilterColorChanged
        {
            add { AddHandler(SpecialFilterColorChangedEvent, value); }
            remove { RemoveHandler(SpecialFilterColorChangedEvent, value); }
        }
        #endregion

    }
}


text:
from collections import namedtuple

from twisted.python.filepath import FilePath
from yaml import safe_load
from yaml.error import YAMLError

class NoConfiguration(Exception):
    """
    The configuration file was not found.
    """

    def __init__(self, path):
        self.path = path
        super(NoConfiguration, self).__init__(
            b"The adapter configuration file '%s' was not found." % (self.path))

class InvalidConfiguration(Exception):
    """
    The configuration file content was not valid.
    """

class PluginConfiguration(object):
    """
    Read and parse a adapter configuration from a YAML file.
    """

    _default_file = b"/etc/powerstrip/adapters.yml"

    def __init__(self):
        """
        Initializes ``PluginConfiguration`` attributes.

        self._endpoints: A dict of Docker API endpoint expressions mapping to
            dicts ``pre`` and ``post`` adapter lists. Each adapter in the adapters
            references the ``_adapters`` attribute.

        self._adapters: A dict mapping adapter names to URIs.
        """
        self._endpoints = {}
        self._adapters = {}

    def read_and_parse(self):
        """
        Read and parse the adapter configuration.

        :raises: ``NoConfiguration`` if the configuration file was not found.

        :raises: ``InvalidConfiguration`` if the file was not valid configuration.
        """
        self.__init__() # reset all attributes
        config_struct = self._read_from_yaml_file(None)
        self._parse_adapters(config_struct)

    def _read_from_yaml_file(self, path):
        """
        Read the adapter config YAML file and return the YAML datastructure.

        :param path: A ``FilePath`` representing the path to the YAML file, or
            self._default_file if None.

        :raises: ``NoConfiguration`` if the adapter file was not found.

        :raises: ``InvalidConfiguration`` if if the file was not valid YAML.
        """
        if path is None:
            path = FilePath(self._default_file)
        try:
            content = path.getContent()
        except IOError:
            raise NoConfiguration(path.path)

        try:
            yaml = safe_load(content)
            return yaml
        except YAMLError:
            raise InvalidConfiguration()

    def _parse_adapters(self, datastructure):
        """
        Take the decoded YAML configuration and store it as usable
        datastructures. See ``self.__init__``.

        :raises: ``InvalidConfiguration`` if the configuration is invalid.
        """
        try:
            self._endpoints = datastructure["endpoints"]
        except KeyError:
            raise InvalidConfiguration("Required key 'endpoints' is missing.")
        except TypeError:
            raise InvalidConfiguration("Could not parse adapters file.")
        try:
            self._adapters = datastructure["adapters"]
        except KeyError:
            raise InvalidConfiguration("Required key 'adapters' is missing.")

        # Sanity check that all referenced adapters exist and that optional pre
        # and post keys are added, with no unknown keys
        known_adapters = self.adapters()
        referenced_adapters = set()
        for endpoint, config in self._endpoints.iteritems():
            config_keys = set(config.keys())
            if not config_keys:
                raise InvalidConfiguration(
                    "No configuration found for endpoint '%s'" % (endpoint,))

            unknown_keys = config_keys - set(["pre", "post"])
            if unknown_keys:
                raise InvalidConfiguration(
                    "Unkonwn keys found in endpoint configuration: %s" %
                        (", ".join(unknown_keys)))

            if "pre" not in config:
                config['pre'] = []
            if "post" not in config:
                config['post'] = []

            referenced_adapters.update(config['pre'])
            referenced_adapters.update(config['post'])

        unkown_adapters = referenced_adapters - known_adapters
        if unkown_adapters:
            raise InvalidConfiguration(
                "Plugins were referenced in endpoint configuration but not "
                "defined: %s" % (", ".join(unkown_adapters)))

    def endpoints(self):
        """
        Return a ``set`` of endpoint expressions.
        """
        return set(self._endpoints.keys())

    def endpoint(self, endpoint):
        """
        Return the adapter configuration for the endpoint expression returned by
        ``self.endpoints``. This is an ``EndpointConfiguration` object with attrbutes
        ``pre`` and ``post``. These attributes are lists of adapter names.

        :raises: `KeyError` if the endpoint expression was not found.
        """
        return EndpointConfiguration(**self._endpoints[endpoint])

    def adapters(self):
        """
        Return a ``set`` of known adapters.
        """
        return set(self._adapters.keys())

    def adapter_uri(self, adapter):
        """
        Return the URI for a adapter.

        :param ``adapter``: The the desired adapter.

        :raises: `KeyError` if the adapter was not found.
        """
        return self._adapters[adapter]

class EndpointConfiguration(namedtuple("EndpointConfiguration", ["pre", "post"])):
    """
    A representation of the configured adapters for an endpoint.

    :param pre: A adapter ``list`` to call before passing this call to Docker.

    :param post: A adapter ``list`` to call after passing this call to Docker.
    """

redpajama_set_name: RedPajamaGithub


text:
package no.ssb.vtl.script.expressions.logic;

import no.ssb.vtl.model.VTLBoolean;
import no.ssb.vtl.model.VTLExpression;

public class OrExpression extends AbstractLogicExpression {

    public OrExpression(VTLExpression leftOperand, VTLExpression rightOperand) {
        super(leftOperand, rightOperand);
    }

    @Override
    protected VTLBoolean compute(VTLBoolean left, VTLBoolean right) {
        if (isNull(left))
            return trueOrNull(right);

        if (isNull(right))
            return trueOrNull(left);

        return VTLBoolean.of(left.get() || right.get());
    }

}


text:
from __future__ import unicode_literals

from django.db import migrations, models
import editor_md.models

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=100, verbose_name='标题')),
                ('content', editor_md.models.EditorMdField(blank=True, verbose_name='文章内容')),
            ],
        ),
    ]


text:
package parquet.column.values.boundedint;

import static parquet.Log.DEBUG;

import java.io.IOException;

import parquet.Log;
import parquet.bytes.BytesUtils;
import parquet.column.values.ValuesReader;
import parquet.io.ParquetDecodingException;

/**
 * @see BoundedIntValuesWriter
 */
class BoundedIntValuesReader extends ValuesReader {
  private static final Log LOG = Log.getLog(BoundedIntValuesReader.class);

  private int currentValueCt = 0;
  private int currentValue = 0;
  private final int bitsPerValue;
  private BitReader bitReader = new BitReader();

  public BoundedIntValuesReader(int bound) {
    if (bound == 0) {
      throw new ParquetDecodingException("Value bound cannot be 0. Use DevNullColumnReader instead.");
    }
    bitsPerValue = BytesUtils.getWidthFromMaxInt(bound);
  }

  @Override
  public int readInteger() {
    try {
      if (currentValueCt > 0) {
        currentValueCt--;
        return currentValue;
      }
      if (bitReader.readBit()) {
        currentValue = bitReader.readNBitInteger(bitsPerValue);
        currentValueCt = bitReader.readUnsignedVarint() - 1;
      } else {
        currentValue = bitReader.readNBitInteger(bitsPerValue);
      }
      return currentValue;
    } catch (IOException e) {
      throw new ParquetDecodingException("could not read int", e);
    }
  }

  // This forces it to deserialize into memory. If it wanted
  // to, it could just read the bytes (though that number of
  // bytes would have to be serialized). This is the flip-side
  // to BoundedIntColumnWriter.writeData(BytesOutput)
  @Override
  public int initFromPage(long valueCount, byte[] in, int offset) throws IOException {
    if (DEBUG) LOG.debug("reading size at "+ offset + ": " + in[offset] + " " + in[offset + 1] + " " + in[offset + 2] + " " + in[offset + 3] + " ");
    int totalBytes = BytesUtils.readIntLittleEndian(in, offset);
    if (DEBUG) LOG.debug("will read "+ totalBytes + " bytes");
    currentValueCt = 0;
    currentValue = 0;
    bitReader.prepare(in, offset + 4, totalBytes);
    if (DEBUG) LOG.debug("will read next from " + (offset + totalBytes + 4));
    return offset + totalBytes + 4;
  }
}


text:
package com.example.vale.migeoavisador;

import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationProvider;
import android.os.Bundle;
import android.util.Log;

public class ListenerPosicion implements  LocationListener
{

    private Context context;

    public ListenerPosicion (Context context)
    {
        this.context = context;
    }

    @Override
    public void onLocationChanged(Location location) {

        Log.d(getClass().getCanonicalName(), " Localización cambiada");
        ((MainActivity)this.context).dibujaPosicion(location);
        ((MainActivity)this.context).actuaizaContador();

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {

        switch(status){
            case LocationProvider.AVAILABLE:
                Log.d(getClass().getCanonicalName(), "Proveedor " + provider + " DISPONIBLE");
                break;
            case LocationProvider.OUT_OF_SERVICE:
                Log.d(getClass().getCanonicalName(), "Proveedor " + provider + " FUERA DE SERVICIO ");
                break;
            case LocationProvider.TEMPORARILY_UNAVAILABLE:
                Log.d(getClass().getCanonicalName(), "Proveedor " + provider + " TEMPORALMENTE NO DISPONIBLE");
                break;

        }

    }

    @Override
    public void onProviderEnabled(String provider) {
//este método también es invocado al volver de la actividad de los ajustes de localización
        Log.d(getClass().getCanonicalName(), "Proveedor " + provider + " ACTIVADO");

    }

    @Override
    public void onProviderDisabled(String provider) {
//este método también es invocado al volver de la actividad de los ajustes de localización
        Log.d(getClass().getCanonicalName(), "Proveedor " + provider + " DESACTIVADO");

    }
}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>CommonJS</title>
  <link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

CommonJS

          <canvas class="chart chart-line" chart-data="data" chart-series="series" chart-labels="labels"></canvas>


text:
<?php

namespace {{App\}}Http\Middleware;

use Closure;
use Illuminate\Contracts\Auth\Guard;
use App\Facades\Activity as Action;

class Activity
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        Action::log('Standard User Action');

        return $next($request);
    }
}


text:
var baseDir= require('./basedir');
var DataFilter = require(baseDir + 'dataFilter');
var testData = require('./testData.json');

var assert = require('chai').assert;

var filter = new DataFilter(testData);

describe('DataFilter', function(){
    it("should filter by tags", function(){
        var filtered = filter.filter('a');
        assert.equal(7, filtered[0].id);

        var filtered = filter.filter('b');
        assert.equal(6, filtered[0].id);

        filter
    });

    it("empty list should filter to empty", function(){
        var filter = new DataFilter([]);
        var filtered = filter.filter('a');
        assert.equal(0, filtered.length);

    });

    it("empty filter should return full list", function(){
        var filtered = filter.filter('');
        assert.equal(testData.length, filtered.length);
    })

    it("should also filter by item name", function(){
        var filtered = filter.filter("Hobbit House");
        assert.equal(6, filtered[0].id);
    });

    it("should be case insensitive", function(){
        var filtered = filter.filter("q");
        assert.equal(1, filtered[0].id);
    });

    it("should return full list if no arguments", function(){
        var filtered = filter.filter();
        assert.equal(testData.length, filtered.length);
    });
})


text:
package net.doubledoordev.launcher.util;

/**
 * @author Dries007
 */
public class MyCustomAppender
{}


text:
require 'rails_helper'

describe ItemHasUseRestriction do
  # pending "add some examples to (or delete) #{__FILE__}"

end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Cutlass: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

Cutlass

CUDA Templates for Linear Algebra Subroutines and Solvers

cutlass

TileTraitsWarpRake

cutlass::TileTraitsWarpRake< Tile_, Threads > Member List

This is the complete list of members for cutlass::TileTraitsWarpRake< Tile_, Threads >, including all inherited members.

Delta typedef	cutlass::TileTraitsWarpRake< Tile_, Threads >

Iterations typedef	cutlass::TileTraitsWarpRake< Tile_, Threads >

kThreads	cutlass::TileTraitsWarpRake< Tile_, Threads >	static

kWarpCount	cutlass::TileTraitsWarpRake< Tile_, Threads >	static

kWarpsContiguous	cutlass::TileTraitsWarpRake< Tile_, Threads >	static

kWarpSize	cutlass::TileTraitsWarpRake< Tile_, Threads >	static

kWarpsStrided	cutlass::TileTraitsWarpRake< Tile_, Threads >	static

ThreadShape typedef	cutlass::TileTraitsWarpRake< Tile_, Threads >

Tile typedef	cutlass::TileTraitsWarpRake< Tile_, Threads >

<address class="footer">
Generated on Fri Oct 26 2018 14:53:35 for Cutlass by

 1.8.14
</address>


text:
import datetime
import codecs
import requests
import os
import time
from pyquery import PyQuery as pq

# 实现git提交
def git_add_commit_push(date, filename):
    cmd_git_add = 'git add {filename}'.format(filename=filename)
    cmd_git_commit = 'git commit -m "{date}"'.format(date=date)
    cmd_git_push = 'git push -u origin master'

    os.system(cmd_git_add)
    os.system(cmd_git_commit)
    os.system(cmd_git_push)

def createMarkdown(date, filename):
    with open(filename, 'w') as f:
        f.write("## " + date + "\n")

def scrape(language, filename):
    HEADERS = {
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0',
        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
        'Accept-Encoding': 'gzip,deflate,sdch',
        'Accept-Language': 'zh-CN,zh;q=0.8'
    }

    url = 'https://github.com/trending/{language}'.format(language=language)
    r = requests.get(url, headers=HEADERS)
    assert r.status_code == 200

    d = pq(r.content)
    items = d('ol.repo-list li')

    # codecs to solve the problem utf-8 codec like chinese
    with codecs.open(filename, 'a', 'utf-8') as f:
        if language == '':
            language = 'general'

        f.write('\n### {language}\n'.format(language=language))

        for item in items:
            i = pq(item)
            title = i('h3 a').text()
            description = i('p.col-9').text()
            url = i('h3 a').attr('href')
            url = 'https://github.com' + url
            f.write(u'* [{title}]({url}):{description}\n'.format(
                title=title, url=url, description=description
            ))

def job():
    strdate = datetime.datetime.now().strftime('%Y-%m-%d')
    filename = '{date}.md'.format(date=strdate)

    # create markdown file
    createMarkdown(strdate, filename)

    print('start scraping')
    # write markdown
    # today's trending
    scrape('', filename)
    scrape('python', filename)
    scrape('javascript', filename)
    scrape('swift', filename)
    scrape('java', filename)
    scrape('go', filename)

    print('start git push')
    # git add commit push
    git_add_commit_push(strdate, filename)
    print('finish job in ' + strdate)

if __name__ == '__main__':
    while True:
        job()
        time.sleep(24 * 60 * 60)


text:
package pl.panryba.mc.ban;

/**
 * @author PanRyba.pl
 */
public interface GamePlayer {
    public String getName();
    public void kickPlayer(String message);
    void sendMessage(String message);
}


text:
//>>label: Draggable
//>>group: Interactions
//>>description: Enables dragging functionality for any element.
//>>docs: http://api.jqueryui.com/draggable/
//>>demos: http://jqueryui.com/draggable/
//>>css.structure: ../../themes/base/draggable.css

import $ from 'jquery';
import {
	ui
} from '../position.js';
import {
	widget
} from '../widget.js';

import {
	plugin
} from '../plugin.js';

import {
	mouse
} from './mouse.js';

widget("ui.draggable", mouse, {
	version: "1.12.0",
	widgetEventPrefix: "drag",
	options: {
		addClasses: true,
		appendTo: "parent",
		axis: false,
		connectToSortable: false,
		containment: false,
		cursor: "auto",
		cursorAt: false,
		grid: false,
		handle: false,
		helper: "original",
		iframeFix: false,
		opacity: false,
		refreshPositions: false,
		revert: false,
		revertDuration: 500,
		scope: "default",
		scroll: true,
		scrollSensitivity: 20,
		scrollSpeed: 20,
		snap: false,
		snapMode: "both",
		snapTolerance: 20,
		stack: false,
		zIndex: false,

		// Callbacks
		drag: null,
		start: null,
		stop: null
	},
	_create: function () {

		if (this.options.helper === "original") {
			this._setPositionRelative();
		}
		if (this.options.addClasses) {
			this._addClass("ui-draggable");
		}
		this._setHandleClassName();

		this._mouseInit();
	},

	_setOption: function (key, value) {
		this._super(key, value);
		if (key === "handle") {
			this._removeHandleClassName();
			this._setHandleClassName();
		}
	},

	_destroy: function () {
		if ((this.helper || this.element).is(".ui-draggable-dragging")) {
			this.destroyOnClear = true;
			return;
		}
		this._removeHandleClassName();
		this._mouseDestroy();
	},

	_mouseCapture: function (event) {
		var o = this.options;

		this._blurActiveElement(event);

		// Among others, prevent a drag on a resizable-handle
		if (this.helper || o.disabled ||
			$(event.target).closest(".ui-resizable-handle").length > 0) {
			return false;
		}

		//Quit if we're not on a valid handle
		this.handle = this._getHandle(event);
		if (!this.handle) {
			return false;
		}

		this._blockFrames(o.iframeFix === true ? "iframe" : o.iframeFix);

		return true;

	},

	_blockFrames: function (selector) {
		this.iframeBlocks = this.document.find(selector).map(function () {
			var iframe = $(this);

			return $("<div>")
				.css("position", "absolute")
				.appendTo(iframe.parent())
				.outerWidth(iframe.outerWidth())
				.outerHeight(iframe.outerHeight())
				.offset(iframe.offset())[0];
		});
	},

	_unblockFrames: function () {
		if (this.iframeBlocks) {
			this.iframeBlocks.remove();
			delete this.iframeBlocks;
		}
	},

	_blurActiveElement: function (event) {
		var activeElement = $.ui.safeActiveElement(this.document[0]),
			target = $(event.target);

		// Only blur if the event occurred on an element that is:
		// 1) within the draggable handle
		// 2) but not within the currently focused element
		// See #10527, #12472
		if (this._getHandle(event) && target.closest(activeElement).length) {
			return;
		}

		// Blur any element that currently has focus, see #4261
		$.ui.safeBlur(activeElement);
	},

	_mouseStart: function (event) {

		var o = this.options;

		//Create and append the visible helper
		this.helper = this._createHelper(event);

		this._addClass(this.helper, "ui-draggable-dragging");

		//Cache the helper size
		this._cacheHelperProportions();

		//If ddmanager is used for droppables, set the global draggable
		if ($.ui.ddmanager) {
			$.ui.ddmanager.current = this;
		}

		/*
		 * - Position generation -
		 * This block generates everything position related - it's the core of draggables.
		 */

		//Cache the margins of the original element
		this._cacheMargins();

		//Store the helper's css position
		this.cssPosition = this.helper.css("position");
		this.scrollParent = this.helper.scrollParent(true);
		this.offsetParent = this.helper.offsetParent();
		this.hasFixedAncestor = this.helper.parents().filter(function () {
			return $(this).css("position") === "fixed";
		}).length > 0;

		//The element's absolute position on the page minus margins
		this.positionAbs = this.element.offset();
		this._refreshOffsets(event);

		//Generate the original position
		this.originalPosition = this.position = this._generatePosition(event, false);
		this.originalPageX = event.pageX;
		this.originalPageY = event.pageY;

		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));

		//Set a containment if given in the options
		this._setContainment();

		//Trigger event + callbacks
		if (this._trigger("start", event) === false) {
			this._clear();
			return false;
		}

		//Recache the helper size
		this._cacheHelperProportions();

		//Prepare the droppable offsets
		if ($.ui.ddmanager && !o.dropBehaviour) {
			$.ui.ddmanager.prepareOffsets(this, event);
		}

		// Execute the drag once - this causes the helper not to be visible before getting its
		// correct position
		this._mouseDrag(event, true);

		// If the ddmanager is used for droppables, inform the manager that dragging has started
		// (see #5003)
		if ($.ui.ddmanager) {
			$.ui.ddmanager.dragStart(this, event);
		}

		return true;
	},

	_refreshOffsets: function (event) {
		this.offset = {
			top: this.positionAbs.top - this.margins.top,
			left: this.positionAbs.left - this.margins.left,
			scroll: false,
			parent: this._getParentOffset(),
			relative: this._getRelativeOffset()
		};

		this.offset.click = {
			left: event.pageX - this.offset.left,
			top: event.pageY - this.offset.top
		};
	},

	_mouseDrag: function (event, noPropagation) {

		// reset any necessary cached properties (see #5009)
		if (this.hasFixedAncestor) {
			this.offset.parent = this._getParentOffset();
		}

		//Compute the helpers position
		this.position = this._generatePosition(event, true);
		this.positionAbs = this._convertPositionTo("absolute");

		//Call plugins and callbacks and use the resulting position if something is returned
		if (!noPropagation) {
			var ui = this._uiHash();
			if (this._trigger("drag", event, ui) === false) {
				this._mouseUp(new $.Event("mouseup", event));
				return false;
			}
			this.position = ui.position;
		}

		this.helper[0].style.left = this.position.left + "px";
		this.helper[0].style.top = this.position.top + "px";

		if ($.ui.ddmanager) {
			$.ui.ddmanager.drag(this, event);
		}

		return false;
	},

	_mouseStop: function (event) {

		//If we are using droppables, inform the manager about the drop
		var that = this,
			dropped = false;
		if ($.ui.ddmanager && !this.options.dropBehaviour) {
			dropped = $.ui.ddmanager.drop(this, event);
		}

		//if a drop comes from outside (a sortable)
		if (this.dropped) {
			dropped = this.dropped;
			this.dropped = false;
		}

		if ((this.options.revert === "invalid" && !dropped) ||
			(this.options.revert === "valid" && dropped) ||
			this.options.revert === true || ($.isFunction(this.options.revert) &&
				this.options.revert.call(this.element, dropped))
		) {
			$(this.helper).animate(
				this.originalPosition,
				parseInt(this.options.revertDuration, 10),
				function () {
					if (that._trigger("stop", event) !== false) {
						that._clear();
					}
				}
			);
		} else {
			if (this._trigger("stop", event) !== false) {
				this._clear();
			}
		}

		return false;
	},

	_mouseUp: function (event) {
		this._unblockFrames();

		// If the ddmanager is used for droppables, inform the manager that dragging has stopped
		// (see #5003)
		if ($.ui.ddmanager) {
			$.ui.ddmanager.dragStop(this, event);
		}

		// Only need to focus if the event occurred on the draggable itself, see #10527
		if (this.handleElement.is(event.target)) {

			// The interaction is over; whether or not the click resulted in a drag,
			// focus the element
			this.element.trigger("focus");
		}

		return $.ui.mouse.prototype._mouseUp.call(this, event);
	},

	cancel: function () {

		if (this.helper.is(".ui-draggable-dragging")) {
			this._mouseUp(new $.Event("mouseup", {
				target: this.element[0]
			}));
		} else {
			this._clear();
		}

		return this;

	},

	_getHandle: function (event) {
		return this.options.handle ?
			!!$(event.target).closest(this.element.find(this.options.handle)).length :
			true;
	},

	_setHandleClassName: function () {
		this.handleElement = this.options.handle ?
			this.element.find(this.options.handle) : this.element;
		this._addClass(this.handleElement, "ui-draggable-handle");
	},

	_removeHandleClassName: function () {
		this._removeClass(this.handleElement, "ui-draggable-handle");
	},

	_createHelper: function (event) {

		var o = this.options,
			helperIsFunction = $.isFunction(o.helper),
			helper = helperIsFunction ?
			$(o.helper.apply(this.element[0], [event])) :
			(o.helper === "clone" ?
				this.element.clone().removeAttr("id") :
				this.element);

		if (!helper.parents("body").length) {
			helper.appendTo((o.appendTo === "parent" ?
				this.element[0].parentNode :
				o.appendTo));
		}

		// Http://bugs.jqueryui.com/ticket/9446
		// a helper function can return the original element
		// which wouldn't have been set to relative in _create
		if (helperIsFunction && helper[0] === this.element[0]) {
			this._setPositionRelative();
		}

		if (helper[0] !== this.element[0] &&
			!(/(fixed|absolute)/).test(helper.css("position"))) {
			helper.css("position", "absolute");
		}

		return helper;

	},

	_setPositionRelative: function () {
		if (!(/^(?:r|a|f)/).test(this.element.css("position"))) {
			this.element[0].style.position = "relative";
		}
	},

	_adjustOffsetFromHelper: function (obj) {
		if (typeof obj === "string") {
			obj = obj.split(" ");
		}
		if ($.isArray(obj)) {
			obj = {
				left: +obj[0],
				top: +obj[1] || 0
			};
		}
		if ("left" in obj) {
			this.offset.click.left = obj.left + this.margins.left;
		}
		if ("right" in obj) {
			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
		}
		if ("top" in obj) {
			this.offset.click.top = obj.top + this.margins.top;
		}
		if ("bottom" in obj) {
			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
		}
	},

	_isRootNode: function (element) {
		return (/(html|body)/i).test(element.tagName) || element === this.document[0];
	},

	_getParentOffset: function () {

		//Get the offsetParent and cache its position
		var po = this.offsetParent.offset(),
			document = this.document[0];

		// This is a special case where we need to modify a offset calculated on start, since the
		// following happened:
		// 1. The position of the helper is absolute, so it's position is calculated based on the
		// next positioned parent
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
		// the document, which means that the scroll is included in the initial calculation of the
		// offset of the parent, and never recalculated upon drag
		if (this.cssPosition === "absolute" && this.scrollParent[0] !== document &&
			$.contains(this.scrollParent[0], this.offsetParent[0])) {
			po.left += this.scrollParent.scrollLeft();
			po.top += this.scrollParent.scrollTop();
		}

		if (this._isRootNode(this.offsetParent[0])) {
			po = {
				top: 0,
				left: 0
			};
		}

		return {
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
		};

	},

	_getRelativeOffset: function () {
		if (this.cssPosition !== "relative") {
			return {
				top: 0,
				left: 0
			};
		}

		var p = this.element.position(),
			scrollIsRootNode = this._isRootNode(this.scrollParent[0]);

		return {
			top: p.top - (parseInt(this.helper.css("top"), 10) || 0) +
				(!scrollIsRootNode ? this.scrollParent.scrollTop() : 0),
			left: p.left - (parseInt(this.helper.css("left"), 10) || 0) +
				(!scrollIsRootNode ? this.scrollParent.scrollLeft() : 0)
		};

	},

	_cacheMargins: function () {
		this.margins = {
			left: (parseInt(this.element.css("marginLeft"), 10) || 0),
			top: (parseInt(this.element.css("marginTop"), 10) || 0),
			right: (parseInt(this.element.css("marginRight"), 10) || 0),
			bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
		};
	},

	_cacheHelperProportions: function () {
		this.helperProportions = {
			width: this.helper.outerWidth(),
			height: this.helper.outerHeight()
		};
	},

	_setContainment: function () {

		var isUserScrollable, c, ce,
			o = this.options,
			document = this.document[0];

		this.relativeContainer = null;

		if (!o.containment) {
			this.containment = null;
			return;
		}

		if (o.containment === "window") {
			this.containment = [
				$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
				$(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
				$(window).scrollLeft() + $(window).width() -
				this.helperProportions.width - this.margins.left,
				$(window).scrollTop() +
				($(window).height() || document.body.parentNode.scrollHeight) -
				this.helperProportions.height - this.margins.top
			];
			return;
		}

		if (o.containment === "document") {
			this.containment = [
				0,
				0,
				$(document).width() - this.helperProportions.width - this.margins.left,
				($(document).height() || document.body.parentNode.scrollHeight) -
				this.helperProportions.height - this.margins.top
			];
			return;
		}

		if (o.containment.constructor === Array) {
			this.containment = o.containment;
			return;
		}

		if (o.containment === "parent") {
			o.containment = this.helper[0].parentNode;
		}

		c = $(o.containment);
		ce = c[0];

		if (!ce) {
			return;
		}

		isUserScrollable = /(scroll|auto)/.test(c.css("overflow"));

		this.containment = [
			(parseInt(c.css("borderLeftWidth"), 10) || 0) +
			(parseInt(c.css("paddingLeft"), 10) || 0),
			(parseInt(c.css("borderTopWidth"), 10) || 0) +
			(parseInt(c.css("paddingTop"), 10) || 0),
			(isUserScrollable ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) -
			(parseInt(c.css("borderRightWidth"), 10) || 0) -
			(parseInt(c.css("paddingRight"), 10) || 0) -
			this.helperProportions.width -
			this.margins.left -
			this.margins.right,
			(isUserScrollable ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) -
			(parseInt(c.css("borderBottomWidth"), 10) || 0) -
			(parseInt(c.css("paddingBottom"), 10) || 0) -
			this.helperProportions.height -
			this.margins.top -
			this.margins.bottom
		];
		this.relativeContainer = c;
	},

	_convertPositionTo: function (d, pos) {

		if (!pos) {
			pos = this.position;
		}

		var mod = d === "absolute" ? 1 : -1,
			scrollIsRootNode = this._isRootNode(this.scrollParent[0]);

		return {
			top: (

				// The absolute mouse position
				pos.top +

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.top * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top * mod -
				((this.cssPosition === "fixed" ?
					-this.offset.scroll.top :
					(scrollIsRootNode ? 0 : this.offset.scroll.top)) * mod)
			),
			left: (

				// The absolute mouse position
				pos.left +

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.left * mod +

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left * mod -
				((this.cssPosition === "fixed" ?
					-this.offset.scroll.left :
					(scrollIsRootNode ? 0 : this.offset.scroll.left)) * mod)
			)
		};

	},

	_generatePosition: function (event, constrainPosition) {

		var containment, co, top, left,
			o = this.options,
			scrollIsRootNode = this._isRootNode(this.scrollParent[0]),
			pageX = event.pageX,
			pageY = event.pageY;

		// Cache the scroll
		if (!scrollIsRootNode || !this.offset.scroll) {
			this.offset.scroll = {
				top: this.scrollParent.scrollTop(),
				left: this.scrollParent.scrollLeft()
			};
		}

		/*
		 * - Position constraining -
		 * Constrain the position to a mix of grid, containment.
		 */

		// If we are not dragging yet, we won't check for options
		if (constrainPosition) {
			if (this.containment) {
				if (this.relativeContainer) {
					co = this.relativeContainer.offset();
					containment = [
						this.containment[0] + co.left,
						this.containment[1] + co.top,
						this.containment[2] + co.left,
						this.containment[3] + co.top
					];
				} else {
					containment = this.containment;
				}

				if (event.pageX - this.offset.click.left < containment[0]) {
					pageX = containment[0] + this.offset.click.left;
				}
				if (event.pageY - this.offset.click.top < containment[1]) {
					pageY = containment[1] + this.offset.click.top;
				}
				if (event.pageX - this.offset.click.left > containment[2]) {
					pageX = containment[2] + this.offset.click.left;
				}
				if (event.pageY - this.offset.click.top > containment[3]) {
					pageY = containment[3] + this.offset.click.top;
				}
			}

			if (o.grid) {

				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
				// argument errors in IE (see ticket #6950)
				top = o.grid[1] ? this.originalPageY + Math.round((pageY -
					this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
				pageY = containment ? ((top - this.offset.click.top >= containment[1] ||
						top - this.offset.click.top > containment[3]) ?
					top :
					((top - this.offset.click.top >= containment[1]) ?
						top - o.grid[1] : top + o.grid[1])) : top;

				left = o.grid[0] ? this.originalPageX +
					Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] :
					this.originalPageX;
				pageX = containment ? ((left - this.offset.click.left >= containment[0] ||
						left - this.offset.click.left > containment[2]) ?
					left :
					((left - this.offset.click.left >= containment[0]) ?
						left - o.grid[0] : left + o.grid[0])) : left;
			}

			if (o.axis === "y") {
				pageX = this.originalPageX;
			}

			if (o.axis === "x") {
				pageY = this.originalPageY;
			}
		}

		return {
			top: (

				// The absolute mouse position
				pageY -

				// Click offset (relative to the element)
				this.offset.click.top -

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.top -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.top +
				(this.cssPosition === "fixed" ?
					-this.offset.scroll.top :
					(scrollIsRootNode ? 0 : this.offset.scroll.top))
			),
			left: (

				// The absolute mouse position
				pageX -

				// Click offset (relative to the element)
				this.offset.click.left -

				// Only for relative positioned nodes: Relative offset from element to offset parent
				this.offset.relative.left -

				// The offsetParent's offset without borders (offset + border)
				this.offset.parent.left +
				(this.cssPosition === "fixed" ?
					-this.offset.scroll.left :
					(scrollIsRootNode ? 0 : this.offset.scroll.left))
			)
		};

	},

	_clear: function () {
		this._removeClass(this.helper, "ui-draggable-dragging");
		if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
			this.helper.remove();
		}
		this.helper = null;
		this.cancelHelperRemoval = false;
		if (this.destroyOnClear) {
			this.destroy();
		}
	},

	// From now on bulk stuff - mainly helpers

	_trigger: function (type, event, ui) {
		ui = ui || this._uiHash();
		plugin.call(this, type, [event, ui, this], true);

		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
		if (/^(drag|start|stop)/.test(type)) {
			this.positionAbs = this._convertPositionTo("absolute");
			ui.offset = this.positionAbs;
		}
		return $.Widget.prototype._trigger.call(this, type, event, ui);
	},

	plugins: {},

	_uiHash: function () {
		return {
			helper: this.helper,
			position: this.position,
			originalPosition: this.originalPosition,
			offset: this.positionAbs
		};
	}

});

plugin.add("draggable", "connectToSortable", {
	start: function (event, ui, draggable) {
		var uiSortable = $.extend({}, ui, {
			item: draggable.element
		});

		draggable.sortables = [];
		$(draggable.options.connectToSortable).each(function () {
			var sortable = $(this).sortable("instance");

			if (sortable && !sortable.options.disabled) {
				draggable.sortables.push(sortable);

				// RefreshPositions is called at drag start to refresh the containerCache
				// which is used in drag. This ensures it's initialized and synchronized
				// with any changes that might have happened on the page since initialization.
				sortable.refreshPositions();
				sortable._trigger("activate", event, uiSortable);
			}
		});
	},
	stop: function (event, ui, draggable) {
		var uiSortable = $.extend({}, ui, {
			item: draggable.element
		});

		draggable.cancelHelperRemoval = false;

		$.each(draggable.sortables, function () {
			var sortable = this;

			if (sortable.isOver) {
				sortable.isOver = 0;

				// Allow this sortable to handle removing the helper
				draggable.cancelHelperRemoval = true;
				sortable.cancelHelperRemoval = false;

				// Use _storedCSS To restore properties in the sortable,
				// as this also handles revert (#9675) since the draggable
				// may have modified them in unexpected ways (#8809)
				sortable._storedCSS = {
					position: sortable.placeholder.css("position"),
					top: sortable.placeholder.css("top"),
					left: sortable.placeholder.css("left")
				};

				sortable._mouseStop(event);

				// Once drag has ended, the sortable should return to using
				// its original helper, not the shared helper from draggable
				sortable.options.helper = sortable.options._helper;
			} else {

				// Prevent this Sortable from removing the helper.
				// However, don't set the draggable to remove the helper
				// either as another connected Sortable may yet handle the removal.
				sortable.cancelHelperRemoval = true;

				sortable._trigger("deactivate", event, uiSortable);
			}
		});
	},
	drag: function (event, ui, draggable) {
		$.each(draggable.sortables, function () {
			var innermostIntersecting = false,
				sortable = this;

			// Copy over variables that sortable's _intersectsWith uses
			sortable.positionAbs = draggable.positionAbs;
			sortable.helperProportions = draggable.helperProportions;
			sortable.offset.click = draggable.offset.click;

			if (sortable._intersectsWith(sortable.containerCache)) {
				innermostIntersecting = true;

				$.each(draggable.sortables, function () {

					// Copy over variables that sortable's _intersectsWith uses
					this.positionAbs = draggable.positionAbs;
					this.helperProportions = draggable.helperProportions;
					this.offset.click = draggable.offset.click;

					if (this !== sortable &&
						this._intersectsWith(this.containerCache) &&
						$.contains(sortable.element[0], this.element[0])) {
						innermostIntersecting = false;
					}

					return innermostIntersecting;
				});
			}

			if (innermostIntersecting) {

				// If it intersects, we use a little isOver variable and set it once,
				// so that the move-in stuff gets fired only once.
				if (!sortable.isOver) {
					sortable.isOver = 1;

					// Store draggable's parent in case we need to reappend to it later.
					draggable._parent = ui.helper.parent();

					sortable.currentItem = ui.helper
						.appendTo(sortable.element)
						.data("ui-sortable-item", true);

					// Store helper option to later restore it
					sortable.options._helper = sortable.options.helper;

					sortable.options.helper = function () {
						return ui.helper[0];
					};

					// Fire the start events of the sortable with our passed browser event,
					// and our own helper (so it doesn't create a new one)
					event.target = sortable.currentItem[0];
					sortable._mouseCapture(event, true);
					sortable._mouseStart(event, true, true);

					// Because the browser event is way off the new appended portlet,
					// modify necessary variables to reflect the changes
					sortable.offset.click.top = draggable.offset.click.top;
					sortable.offset.click.left = draggable.offset.click.left;
					sortable.offset.parent.left -= draggable.offset.parent.left -
						sortable.offset.parent.left;
					sortable.offset.parent.top -= draggable.offset.parent.top -
						sortable.offset.parent.top;

					draggable._trigger("toSortable", event);

					// Inform draggable that the helper is in a valid drop zone,
					// used solely in the revert option to handle "valid/invalid".
					draggable.dropped = sortable.element;

					// Need to refreshPositions of all sortables in the case that
					// adding to one sortable changes the location of the other sortables (#9675)
					$.each(draggable.sortables, function () {
						this.refreshPositions();
					});

					// Hack so receive/update callbacks work (mostly)
					draggable.currentItem = draggable.element;
					sortable.fromOutside = draggable;
				}

				if (sortable.currentItem) {
					sortable._mouseDrag(event);

					// Copy the sortable's position because the draggable's can potentially reflect
					// a relative position, while sortable is always absolute, which the dragged
					// element has now become. (#8809)
					ui.position = sortable.position;
				}
			} else {

				// If it doesn't intersect with the sortable, and it intersected before,
				// we fake the drag stop of the sortable, but make sure it doesn't remove
				// the helper by using cancelHelperRemoval.
				if (sortable.isOver) {

					sortable.isOver = 0;
					sortable.cancelHelperRemoval = true;

					// Calling sortable's mouseStop would trigger a revert,
					// so revert must be temporarily false until after mouseStop is called.
					sortable.options._revert = sortable.options.revert;
					sortable.options.revert = false;

					sortable._trigger("out", event, sortable._uiHash(sortable));
					sortable._mouseStop(event, true);

					// Restore sortable behaviors that were modfied
					// when the draggable entered the sortable area (#9481)
					sortable.options.revert = sortable.options._revert;
					sortable.options.helper = sortable.options._helper;

					if (sortable.placeholder) {
						sortable.placeholder.remove();
					}

					// Restore and recalculate the draggable's offset considering the sortable
					// may have modified them in unexpected ways. (#8809, #10669)
					ui.helper.appendTo(draggable._parent);
					draggable._refreshOffsets(event);
					ui.position = draggable._generatePosition(event, true);

					draggable._trigger("fromSortable", event);

					// Inform draggable that the helper is no longer in a valid drop zone
					draggable.dropped = false;

					// Need to refreshPositions of all sortables just in case removing
					// from one sortable changes the location of other sortables (#9675)
					$.each(draggable.sortables, function () {
						this.refreshPositions();
					});
				}
			}
		});
	}
});

plugin.add("draggable", "cursor", {
	start: function (event, ui, instance) {
		var t = $("body"),
			o = instance.options;

		if (t.css("cursor")) {
			o._cursor = t.css("cursor");
		}
		t.css("cursor", o.cursor);
	},
	stop: function (event, ui, instance) {
		var o = instance.options;
		if (o._cursor) {
			$("body").css("cursor", o._cursor);
		}
	}
});

plugin.add("draggable", "opacity", {
	start: function (event, ui, instance) {
		var t = $(ui.helper),
			o = instance.options;
		if (t.css("opacity")) {
			o._opacity = t.css("opacity");
		}
		t.css("opacity", o.opacity);
	},
	stop: function (event, ui, instance) {
		var o = instance.options;
		if (o._opacity) {
			$(ui.helper).css("opacity", o._opacity);
		}
	}
});

plugin.add("draggable", "scroll", {
	start: function (event, ui, i) {
		if (!i.scrollParentNotHidden) {
			i.scrollParentNotHidden = i.helper.scrollParent(false);
		}

		if (i.scrollParentNotHidden[0] !== i.document[0] &&
			i.scrollParentNotHidden[0].tagName !== "HTML") {
			i.overflowOffset = i.scrollParentNotHidden.offset();
		}
	},
	drag: function (event, ui, i) {

		var o = i.options,
			scrolled = false,
			scrollParent = i.scrollParentNotHidden[0],
			document = i.document[0];

		if (scrollParent !== document && scrollParent.tagName !== "HTML") {
			if (!o.axis || o.axis !== "x") {
				if ((i.overflowOffset.top + scrollParent.offsetHeight) - event.pageY <
					o.scrollSensitivity) {
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
				} else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
				}
			}

			if (!o.axis || o.axis !== "y") {
				if ((i.overflowOffset.left + scrollParent.offsetWidth) - event.pageX <
					o.scrollSensitivity) {
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
				} else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
				}
			}

		} else {

			if (!o.axis || o.axis !== "x") {
				if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
				} else if ($(window).height() - (event.pageY - $(document).scrollTop()) <
					o.scrollSensitivity) {
					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
				}
			}

			if (!o.axis || o.axis !== "y") {
				if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
					scrolled = $(document).scrollLeft(
						$(document).scrollLeft() - o.scrollSpeed
					);
				} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) <
					o.scrollSensitivity) {
					scrolled = $(document).scrollLeft(
						$(document).scrollLeft() + o.scrollSpeed
					);
				}
			}

		}

		if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
			$.ui.ddmanager.prepareOffsets(i, event);
		}

	}
});

plugin.add("draggable", "snap", {
	start: function (event, ui, i) {

		var o = i.options;

		i.snapElements = [];

		$(o.snap.constructor !== String ? (o.snap.items || ":data(ui-draggable)") : o.snap)
			.each(function () {
				var $t = $(this),
					$o = $t.offset();
				if (this !== i.element[0]) {
					i.snapElements.push({
						item: this,
						width: $t.outerWidth(),
						height: $t.outerHeight(),
						top: $o.top,
						left: $o.left
					});
				}
			});

	},
	drag: function (event, ui, inst) {

		var ts, bs, ls, rs, l, r, t, b, i, first,
			o = inst.options,
			d = o.snapTolerance,
			x1 = ui.offset.left,
			x2 = x1 + inst.helperProportions.width,
			y1 = ui.offset.top,
			y2 = y1 + inst.helperProportions.height;

		for (i = inst.snapElements.length - 1; i >= 0; i--) {

			l = inst.snapElements[i].left - inst.margins.left;
			r = l + inst.snapElements[i].width;
			t = inst.snapElements[i].top - inst.margins.top;
			b = t + inst.snapElements[i].height;

			if (x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
				!$.contains(inst.snapElements[i].item.ownerDocument,
					inst.snapElements[i].item)) {
				if (inst.snapElements[i].snapping) {
					(inst.options.snap.release &&
						inst.options.snap.release.call(
							inst.element,
							event,
							$.extend(inst._uiHash(), {
								snapItem: inst.snapElements[i].item
							})
						));
				}
				inst.snapElements[i].snapping = false;
				continue;
			}

			if (o.snapMode !== "inner") {
				ts = Math.abs(t - y2) <= d;
				bs = Math.abs(b - y1) <= d;
				ls = Math.abs(l - x2) <= d;
				rs = Math.abs(r - x1) <= d;
				if (ts) {
					ui.position.top = inst._convertPositionTo("relative", {
						top: t - inst.helperProportions.height,
						left: 0
					}).top;
				}
				if (bs) {
					ui.position.top = inst._convertPositionTo("relative", {
						top: b,
						left: 0
					}).top;
				}
				if (ls) {
					ui.position.left = inst._convertPositionTo("relative", {
						top: 0,
						left: l - inst.helperProportions.width
					}).left;
				}
				if (rs) {
					ui.position.left = inst._convertPositionTo("relative", {
						top: 0,
						left: r
					}).left;
				}
			}

			first = (ts || bs || ls || rs);

			if (o.snapMode !== "outer") {
				ts = Math.abs(t - y1) <= d;
				bs = Math.abs(b - y2) <= d;
				ls = Math.abs(l - x1) <= d;
				rs = Math.abs(r - x2) <= d;
				if (ts) {
					ui.position.top = inst._convertPositionTo("relative", {
						top: t,
						left: 0
					}).top;
				}
				if (bs) {
					ui.position.top = inst._convertPositionTo("relative", {
						top: b - inst.helperProportions.height,
						left: 0
					}).top;
				}
				if (ls) {
					ui.position.left = inst._convertPositionTo("relative", {
						top: 0,
						left: l
					}).left;
				}
				if (rs) {
					ui.position.left = inst._convertPositionTo("relative", {
						top: 0,
						left: r - inst.helperProportions.width
					}).left;
				}
			}

			if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
				(inst.options.snap.snap &&
					inst.options.snap.snap.call(
						inst.element,
						event,
						$.extend(inst._uiHash(), {
							snapItem: inst.snapElements[i].item
						})));
			}
			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);

		}

	}
});

plugin.add("draggable", "stack", {
	start: function (event, ui, instance) {
		var min,
			o = instance.options,
			group = $.makeArray($(o.stack)).sort(function (a, b) {
				return (parseInt($(a).css("zIndex"), 10) || 0) -
					(parseInt($(b).css("zIndex"), 10) || 0);
			});

		if (!group.length) {
			return;
		}

		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
		$(group).each(function (i) {
			$(this).css("zIndex", min + i);
		});
		this.css("zIndex", (min + group.length));
	}
});

plugin.add("draggable", "zIndex", {
	start: function (event, ui, instance) {
		var t = $(ui.helper),
			o = instance.options;

		if (t.css("zIndex")) {
			o._zIndex = t.css("zIndex");
		}
		t.css("zIndex", o.zIndex);
	},
	stop: function (event, ui, instance) {
		var o = instance.options;

		if (o._zIndex) {
			$(ui.helper).css("zIndex", o._zIndex);
		}
	}
});

var draggable = $.ui.draggable;
export {
	draggable
};


text:
<resources>
    <style name="AppTheme" parent="@style/BaseTheme">
        <item name="android:windowTranslucentStatus">false</item>
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>


text:
<?php if($reviewId):?>
	<?php include_partial('sfReviewFront/preview', array(
		'reviewBox' => $reviewBox,
		'reviewType' => $reviewType,
		'reviewEntityId' => $reviewEntityId,
		'reviewValue' => $reviewValue,
		'review' => $review
	)) ?>
<?php else: ?>
	<?php include_partial(
		'sfReviewFront/init', array('reviewBox' => $reviewBox,
		'reviewTypeId' => $reviewType,
		'reviewEntityId' => $reviewEntityId
	)) ?>
<?php endif ?>


text:
import os
import sys
import time

import numpy as np
import mahotas

import glob
import h5py

execfile('full_image_cnn.py')
#from full_image_cnn import *

#param_path = 'D:/dev/Rhoana/membrane_cnn/results/resonance/'
#param_file = param_path + 'LGN1_MembraneSamples_65x65x1_mp0.50_train10000_valid2000_test2000_seed7.progress_anneal_rotmir_k[48, 48, 48, 48].h5'
#param_file = param_path + 'LGN1_MembraneSamples_95x95x1_mp0.50_train5000_valid1000_test1000_seed7.progress_anneal_rotmir_k[48, 48, 48, 48].h5'
#param_file = param_path + 'progress2/LGN1_MembraneSamples_31x31x1_mp0.50_train50000_valid5000_test5000_seed7_ds4.progress_anneal_rotmir_k[32, 32, 32]_baseLR0.001.h5'

#param_path = 'D:/dev/Rhoana/membrane_cnn/results/PC/'
#param_file = param_path + 'LGN1_MembraneSamples_65x65x1_mp0.50_train10000_valid2000_test2000_seed7.progress_anneal_rotmir_k[32, 32, 32, 32].h5.'
#param_file = param_path + 'LGN1_MembraneSamples_31x31x1_mp0.50_train50000_valid5000_test5000_seed7_ds4b.progress_anneal_rotmir_k[32, 32, 32]_baseLR0.004_v1.h5'
#param_file = param_path + 'lenet0_membrane_epoch_25100.h5'
#param_file = param_path + '5layer_params_large_epoch_285.h5'

#param_files = [param_file]

param_path = 'D:/dev/Rhoana/membrane_cnn/results/stumpin/'
param_files = glob.glob(param_path + "*.h5")
param_files = [x for x in param_files if x.find('.ot.h5') == -1]

for param_file in param_files:

    output_path = param_file.replace('.h5', '_stumpin')
    if not os.path.exists(output_path):
        os.makedirs(output_path)

    print 'Opening parameter file {0}.'.format(param_file)
    h5file = h5py.File(param_file, 'r')

    # Construct a blank network
    nlayers = h5file['/layers'][...]
    iterations = h5file['/iterations'][...]

    print "Loaded {0} layer network trained up to iteration {1}.".format(nlayers, iterations)

    all_layers = []
    stride_in = 1

    for layer in range(nlayers):

        layer_string = '/layer{0}/'.format(layer)
        layer_type = h5file[layer_string + 'type'][...]

        if layer_type == 'Convolution':

            layer_weights = h5file[layer_string + 'weights'][...]
            layer_bias = h5file[layer_string + 'bias'][...]
            layer_maxpoolsize = h5file[layer_string + 'maxpoolsize'][...]

            new_layer = ConvolutionMaxpoolLayer(
                layer_weights.shape[0], layer_weights.shape[1], layer_weights.shape[2],
                stride_in, layer_maxpoolsize, W=layer_weights, b=layer_bias)

        elif layer_type == 'FullyConnected':

            layer_weights = h5file[layer_string + 'weights'][...]
            layer_bias = h5file[layer_string + 'bias'][...]
            layer_ksize = h5file[layer_string + 'ksize'][...]

            new_layer = FullyConnectedLayer(
                layer_weights.shape[0] / (layer_ksize ** 2), layer_weights.shape[1], layer_ksize,
                stride_in, W=layer_weights, b=layer_bias)

        elif layer_type == 'LogisticRegression':

            layer_weights = h5file[layer_string + 'weights'][...]
            layer_bias = h5file[layer_string + 'bias'][...]

            new_layer = LogisticRegressionLayer(layer_weights.shape[0], layer_weights.shape[1],
                stride_in, W=layer_weights, b=layer_bias)

        else:
            raise Exception("Unknown layer type: {0}".format(layer_type))

        print new_layer.W.shape
        print 'layer {0} Wsum={1}.'.format(layer, np.sum(new_layer.W))

        all_layers.append(new_layer)

        stride_in = new_layer.stride_out

    h5file.close()

    # Calculate network footprint and therefore pad size
    footprint = 1
    for revlayer in range(1,nlayers):
        layer = nlayers - revlayer - 1
        if revlayer == 1:
            footprint = all_layers[layer].kernel_size
        else:
            footprint = footprint * all_layers[layer].maxpool_size - 1 + all_layers[layer].kernel_size

    pad_by = footprint // 2

    #image_path='D:/dev/datasets/isbi/train-input/train-input_0000.tif'
    #gold_image_path='D:/dev/datasets/isbi/train-labels/train-labels_0000.tif'

    image_path_format_string='D:/dev/datasets/LGN1/JoshProbabilities/2kSampAligned{0:04d}.tif'
    gold_image_path_format_string='D:/dev/datasets/LGN1/gold/lxVastExport_8+12+13/Segmentation1-LX_8-12_export_s{0:03d}.png'

    saturation_level = 0.005

    def normalize_image(original_image):
        sorted_image = np.sort( np.uint8(original_image).ravel() )
        minval = np.float32( sorted_image[ len(sorted_image) * ( saturation_level / 2 ) ] )
        maxval = np.float32( sorted_image[ len(sorted_image) * ( 1 - saturation_level / 2 ) ] )
        norm_image = np.float32(original_image - minval) * ( 255 / (maxval - minval))
        norm_image[norm_image < 0] = 0
        norm_image[norm_image > 255] = 255
        return np.uint8(255 - norm_image)

    def open_image_and_gold(image_index, crop_from, crop_size):
        path = image_path_format_string.format(image_index)
        gold_path = gold_image_path_format_string.format(image_index)

        # Open raw image
        image = np.float32(normalize_image(mahotas.imread(path)[crop_from[0]:crop_from[0]+crop_size,crop_from[1]:crop_from[1]+crop_size]))

        # Open gold standard image
        gold_image = mahotas.imread(gold_path)[crop_from[0]:crop_from[0]+crop_size,crop_from[1]:crop_from[1]+crop_size]

        # Convert to ids
        if len(gold_image.shape) == 3:
            gold_image = (np.uint32(gold_image[:,:,0]) * 2**16 + np.uint32(gold_image[:,:,1]) * 2**8 + np.uint32(gold_image[:,:,2])).squeeze()

        return (image, gold_image)

    def rotmir(image, mirror, rotate):
        if mirror == 1:
            image = image[::-1,:]

        if rotate == 1:
            image = image[::-1,:].T
        elif rotate == 2:
            image = image[::-1,:][:,::-1]
        elif rotate == 3:
            image = image.T[::-1,:]

        return image

    classify_start = 100
    classify_n = 1 #105

    crop_from = (512, 512)
    crop_size = 1024
    #crop_size = 512
    #crop_size = 256
    #crop_size = 128

    # def output_image (data, path, index, name):
    #     maxdata = np.max(data)
    #     mindata = np.min(data)
    #     normdata = (data - mindata) / (maxdata - mindata)
    #     mahotas.imsave(path + '/{0}_{1}.tif'.format(index, name), np.uint16(normdata * 65535))
    def output_image (data, layer, index, unpad_by, image_num=0, downsample=1):
        data = data[unpad_by:data.shape[0]-unpad_by,unpad_by:data.shape[1]-unpad_by]
        if downsample != 1:
            data = np.float32(mahotas.imresize(data, downsample))
        maxdata = np.max(data)
        mindata = np.min(data)
        normdata = (np.float32(data) - mindata) / (maxdata - mindata)
        mahotas.imsave(output_path + '/{0:04d}_classify_output_layer{1}_{2}.tif'.format(image_num, layer, index), np.uint16(normdata * 65535))

    # Main classification loop
    for image_index in range(classify_start, classify_start + classify_n):

        # Normalized training
        input_image, target_image = open_image_and_gold(image_index, crop_from, crop_size)

        # Direct pixel intensity training
        #input_image = np.float32(255-mahotas.imread(image_path_format_string.format(image_index))[crop_from[0]:crop_from[0]+crop_size,crop_from[1]:crop_from[1]+crop_size])

        downsample = 1
        if param_file.find('_ds2') != -1:
            downsample = 2
            input_image = np.float32(mahotas.imresize(input_image, 1.0/downsample))
        elif param_file.find('_ds4') != -1:
            downsample = 4
            input_image = np.float32(mahotas.imresize(input_image, 1.0/downsample))

        # Random rotate / mirror
        # mirror = np.random.choice(2)
        # rotate = np.random.choice(4)
        # input_image = rotmir(input_image, mirror, rotate)
        # target_image = rotmir(input_image, mirror, rotate)

        #Pad the image borders so we get a full image output and to avoid edge effects
        pad_image = np.pad(input_image, ((pad_by, pad_by), (pad_by, pad_by)), 'symmetric')
        layer0_in = pad_image.reshape(1, pad_image.shape[0], pad_image.shape[1])

        start_time = time.clock()

        #Classify image
        layer_output = []
        for layeri in range(len(all_layers)):
            if layeri == 0:
                layer_output.append(all_layers[layeri].apply_layer(layer0_in))
            else:
                layer_output.append(all_layers[layeri].apply_layer(layer_output[layeri-1]))

        end_time = time.clock()

        print('Classification complete.')
        print('Classification code ran for %.2fm' % ((end_time - start_time) / 60.))

        # # Crop to input image size
        # layer3_out = layer3_out[:,pad_by:-pad_by,pad_by:-pad_by]
        # output_image(input_image, output_path, image_index, 'input')
        # output_image(layer3_out[1,:,:], output_path, image_index, 'output')
        # output_image(target_image == 0, output_path, image_index, 'target')

        output_image(layer0_in[0,:,:], 99, 0, pad_by)
        # for layeri in range(len(layer_output)):
        #     for i in range(layer_output[layeri].shape[0]):
        #         output_image(layer_output[layeri][i,:,:], layeri, i, pad_by)
        #         if i == 20: break

        output_image(layer_output[-1][0,:,:], len(layer_output)+1, 0, pad_by, image_index, downsample)
        output_image(all_layers[-1].pre_softmax[0,:,:], len(layer_output), 0, pad_by, image_index, downsample)

        #print "Classification error before training: {0}".format(np.sum((layer3_out[1,:,:] - target_output[1,:,:])**2))

    print 'Classification of all images complete.'


text:
#import <QuartzCore/QuartzCore.h>

@interface WXLayer : CALayer

@end


text:
package freemind.view.mindmapview;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;

import freemind.main.FreeMind;
import freemind.main.Resources;
import freemind.main.Tools;

class RootMainView extends MainView {

	/*
	 * (non-Javadoc)
	 *
	 * @see freemind.view.mindmapview.NodeView.MainView#getPreferredSize()
	 */
	public Dimension getPreferredSize() {
		Dimension prefSize = super.getPreferredSize();
		prefSize.width *= 1.1;
		prefSize.height *= 2;
		return prefSize;
	}

	public void paint(Graphics graphics) {
		Graphics2D g = (Graphics2D) graphics;

		if (getNodeView().getModel() == null)
			return;

		Object renderingHint = getController().setEdgesRenderingHint(g);
		paintSelected(g);
		paintDragOver(g);

		// Draw a root node
		g.setColor(Color.gray);
		g.setStroke(new BasicStroke(1.0f));
		g.drawOval(0, 0, getWidth() - 1, getHeight() - 1);
		Tools.restoreAntialiasing(g, renderingHint);
		super.paint(g);
	}

	public void paintDragOver(Graphics2D graphics) {
		final int draggedOver = getDraggedOver();
		if (draggedOver == NodeView.DRAGGED_OVER_SON) {
			graphics.setPaint(new GradientPaint(getWidth() / 4, 0,
					getNodeView().getMap().getBackground(), getWidth() * 3 / 4,
					0, NodeView.dragColor));
			graphics.fillRect(getWidth() / 4, 0, getWidth() - 1,
					getHeight() - 1);
		} else if (draggedOver == NodeView.DRAGGED_OVER_SON_LEFT) {
			graphics.setPaint(new GradientPaint(getWidth() * 3 / 4, 0,
					getNodeView().getMap().getBackground(), getWidth() / 4, 0,
					NodeView.dragColor));
			graphics.fillRect(0, 0, getWidth() * 3 / 4, getHeight() - 1);
		}
	}

	public void paintSelected(Graphics2D graphics) {
		if (getNodeView().useSelectionColors()) {
			paintBackground(graphics, getNodeView().getSelectedColor());
		} else {
			paintBackground(graphics, getNodeView().getTextBackground());
		}
	}

	protected void paintBackground(Graphics2D graphics, Color color) {
		graphics.setColor(color);
		graphics.fillOval(1, 1, getWidth() - 2, getHeight() - 2);
	}

	Point getLeftPoint() {
		Point in = new Point(0, getHeight() / 2);
		return in;
	}

	Point getCenterPoint() {
		Point in = getLeftPoint();
		in.x = getWidth() / 2;
		return in;
	}

	Point getRightPoint() {
		Point in = getLeftPoint();
		in.x = getWidth() - 1;
		return in;
	}

	public void setDraggedOver(Point p) {
		setDraggedOver((dropPosition(p.getX())) ? NodeView.DRAGGED_OVER_SON_LEFT
				: NodeView.DRAGGED_OVER_SON);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see freemind.view.mindmapview.NodeView#getStyle()
	 */
	String getStyle() {
		return Resources.getInstance().getProperty(
				FreeMind.RESOURCES_ROOT_NODE_STYLE);
	}

	/**
	 * Returns the relative position of the Edge
	 */
	int getAlignment() {
		return NodeView.ALIGN_CENTER;
	}

	public int getTextWidth() {
		return super.getTextWidth() - getWidth() / 10;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see freemind.view.mindmapview.NodeView#getTextX()
	 */
	public int getTextX() {
		return getIconWidth() + getWidth() / 20;
	}

	public boolean dropAsSibling(double xCoord) {
		return false;
	}

	/** @return true if should be on the left, false otherwise. */
	public boolean dropPosition(double xCoord) {
		return xCoord < getSize().width * 1 / 2;
	}

}


text:
package ru.doublebyte.availabilitymonitor.managers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ru.doublebyte.availabilitymonitor.entities.Email;
import ru.doublebyte.availabilitymonitor.storages.EmailStorage;

import java.util.ArrayList;
import java.util.List;

public class EmailManager {

    private static final Logger logger = LoggerFactory.getLogger(EmailManager.class);

    private EmailStorage emailStorage;

    ///////////////////////////////////////////////////////////////////////////

    public EmailManager(EmailStorage emailStorage) {
        this.emailStorage = emailStorage;
    }

    ///////////////////////////////////////////////////////////////////////////

    /**
     * Get all existing emails
     * @return
     */
    public List<Email> getAll() {
        try {
            return emailStorage.getAll();
        } catch (Exception e) {
            logger.error("An error occurred while getting all emails", e);
            return new ArrayList<>();
        }
    }

    /**
     * Add new email
     * @param email
     * @return
     */
    public boolean add(Email email) {
        if (email.getAddress() == null || email.getAddress().isEmpty()) {
            logger.debug("Trying to save email with empty address");
            return false;
        }

        try {
            email = emailStorage.save(email);
            logger.info("Saved new email with id {}", email.getId());
        } catch (Exception e) {
            logger.error("An error occurred while saving new email", e);
            return false;
        }

        return true;
    }

    /**
     * Delete email
     * @param id
     * @return
     */
    public boolean delete(Long id) {
        try {
            emailStorage.delete(id);
            logger.info("Email with id {} deleted", id);
        } catch (Exception e) {
            logger.error("An error occurred while removing email with id " + id, e);
            return false;
        }
        return true;
    }

}


text:
//
//  XYGoddessViewController.m
//  PandaTVHome-iOS
//
//  Created by mofeini on 16/12/9.
//  Copyright © 2016年 com.test.demo. All rights reserved.
//

#import "XYGoddessViewController.h"
#import <WebViewJavascriptBridge.h>
#import "XYLiveRoomController.h"
#import "XYNetworkRequest.h"
#import "XYGoodessOfficial.h"
#import "XYLiveItem.h"

/**
 共同点: 每个url中最后都是roomid,通过截取roomid,拦截webView
 */

@interface XYGoddessViewController () <UIWebViewDelegate>

@property (nonatomic, weak) UIWebView *webView;
@property (nonatomic, copy) NSString *roomid;
@property (nonatomic, strong) XYGoodessOfficial *goodessOfficial; /// 女神官网直播数据
@end

@implementation XYGoddessViewController

- (UIWebView *)webView {
    if (_webView == nil) {

        UIWebView *webView = [[UIWebView alloc] init];
        [self.view addSubview:webView];
        _webView = webView;
        _webView.frame = self.view.bounds;
        /// webView滚动比较慢,所有设置为正常速度
        _webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
        _webView.delegate = self;
    }

    return _webView;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self setup];

}

- (void)viewDidDisappear:(BOOL)animated {

    [super viewDidDisappear:animated];

    if ([self.webView isLoading]) {

        [self.webView stopLoading];
    }

    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}

- (void)setup {

    self.view.backgroundColor = [UIColor redColor];
    self.title = @"女神";

    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:GoddessURLStr]];
    [self.webView loadRequest:request];

}

#pragma mark - Private Method

- (void)loadDataFromNetwork {

    /// 女神官网直播数据
    NSString *goodessOfficialStr = [NSString stringWithFormat:@"http://api.m.panda.tv/ajax_get_liveroom_baseinfo?roomid=%@&slaveflag=1&__version=2.1.3.1428&__plat=ios&__channel=appstore&pt_sign=7c041c06aad2cc2152f08d71a1202dbc&pt_time=1481816738", self.roomid];
    [[XYNetworkRequest shareInstance] request:XYNetworkRequestTypeGET url:goodessOfficialStr parameters:nil progress:nil finished:^(NSURLSessionDataTask *task, id responseObject, NSError *error) {
        if (error) {
            [self xy_showMessage:@"请求女神官网数据失败"];
            return;
        }

        if (responseObject[@"data"][@"info"] && [responseObject[@"data"][@"info"] isKindOfClass:[NSDictionary class]]) {

            self.goodessOfficial = [XYGoodessOfficial goodessOfficialWithDict:responseObject[@"data"][@"info"]];

            dispatch_async(dispatch_get_main_queue(), ^{

                /// 跳转到对应的直播间
                [self jumpToLiveRoom];
            });

        }

    }];
}

- (void)jumpToLiveRoom {

    /// 取出roomid是否等于女神官网直播的roomid
    if ([self.roomid isEqualToString:self.goodessOfficial.roominfo.roomid]) {

        XYLiveRoomController *liveRoomVc = [[XYLiveRoomController alloc] init];
        [self.navigationController pushViewController:liveRoomVc animated:YES];

        /// 将fileName转换为room_key
        XYLiveItem *liveItem = [[XYLiveItem alloc] init];
        liveItem.room_key = self.goodessOfficial.videoinfo.room_key;
        NSLog(@"%@", self.goodessOfficial.videoinfo.room_key);
        liveRoomVc.liveItem = liveItem;

    }

}

#pragma mark - UIWebViewDelegate
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {

    NSLog(@"%@", error.localizedDescription);
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
    NSString* errorString = [NSString stringWithFormat:@"错误: %@", error.localizedDescription];
    [webView loadHTMLString:errorString baseURL:nil];

}

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {

    NSString *urlStr = request.URL.absoluteString;

    NSLog(@"%@", urlStr);
    if ([urlStr containsString:@"roomid="]) {

        /// 截取roomid=后面的值
        NSArray *array = [urlStr componentsSeparatedByString:@"roomid="];
        self.roomid = [array.lastObject copy];

        /// 发送请求
        dispatch_async(dispatch_get_global_queue(0, 0), ^{

            [self loadDataFromNetwork];
        });

        return NO;
    } else {

        self.roomid = nil;
       return YES;
    }

}

- (void)webViewDidStartLoad:(UIWebView *)webView {

    /// 开始转菊花
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {

    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;

    /// 取消长按webView上的链接弹出actionSheet的问题:
    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout = 'none';"];

}

-(void)deleteCookieForDominPathStr:(NSString *)thePath
{
    //删除本地cookie,thePath为cookie路径通过打印cookie可知道其路径
    for(NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {

        if([[cookie domain] isEqualToString:thePath]) {

            [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];
        }
    }
}

@end


text:
import React from "react";

const headerItemStyle = {
  "padding-left": "30px"
};

export const Header = (props) => {
    return (

Home

RabbitMQ

Prometheus

Grafana

Github

    );
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Project Addiction</title>

    <link rel="stylesheet" type="text/css" th:href="@{/css/home.css}" />
    <link rel="stylesheet" type="text/css" th:href="@{/css/simple-sidebar.css}" />
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

                  Cadastro de Projetos

                <form class="form-horizontal" th:object="${project}" th:action="@{/project/save}" method="POST" style="margin: 10px">

                    <fieldset>

                                <input type="text" class="form-control input-sm" id="id" th:field="*{id}" readOnly="readonly"/>

                                Nome
                                <input type="text" class="form-control input-sm" th:field="*{name}" autofocus="autofocus" placeholder="Informe o nome" maxlength="50" required="required"/>

                                Descrição
                                <textarea rows="3" class="form-control input-sm" th:field="*{description}" maxlength="150" placeholder="Informe a descrição"></textarea>

                                Data
                                <input type="date" class="form-control input-sm" th:field="*{createdOn}"/>

                                Privado
                                <input type="checkbox" th:field="*{private}"/>

                    </fieldset>

                    <button type="submit" class="btn btn-sm btn-primary">Salvar</button>
                    Cancelar

                </form>


text:
{% extends "layout.html" %}

{% block page_title %}
  Apply for Employment and Support Allowance (ESA)
{% endblock %}

{% block proposition_header %}

{% endblock %}

{% block header_class %}

{% endblock %}

{% block content %}

  {% include "../includes/phase_banner_beta.html" %}

Home

Benefits

Carers and disability benefits

        {% if serviceName %} {{ serviceName }} {% endif %}

            1.
            Overview

            4.
            Apply

            2.
            Who can get ESA

            5.
            Changes you must tell us about

            3.
            What happens after you apply

2. Who can get ESA

You can get Employment and Support Allowance (ESA) if you have an illness or disability which affects your ability to work and:

are under state pension age - check your state pension age

are not getting Jobseeker's Allowance

have a fit note from your doctor for any period of illness after the first 7 days

are unemployed, self-employed, or work for an employer but can't get Statutory Sick Pay (SSP)

were getting SSP which has now stopped

are a student getting Disability Living Allowance or Personal Independence Payment

If you claim ESA, you could get National Insurance credits that count towards your State Pension.

Terminal illness

If you have a terminal illness and less than six months to live you still have to claim, but will get their money much faster.

Repeat claims

In most cases, if you have claimed ESA before and were found to be capable of doing some work, you will not be able to get ESA unless either:

your current condition has got a lot worse

you're claiming with a new condition

                Previous   Overview

                Next  What happens after you apply

{% endblock %}


text:
package visitor_1;

abstract class SportShoes{

   public abstract void accept(Visitor vis);
   public abstract double getPrice();
   public abstract String getDescription();
}


text:
package jsettlers.logic.map.loading.list;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import jsettlers.common.CommonConstants;
import jsettlers.common.utils.FileUtils;
import jsettlers.logic.map.loading.MapLoader;
import jsettlers.logic.map.loading.newmap.MapFileHeader;

/**
 * Lists all maps in a directory.
 *
 * @author michael
 *
 */
public class DirectoryMapLister implements IMapLister {

	private final File directory;

	public static class ListedMapFile implements IListedMap {
		private final File file;

		public ListedMapFile(File file) {
			this.file = file;
		}

		@Override
		public String getFileName() {
			return file.getName().replaceFirst(".*/", "");
		}

		@Override
		public InputStream getInputStream() throws FileNotFoundException {
			return new FileInputStream(file);
		}

		@Override
		public void delete() {
			file.delete();
		}

		@Override
		public boolean isCompressed() {
			return file.getName().endsWith(MapLoader.MAP_EXTENSION_COMPRESSED);
		}

		@Override
		public File getFile() {
			return file;
		}
	}

	public DirectoryMapLister(File directory, boolean createIfMissing) {
		this.directory = directory;
		if (createIfMissing && !directory.exists()) {
			directory.mkdirs();
		}
	}

	@Override
	public void listMaps(final IMapListerCallable callback) {
		if (directory == null || !directory.isDirectory() || directory.listFiles() == null) {
			return;
		}

		// traverse all files and sub-folders
		FileUtils.walkFileTree(directory, file -> {
			String fileName = file.getName();
			if (!file.isDirectory() && MapLoader.isExtensionKnown(fileName)) {
				callback.foundMap(new ListedMapFile(file));
			}
		});
	}

	@Override
	public OutputStream getOutputStream(MapFileHeader header) throws IOException {
		String name = header.getName().toLowerCase(Locale.ENGLISH).replaceAll("^\\W+|\\W+$", "").replaceAll("\\W+", "_");
		if (name.isEmpty()) {
			name = "map";
		}

		String sizePrefix;
		if (header.getWidth() == header.getHeight()) {
			sizePrefix = "" + header.getWidth();
		} else {
			sizePrefix = header.getWidth() + "x" + header.getHeight();
		}
		name = sizePrefix + "-" + header.getMaxPlayers() + "-" + name;

		Date date = header.getCreationDate();
		if (date != null) {
			SimpleDateFormat format = new SimpleDateFormat("-yyyy-MM-dd_HH-mm-ss", Locale.ENGLISH);
			name += format.format(date);
		}

		String mapFileExtension = MapList.getMapExtension();

		String actualName = name;
		File file = new File(directory, actualName + mapFileExtension);
		int i = 1;
		while (file.exists()) {
			actualName = name + "-" + i;
			file = new File(directory, actualName + mapFileExtension);
			i++;
		}

		if (!directory.exists()) {
			directory.mkdirs();
		}

		if (!directory.isDirectory()) {
			throw new IOException("maps directory does not exist.");
		}

		try {
			OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(file));

			if (CommonConstants.USE_SAVEGAME_COMPRESSION) {
				System.out.println("Using savegame compression!");
				ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream);
				ZipEntry zipEntry = new ZipEntry(actualName + MapLoader.MAP_EXTENSION);
				zipOutputStream.putNextEntry(zipEntry);

				return zipOutputStream;
			} else {
				System.out.println("No savegame compression!");
				return outputStream;
			}
		} catch (FileNotFoundException e) {
			throw new IOException(e);
		}
	}
}