text:
var util = require('util');
var events = require('events');
var async = require('async');
var when = require('when');
var com = require('serialport');
var SmartBuffer = require('smart-buffer');
var Serial = require('./serial');
var hex = require('hex');

function Device(devPath, baudrate) {
    events.EventEmitter.call(this);

    var thiz = this;

    this.serial = new Serial(devPath, {
        baudrate: baudrate,
        rtscts: false
    });

    this.serial.on('open', this.serialOnOpen.bind(this));
}

util.inherits(Device, events.EventEmitter);

Device.prototype.serialOnOpen = function() {
    var self = this;
    async.waterfall([
        function(callback) {
            self.serial.set({
                rts: true,
                dtr: false
            }, function(err, something) {
                console.log('DTR PULL DOWN (-3 --  12V), RESET');
                console.log('RTS PULL UP   (+3 -- +12V), BOOT TO BOOTLOADER');
                callback(err);
            });
        },

        function(callback) {
            setTimeout(function() {
                console.log('DELAY 100 MS');
                callback(null);
            }, 100);
        },

        function(callback) {
            self.serial.set({
                rts: true,
                dtr: true
            }, function(err, something) {
                console.log('DTR PULL UP   (+3 -- +12V), CLEAR RESET');
                console.log('RTS PULL DOWN');
                callback(null);
            });
        },

        function(callback) {
            setTimeout(function() {
                console.log('DELAY 100 MS');
                callback(null);
            }, 100);
        },

        function(callback) {
            console.log('CONNECTED, WRITE 0x7f');
            self.write(new Buffer([0x7f]))
                .then(function() {
                    self.read(1).then(function(data) {
                        if (data.readUInt8(0) === 0x79) {
                            callback(null);
                        } else {
                            callback('NACK');
                        }
                    })
                })
                .else(function() {
                    console.log('FAILED !!');
                });
        },

        function(callback) {
            setTimeout(function() {
                console.log('DELAY 100 MS');
                callback(null);
            }, 200);
        }
    ], function (err, serialPort) {
        if (err) {
            throw new Error(err);
        } else {
            self.emit('open');
        }
    });
}

Device.prototype.read = function(size) {
    var promise = function(resolve, reject, notify) {
        this.serial.read(size, function(err, data) {
            if (err) {
                reject(err);
            } else {
                resolve(data);
            }
        });
    };
    return when.promise(promise.bind(this));
}

Device.prototype.write = function(data) {
    var promise = function(resolve, reject, notify) {
        this.serial.write(data, function(err, results) {
            if (err) {
                reject(err);
            } else {
                resolve();
            }
        });
    };
    return when.promise(promise.bind(this));
}

Device.prototype.writeDataACK = function(data) {
    var device = this;
    return when.promise(function(resolve, reject, notify) {
        device.write(data).then(function() {
            device.read(1).then(function(data) {
                if (data.readUInt8(0) === 0x79) {
                    resolve();
                } else {
                    reject(new Error('NACK'));
                }
            });
        });
    });
}

Device.prototype.writeCommandACK = function(command) {
    var self = this;
    return when.promise(function(resolve, reject, notify) {
        var cmdbuf = new Buffer([command, ~command]);
        // console.log(cmdbuf, cmdbuf.length);
        self.write(cmdbuf).then(function() {
            // console.log('Write done');
            self.read(1).then(function(data) {
                // console.log('Read done: 0x%x'.format(data.readUInt8(0)));
                if (data.readUInt8(0) === 0x79) {
                    resolve();
                } else {
                    reject(new Error('NACK'));
                }
            });
        });
    });
}

Device.prototype.close = function() {
    var self = this;
    setTimeout(function() {
        self.serial.set({
            rts: false,
            dtr: true
        }, function(err, something) {
            self.serial.close();
        });
    }, 100);
}

Device.prototype.globalErase = function() {
    var device = this;
    return when.promise(function(resolve, reject, notify) {
        async.waterfall([
            function(callback) {
                // console.log('写入命令 0x43');
                device.writeCommandACK(0x43).then(function() {
                    callback(null);
                });
            },
            function(callback) {
                device.writeDataACK([0xff, 0x00]).then(function() {
                    callback(null);
                });
            }
        ], function(err) {
            if (err) {
                reject();
            } else {
                resolve();
            }
        });
    });
}

Device.prototype.writeMemory = function(address, data) {
    var device = this;
    return when.promise(function(resolve, reject, notify) {
        async.waterfall([
            // 写命令
            function(callback) {
                // console.log('写入命令 0x31');
                device.writeCommandACK(0x31).then(function() {
                    callback(null);
                });
            },
            // 写地址
            function(callback) {
                var addrbuf = new Buffer(5);
                addrbuf.writeUInt32BE(address, 0); // STM32.FLASHSTART
                var checksum = 0;
                for (var i = 0; i < 4; i++) {
                    checksum = checksum ^ addrbuf[i];
                }
                addrbuf.writeUInt8(checksum, 4);
                // console.log('写入地址');
                // hex(addrbuf);
                device.writeDataACK(addrbuf).then(function() {
                    callback(null);
                });
            },
            // 写数据
            function(callback) {
                var sb = new SmartBuffer();
                var n = data.length;
                sb.writeUInt8(n - 1);

                // number of bytes to write
                sb.writeBuffer(data);
                // sb.writeUInt8(0);

                var checksum = 0 ^ (n - 1);
                for (var i = 0; i < n; i++) {
                    checksum ^= data[i];
                }
                checksum ^= 0;

                sb.writeUInt8(checksum);
                var fbuf = sb.toBuffer();

                // console.log('实际 %d 字节, 写入 0x%x 地址 %d 字节'.format(n, address, fbuf.length));//, fbuf.toString('binary', 0, fbuf.length));
                // hex(fbuf);
                device.writeDataACK(fbuf).then(function() {
                    callback(null);
                });
            }
        ], function(err) {
            if (err) {
                reject();
            } else {
                resolve();
            }
        });
    });
}

Device.prototype.readMemory = function(address, size) {
    var device = this;
    return when.promise(function(resolve, reject, notify) {
        async.waterfall([
            // 写命令
            function(callback) {
                // console.log('写入命令 0x11');
                device.writeCommandACK(0x11).then(function() {
                    callback(null);
                });
            },
            // 写地址
            function(callback) {
                var addrbuf = new Buffer(5);
                addrbuf.writeUInt32BE(address, 0); // STM32.FLASHSTART
                var checksum = 0;
                for (var i = 0; i < 4; i++) {
                    checksum = checksum ^ addrbuf[i];
                }
                addrbuf.writeUInt8(checksum, 4);
                // console.log('写入地址');
                // hex(addrbuf);
                device.writeDataACK(addrbuf).then(function() {
                    callback(null);
                });
            },
            // 写数据
            function(callback) {
                var sb = new SmartBuffer();
                // number of bytes to read
                var n = size - 1;
                sb.writeUInt8(n);
                var checksum = 0;
                checksum = ~n & 0xff;
                sb.writeUInt8(checksum); // checksum
                var fbuf = sb.toBuffer();
                // console.log('从 0x%x 地址 读取 %d 字节'.format(address, size), "[%x %x]".format(n, checksum));
                device.writeDataACK(fbuf).then(function() {
                    callback(null);
                });
            },
            function(callback) {
                device.read(size).then(function(data) {
                    // hex(data);
                    callback(null, data);
                })
            }
        ], function(err, data) {
            if (err) {
                reject();
            } else {
                resolve(data);
            }
        });
    });
}

Device.prototype.go = function(address) {
    var device = this;
    return when.promise(function(resolve, reject, notify) {
        async.waterfall([
            // 写命令
            function(callback) {
                // console.log('写入命令 0x21');
                device.writeCommandACK(0x21).then(function() {
                    callback(null);
                });
            },
            // 写地址
            function(callback) {
                var addrbuf = new Buffer(5);
                addrbuf.writeUInt32BE(address, 0); // STM32.FLASHSTART
                var checksum = 0;
                for (var i = 0; i < 4; i++) {
                    checksum = checksum ^ addrbuf[i];
                }
                addrbuf.writeUInt8(checksum, 4);
                // console.log('跳转到 0x%x 地址执行'.format(address));
                // hex(addrbuf);
                device.writeDataACK(addrbuf).then(function() {
                    callback(null);
                });
            }
        ], function(err) {
            if (err) {
                reject();
            } else {
                resolve();
            }
        });
    });
}

module.exports = {
    open: function(devPath, baudrate) {
        return when.promise(function(resolve, reject, notify) {
            var device = new Device(devPath, baudrate);
            device.once('open', function() {
                resolve(device);
            });
        });
    }
}


text:
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE 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 CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************

using Windows.UI.Composition.Interactions;

namespace Microsoft.Toolkit.Uwp.UI.Animations.Expressions
{
    /// <summary>
    /// Class InteractionTrackerReferenceNode. This class cannot be inherited.
    /// </summary>
    /// <seealso cref="Microsoft.Toolkit.Uwp.UI.Animations.Expressions.ReferenceNode" />
    public sealed class InteractionTrackerReferenceNode : ReferenceNode
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="InteractionTrackerReferenceNode"/> class.
        /// </summary>
        /// <param name="paramName">Name of the parameter.</param>
        /// <param name="it">It.</param>
        internal InteractionTrackerReferenceNode(string paramName, InteractionTracker it = null)
            : base(paramName, it)
        {
        }

        /// <summary>
        /// Creates the target reference.
        /// </summary>
        /// <returns>InteractionTrackerReferenceNode.</returns>
        internal static InteractionTrackerReferenceNode CreateTargetReference()
        {
            var node = new InteractionTrackerReferenceNode(null);
            node.NodeType = ExpressionNodeType.TargetReference;

            return node;
        }

        /// <summary>
        /// Gets the is position rounding suggested.
        /// </summary>
        /// <value>The is position rounding suggested.</value>
        public BooleanNode IsPositionRoundingSuggested
        {
            get { return ReferenceProperty<BooleanNode>("IsPositionRoundingSuggested"); }
        }

        /// <summary>
        /// Gets the minimum scale.
        /// </summary>
        /// <value>The minimum scale.</value>
        public ScalarNode MinScale
        {
            get { return ReferenceProperty<ScalarNode>("MinScale"); }
        }

        /// <summary>
        /// Gets the maximum scale.
        /// </summary>
        /// <value>The maximum scale.</value>
        public ScalarNode MaxScale
        {
            get { return ReferenceProperty<ScalarNode>("MaxScale"); }
        }

        /// <summary>
        /// Gets the natural resting scale.
        /// </summary>
        /// <value>The natural resting scale.</value>
        public ScalarNode NaturalRestingScale
        {
            get { return ReferenceProperty<ScalarNode>("NaturalRestingScale"); }
        }

        /// <summary>
        /// Gets the scale.
        /// </summary>
        /// <value>The scale.</value>
        public ScalarNode Scale
        {
            get { return ReferenceProperty<ScalarNode>("Scale"); }
        }

        /// <summary>
        /// Gets the scale inertia decay rate.
        /// </summary>
        /// <value>The scale inertia decay rate.</value>
        public ScalarNode ScaleInertiaDecayRate
        {
            get { return ReferenceProperty<ScalarNode>("ScaleInertiaDecayRate"); }
        }

        /// <summary>
        /// Gets the scale velocity in percent per second.
        /// </summary>
        /// <value>The scale velocity in percent per second.</value>
        public ScalarNode ScaleVelocityInPercentPerSecond
        {
            get { return ReferenceProperty<ScalarNode>("ScaleVelocityInPercentPerSecond"); }
        }

        /// <summary>
        /// Gets the minimum position.
        /// </summary>
        /// <value>The minimum position.</value>
        public Vector3Node MinPosition
        {
            get { return ReferenceProperty<Vector3Node>("MinPosition"); }
        }

        /// <summary>
        /// Gets the maximum position.
        /// </summary>
        /// <value>The maximum position.</value>
        public Vector3Node MaxPosition
        {
            get { return ReferenceProperty<Vector3Node>("MaxPosition"); }
        }

        /// <summary>
        /// Gets the natural resting position.
        /// </summary>
        /// <value>The natural resting position.</value>
        public Vector3Node NaturalRestingPosition
        {
            get { return ReferenceProperty<Vector3Node>("NaturalRestingPosition"); }
        }

        /// <summary>
        /// Gets the position.
        /// </summary>
        /// <value>The position.</value>
        public Vector3Node Position
        {
            get { return ReferenceProperty<Vector3Node>("Position"); }
        }

        /// <summary>
        /// Gets the position inertia decay rate.
        /// </summary>
        /// <value>The position inertia decay rate.</value>
        public Vector3Node PositionInertiaDecayRate
        {
            get { return ReferenceProperty<Vector3Node>("PositionInertiaDecayRate"); }
        }

        /// <summary>
        /// Gets the position velocity in pixels per second.
        /// </summary>
        /// <value>The position velocity in pixels per second.</value>
        public Vector3Node PositionVelocityInPixelsPerSecond
        {
            get { return ReferenceProperty<Vector3Node>("PositionVelocityInPixelsPerSecond"); }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
require "spec_helper"

module Refinery
  module Users
    describe "password recovery" do
      let!(:user) { Factory(:refinery_user, :email => "refinery@refinerycms.com") }

      it "asks user to specify email address" do
        visit new_refinery_user_session_url
        click_link "I forgot my password"
        page.should have_content("Please enter the email address for your account.")
      end

      context "when existing email specified" do
        it "shows success message" do
          visit new_refinery_user_password_url
          fill_in "refinery_user_email", :with => user.email
          click_button "Reset password"
          page.should have_content("An email has been sent to you with a link to reset your password.")
        end
      end

      context "when non-existing email specified" do
        it "shows failure message" do
          visit new_refinery_user_password_url
          fill_in "refinery_user_email", :with => "none@refinerycms.com"
          click_button "Reset password"
          page.should have_content("Sorry, 'none@refinerycms.com' isn't associated with any accounts.")
          page.should have_content("Are you sure you typed the correct email address?")
        end
      end

      context "when good reset code" do
        before do
          user.reset_password_token = "refinerycms"
          user.save
        end

        it "allows to change password" do
          visit edit_refinery_user_password_url(:reset_password_token => user.reset_password_token)
          page.should have_content("Pick a new password for #{user.email}")

          fill_in "refinery_user_password", :with => "123456"
          fill_in "refinery_user_password_confirmation", :with => "123456"
          click_button "Reset password"

          page.should have_content("Password reset successfully for '#{user.email}'")
        end
      end

      context "when invalid reset code" do
        it "shows error message" do
          visit edit_refinery_user_password_url(:reset_password_token => "hmmm")
          page.should have_content("We're sorry, but this reset code has expired or is invalid.")
        end
      end
    end
  end
end


text:
<?php
namespace TYPO3\Fluid\ViewHelpers\Security;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Security\Account;
use TYPO3\Flow\Security\Context;
use TYPO3\Flow\Security\Policy\PolicyService;
use TYPO3\Fluid\Core\ViewHelper\AbstractConditionViewHelper;

/**
 * This view helper implements an ifHasRole/else condition.
 *
 * = Examples =
 *
 *
 * <f:security.ifHasRole role="Administrator">
 *   This is being shown in case you have the Administrator role (aka role) defined in the
 *   current package according to the controllerContext
 * </f:security.ifHasRole>
 *
 *
 *
 * <f:security.ifHasRole role="Administrator" packageKey="Acme.MyPackage">
 *   This is being shown in case you have the Acme.MyPackage:Administrator role (aka role).
 * </f:security.ifHasRole>
 *
 *
 *
 * <f:security.ifHasRole role="Acme.MyPackage:Administrator">
 *   This is being shown in case you have the Acme.MyPackage:Administrator role (aka role).
 * </f:security.ifHasRole>
 *
 *
 * Everything inside the <f:ifHasRole> tag is being displayed if you have the given role.
 *
 *
 * <f:security.ifHasRole role="Administrator">
 *   <f:then>
 *     This is being shown in case you have the role.
 *   </f:then>
 *   <f:else>
 *     This is being displayed in case you do not have the role.
 *   </f:else>
 * </f:security.ifHasRole>
 *
 *
 * Everything inside the "then" tag is displayed if you have the role.
 * Otherwise, everything inside the "else"-tag is displayed.
 *
 *
 * <f:security.ifHasRole role="{someRoleObject}">
 *   This is being shown in case you have the specified role
 * </f:security.ifHasRole>
 *
 *
 *
 * <f:security.ifHasRole role="Administrator" account="{otherAccount}">
 *   This is being shown in case "otherAccount" has the Acme.MyPackage:Administrator role (aka role).
 * </f:security.ifHasRole>
 *
 *
 *
 * @api
 */
class IfHasRoleViewHelper extends AbstractConditionViewHelper
{
    /**
     * @Flow\Inject
     * @var Context
     */
    protected $securityContext;

    /**
     * @Flow\Inject
     * @var PolicyService
     */
    protected $policyService;

    /**
     * renders <f:then> child if the role could be found in the security context,
     * otherwise renders <f:else> child.
     *
     * @param string $role The role or role identifier
     * @param string $packageKey PackageKey of the package defining the role
     * @param Account $account If specified, this subject of this check is the given Account instead of the currently authenticated account
     * @return string the rendered string
     * @api
     */
    public function render($role, $packageKey = null, Account $account = null)
    {
        if (is_string($role)) {
            $roleIdentifier = $role;

            if (in_array($roleIdentifier, array('Everybody', 'Anonymous', 'AuthenticatedUser'))) {
                $roleIdentifier = 'TYPO3.Flow:' . $roleIdentifier;
            }

            if (strpos($roleIdentifier, '.') === false && strpos($roleIdentifier, ':') === false) {
                if ($packageKey === null) {
                    $request = $this->controllerContext->getRequest();
                    $roleIdentifier = $request->getControllerPackageKey() . ':' . $roleIdentifier;
                } else {
                    $roleIdentifier = $packageKey . ':' . $roleIdentifier;
                }
            }

            $role = $this->policyService->getRole($roleIdentifier);
        }

        if ($account instanceof Account) {
            $hasRole = $account->hasRole($role);
        } else {
            $hasRole = $this->securityContext->hasRole($role->getIdentifier());
        }

        if ($hasRole) {
            return $this->renderThenChild();
        } else {
            return $this->renderElseChild();
        }
    }
}


text:
import os, sys, csv
import json, time, threading, argparse

proj_path = "/root/ops"
import_list = "/root/ops/data/qa_server.txt"

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ops.settings")
sys.path.append(proj_path)

os.chdir(proj_path)

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

from cmdb.models import *
def host_add(name, idc, mip, service_type, zone_type):
    Host.objects.create(name=name, idc=IDC.objects.get(name=idc), mip=mip, service_type=service_type, zone_type=zone_type)

def main():
    if os.path.exists(import_list):
        with open(import_list) as f:
            f_csv = csv.reader(f)
            headers = next(f_csv)
            for row in f_csv:
                if row[0].find('#') == -1:
                    #print row[0], row[1], row[2], row[3]
                    print "add host: ", row[0]
                    host_add(row[0], row[1], row[2], row[3], row[4])
    else:
        print "file: " + import_list + " is not exist!"

if __name__ == "__main__":
    main()

#############################################################################################################
#host_list = [ host.name for host in Host.objects.all() ]
#idc = IDC.objects.all()
#
#idc = IDC.objects.filter(name="SHW1")[0]
#idc = IDC.objects.filter(name="SLB1")[0]
#ss = Host.objects.create(idc=idc, name="bb", service_type="ngin")
#
#ss = Host(idc=idc[0], name="aa", service_type="nginx" )
#ss.save()
#
#qa-xxx-app02,SLB1,192.168.88.88,app


text:
'use strict';
const mongoose=require('mongoose');
const bluebird = require('bluebird');
const bcrypt = require('bcrypt-nodejs');
bluebird.promisifyAll(bcrypt);
const validate=require('../services/validate');
const ObjectId=mongoose.Schema.Types.ObjectId;
const DoneSchema = require('./done');

const UserSchema = module.exports = new mongoose.Schema({
  email: {
    type: String,
    maxlength: 50,
    validate: validate.emailValidator,
    unique: true,
    sparse: true
  },
  kennung: {
    type: String,
    maxlength: 6,
    unique: true,
    sparse: true
  },
  password: {
    type: String,
    select: false,
    required: true,
    minLength: 8
  },
  role: {
    type: String,
    required: true,
    default: 'user',
    enum: ['user','author']
  },
  profile: {
    nickname: String,
    age: Number,
    sex: {
      type: String,
      enum: ['male','female']
    },
    subject: String,
    reasons: [{
      type: String,
      enum: ['interesse','langeweile','klausur', 'author']
    }]
  },
  akzeptanz: {
    ratings: [{
      type: ObjectId,
      ref: 'rating'
    }],
    comments: [{
      type: ObjectId,
      ref: 'comment'
    }]
  },
  done: [DoneSchema],
  views: [{
    type: ObjectId,
    ref: 'views'
  }]
}, {timestamps: true});
UserSchema.pre('validate', function(cb){
  if(!this.email && !this.kennung){
    return cb(new Error('Neither email nor kennung are supplied'));
  }
  return cb();
});
UserSchema.pre('save',function(cb){
  const user = this;
  if(!user.isModified('password')){return cb();}
  bcrypt.hash(user.password,null,null,function(err,hash){
    if(err){return cb(err);}
    user.password = hash;
    return cb();
  });
});
UserSchema.methods.validatePassword=function(password){
  const user = this;
  return bcrypt.compareAsync(password,user.password);
};


text: an web application for students


text:
if ! TEMP="$(getopt -o vdm: --long docker-context-path: -n 'test-dockerfile' -- "$@")" ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"

docker_context_path=

while true; do
  case "$1" in
    -c | --docker-context-path ) docker_context_path="$2"; shift 2 ;;
    -- ) shift; break ;;
    * ) break ;;
  esac
done

echo "Linting Dockerfiles from $docker_context_path"
find "$docker_context_path" -type f -iname "Dockerfile" | while read -r line; do
  echo "Linting $line"
  docker run -v "$(pwd)":/mnt --rm -w="/mnt" lukasmartinelli/hadolint hadolint "$line"
  docker run -v "$(pwd)":/mnt --rm -w="/mnt" redcoolbeans/dockerlint "$line"
done

echo "Linting shell scripts from $docker_context_path"
find "$docker_context_path" -type f -iname "*.sh" | while read -r line; do
  echo "Linting $line"
  docker run -v "$(pwd)":/mnt --rm koalaman/shellcheck-alpine "$line"
done


text:
namespace ProjectManager.CLI.Core.Contracts
{
    public interface ILogger
    {
        void Log(string message);
    }
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>ChiFishing App</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="css/app.css"/>
  <link rel="stylesheet" href="boot/css/bootstrap.min.css"/>

view1

view2

Angular seed app: v


text:
package io.cumulus.models.fs

import play.api.libs.json.{Format, Json}

case class FsNodeIndex(
  path: String,
  nodeType: FsNodeType
)

object FsNodeIndex {

  implicit val format: Format[FsNodeIndex] =
    Json.format[FsNodeIndex]

}


text:
<!DOCTYPE html>

  <title>Search Snake</title>
  <link rel="stylesheet" href="/css/bootstrap.min.css">
  <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
  <link rel="stylesheet" href="/css/style.css">

Hello

Welcome to Snake Search

        By Martin Gingras

            <input type="radio" name="algorithmRadios" id="interactive" value="interactive" checked> Interactive

            <input type="radio" name="algorithmRadios" id="BFS" value="BFS"> Breadth First Search

            <input type="radio" name="algorithmRadios" id="DFS" value="DFS"> Depth First Search

            <input type="radio" name="algorithmRadios" id="aStar" value="aStar"> A* Search (Combined)

        Press the spacebar to start

        See it on github


text:
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// 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 com.google.devtools.build.skydoc.fakebuildapi.apple;

import com.google.devtools.build.lib.skylarkbuildapi.apple.DottedVersionApi;
import com.google.devtools.build.lib.syntax.Printer;

/**
 * Fake implementation of {@link DottedVersionApi}.
 */
public class FakeDottedVersion implements DottedVersionApi<FakeDottedVersion> {

  @Override
  public int compareTo_skylark(FakeDottedVersion other) {
    return 0;
  }

  @Override
  public void repr(Printer printer) {}

  @Override
  public int compareTo(FakeDottedVersion o) {
    return 0;
  }
}


text:
package gyn.jesus.anotations;

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

import javax.interceptor.InterceptorBinding;

@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE, ElementType.METHOD })
public @interface Transactional {

}


text:
<?php

namespace AppBundle\Filter\Common\Assignments;

use AppBundle;
use AppBundle\Filter\Common\Base\SimpleFilter;
use Symfony\Component\HttpFoundation\Request;

class BranchCategoryAssignmentFilter extends SimpleFilter {

	/**
	 *
	 * @var array
	 */
	protected $branches = array();

	/**
	 *
	 * @var array
	 */
	protected $categories = array();

	public function initRequestValues(Request $request) {
		parent::initRequestValues($request);

		$this->branches = $this->getRequestArray($request, 'branches');
		$this->categories = $this->getRequestArray($request, 'categories');
	}

	public function clearRequestValues() {
		parent::clearRequestValues();

		$this->branches = array();
		$this->categories = array();
	}

	public function getRequestValues() {
		$values = parent::getRequestValues();

		$this->setRequestArray($values, 'branches', $this->branches);
		$this->setRequestArray($values, 'categories', $this->categories);

		return $values;
	}

	public function setBranches($branches) {
		$this->branches = $branches;

		return $this;
	}

	public function getBranches() {
		return $this->branches;
	}

	public function setCategories($categories) {
		$this->categories = $categories;

		return $this;
	}

	public function getCategories() {
		return $this->categories;
	}
}


text:
Dompdf
======

[![Build Status](https://travis-ci.org/dompdf/dompdf.png?branch=develop)](https://travis-ci.org/dompdf/dompdf) [![Latest Stable Version](https://poser.pugx.org/dompdf/dompdf/v/stable.png)](https://packagist.org/packages/dompdf/dompdf) [![Total Downloads](https://poser.pugx.org/dompdf/dompdf/downloads.png)](https://packagist.org/packages/dompdf/dompdf) [![Latest Unstable Version](https://poser.pugx.org/dompdf/dompdf/v/unstable.png)](https://packagist.org/packages/dompdf/dompdf) [![License](https://poser.pugx.org/dompdf/dompdf/license.png)](https://packagist.org/packages/dompdf/dompdf)

**Dompdf is an HTML to PDF converter**.
At its heart, dompdf is (mostly) [CSS 2.1](http://www.w3.org/TR/CSS2/) compliant
HTML layout and rendering engine written in PHP. It is a style-driven renderer:
it will download and read external stylesheets, inline style tags, and the style
attributes of individual HTML elements. It also supports most presentational
HTML attributes.

----

**Check out the [demo](http://pxd.me/dompdf/www/examples.php) and ask any
question on [StackOverflow](http://stackoverflow.com/questions/tagged/dompdf) or
on the [Google Groups](http://groups.google.com/group/dompdf).**

Follow us on [![Twitter](http://twitter-badges.s3.amazonaws.com/twitter-a.png)](http://www.twitter.com/dompdf) or
[![Follow us on Google+](https://ssl.gstatic.com/images/icons/gplus-16.png)](https://plus.google.com/108710008521858993320?prsrc=3).

## Features

 * Handles most CSS 2.1 and a few CSS3 properties, including @import, @media &
   @page rules
 * Supports most presentational HTML 4.0 attributes
 * Supports external stylesheets, either local or through http/ftp (via
   fopen-wrappers)
 * Supports complex tables, including row & column spans, separate & collapsed
   border models, individual cell styling
 * Image support (gif, png (8, 24 and 32 bit with alpha channel), bmp & jpeg)
 * No dependencies on external PDF libraries, thanks to the R&OS PDF class
 * Inline PHP support

## Requirements

 * PHP version 5.3.0 or higher
 * DOM extension
 * GD extension

### Recommendations

 * MBString extension: provides internationalization support. Dompdf has limited
   internationalization support when this extension is not enabled.
 * OPcache (OPcache, XCache, APC, etc.): improves performance

Visit the wiki for more information:
https://github.com/dompdf/dompdf/wiki/Requirements

## About Fonts & Character Encoding

PDF documents internally support the following fonts: Helvetica, Times-Roman,
Courier, Zapf-Dingbats, & Symbol. These fonts only support Windows ANSI
encoding. In order for a PDF to display characters that are not available in
Windows ANSI you must supply an external font. Dompdf will embed any referenced
font in the PDF so long as it has been pre-loaded or is accessible to dompdf and
reference in CSS @font-face rules. See the
[font overview](https://github.com/dompdf/dompdf/wiki/About-Fonts-and-Character-Encoding)
for more information on how to use fonts.

The [DejaVu TrueType fonts](http://dejavu-fonts.org) have been pre-installed
to give dompdf decent Unicode character coverage by default. To use the DejaVu
fonts reference the font in your stylesheet, e.g. `body { font-family: DejaVu
Sans; }` (for DejaVu Sans). The following DejaVu 2.34 fonts are available:
DejaVu Sans, DejaVu Serif, and DejaVu Sans Mono.

## Easy Installation

### Install with composer

To install with Composer, simply add the requirement to your `composer.json`
file:

```json
{
  "require" : {
    "dompdf/dompdf" : "dev-master"
  }
}
```

And run Composer to update your dependencies:

```bash
$ curl -sS http://getcomposer.org/installer | php
$ php composer.phar update
```

Most Composer applications typically only require the Composer autoloader in order
to load all class files. Dompdf, however, still needs a bit of a kick-start by
including its own autoloder.

```php
// somewhere early in your project's loading, require the Composer autoloader
// see: http://getcomposer.org/doc/00-intro.md
require 'vendor/autoload.php';

// include dompdf's autoloader
require 'vendor/dompdf/dompdf/src/autoload.inc.php';
```

### Download and install

Download an archive of dompdf and extract it into the directory where dompdf
will reside
 * You can download stable copies of dompdf from
   https://github.com/dompdf/dompdf/releases
 * Or download a nightly (the latest, unreleased code) from
   http://eclecticgeek.com/dompdf

Add references to dompdf, libraries and helper functions in your PHP:

```php
// include autoloaders and helper functions
require_once 'dompdf/lib/html5lib/Parser.php';
require_once 'dompdf/lib/php-font-lib/src/FontLib/Autoloader.php';
require_once 'dompdf/src/functions.inc.php';
require_once 'dompdf/src/autoload.inc.php';
```

### Install with git

From the command line, switch to the directory where dompdf will reside and run
the following commands:

```sh
git clone https://github.com/dompdf/dompdf.git .
git clone https://github.com/PhenX/php-font-lib.git lib/php-font-lib
cd lib/php-font-lib
git checkout 0.3.1
```

Add references to dompdf, libraries and helper functions in your PHP:

```php
// include autoloaders and helper functions
require_once 'dompdf/lib/html5lib/Parser.php';
require_once 'dompdf/lib/php-font-lib/src/FontLib/Autoloader.php';
require_once 'dompdf/src/functions.inc.php';
require_once 'dompdf/src/autoload.inc.php';
```

## Quick Start

Just pass your HTML in to dompdf and stream the output:

```php
// reference the Dompdf namespace
use Dompdf\Dompdf;

// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml('hello world');

// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');

// Render the HTML as PDF
$dompdf->render();

// Get the generated PDF file contents
$pdf = $dompdf->output();

// Output the generated PDF to Browser
$dompdf->stream();
```

## Limitations (Known Issues)

 * Dompdf is not particularly tolerant to poorly-formed HTML input. To avoid
   any unexpected rendering issues you should either enable the built-in HTML5
   parser at runtime (`$dompdf->set_option('isHtml5ParserEnabled', true);`)
   or run your HTML through a HTML validator/cleaner (such as
   [Tidy](http://tidy.sourceforge.net) or the
   [W3C Markup Validation Service](http://validator.w3.org)).
 * Large files or large tables can take a while to render.
 * CSS float is in development and disabled by default but can be enabled at runtime
   (`$dompdf->set_option('isCssFloatEnabled', true);.

---

[![Donate button](https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif)](http://goo.gl/DSvWf)

*If you find this project useful, please consider making a donation. Any funds donated will be used to help further development on this project.)*


text:
package com.opengamma.financial.security;

import java.util.List;
import java.util.Set;

import com.google.common.collect.Sets;
import com.opengamma.financial.security.bond.BillSecurity;
import com.opengamma.financial.security.bond.CorporateBondSecurity;
import com.opengamma.financial.security.bond.FloatingRateNoteSecurity;
import com.opengamma.financial.security.bond.GovernmentBondSecurity;
import com.opengamma.financial.security.bond.InflationBondSecurity;
import com.opengamma.financial.security.cds.CreditDefaultSwapIndexSecurity;
import com.opengamma.financial.security.credit.IndexCDSSecurity;
import com.opengamma.financial.security.equity.EquitySecurity;
import com.opengamma.financial.security.future.AgricultureFutureSecurity;
import com.opengamma.financial.security.future.BondFutureDeliverable;
import com.opengamma.financial.security.future.BondFutureSecurity;
import com.opengamma.financial.security.future.EnergyFutureSecurity;
import com.opengamma.financial.security.future.EquityFutureSecurity;
import com.opengamma.financial.security.future.EquityIndexDividendFutureSecurity;
import com.opengamma.financial.security.future.FXFutureSecurity;
import com.opengamma.financial.security.future.FederalFundsFutureSecurity;
import com.opengamma.financial.security.future.IndexFutureSecurity;
import com.opengamma.financial.security.future.InterestRateFutureSecurity;
import com.opengamma.financial.security.future.MetalFutureSecurity;
import com.opengamma.financial.security.future.StockFutureSecurity;
import com.opengamma.financial.security.option.BondFutureOptionSecurity;
import com.opengamma.financial.security.option.CommodityFutureOptionSecurity;
import com.opengamma.financial.security.option.CreditDefaultSwapOptionSecurity;
import com.opengamma.financial.security.option.EquityIndexDividendFutureOptionSecurity;
import com.opengamma.financial.security.option.EquityIndexFutureOptionSecurity;
import com.opengamma.financial.security.option.EquityIndexOptionSecurity;
import com.opengamma.financial.security.option.EquityOptionSecurity;
import com.opengamma.financial.security.option.FxFutureOptionSecurity;
import com.opengamma.financial.security.option.IRFutureOptionSecurity;
import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;

/**
 * Vistor to find the underlying {@code ExternalId}.
 */
public final class UnderlyingExternalIdVisitor extends FinancialSecurityVisitorAdapter<Void> {

  /**
   * The collected set of underlying identifiers.
   */
  private final Set<ExternalIdBundle> _underlyings = Sets.newHashSet();

  /**
   * Creates an instance
   */
  public UnderlyingExternalIdVisitor() {
  }

  //-------------------------------------------------------------------------
  /**
   * Gets the set of underlying identifiers that were found.
   *
   * @return the underlying identifiers, not null
   */
  public Set<ExternalIdBundle> getUnderlyings() {
    return _underlyings;
  }

  //-------------------------------------------------------------------------
  @Override
  public Void visitEquitySecurity(final EquitySecurity security) {
    return null;
  }

  @Override
  public Void visitBillSecurity(final BillSecurity security) {
    return null;
  }

  @Override
  public Void visitGovernmentBondSecurity(final GovernmentBondSecurity security) {
    return null;
  }

  @Override
  public Void visitCorporateBondSecurity(final CorporateBondSecurity security) {
    return null;
  }

  @Override
  public Void visitInflationBondSecurity(final InflationBondSecurity security) {
    return null;
  }

  @Override
  public Void visitAgricultureFutureSecurity(final AgricultureFutureSecurity security) {
    return null;
  }

  @Override
  public Void visitBondFutureSecurity(final BondFutureSecurity security) {
    final List<BondFutureDeliverable> basketList = security.getBasket();
    for (final BondFutureDeliverable deliverable : basketList) {
      final ExternalIdBundle identifiers = deliverable.getIdentifiers();
      if (identifiers != null) {
        _underlyings.add(identifiers);
      }
    }
    return null;
  }

  @Override
  public Void visitEnergyFutureSecurity(final EnergyFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitFXFutureSecurity(final FXFutureSecurity security) {
    return null;
  }

  @Override
  public Void visitIndexFutureSecurity(final IndexFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitInterestRateFutureSecurity(final InterestRateFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitMetalFutureSecurity(final MetalFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitStockFutureSecurity(final StockFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitEquityFutureSecurity(final EquityFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitEquityIndexDividendFutureSecurity(final EquityIndexDividendFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitEquityOptionSecurity(final EquityOptionSecurity equityOptionSecurity) {
    final ExternalId identifier = equityOptionSecurity.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitEquityIndexOptionSecurity(final EquityIndexOptionSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitIRFutureOptionSecurity(final IRFutureOptionSecurity security) {
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    if (underlyingIdentifier != null) {
      _underlyings.add(ExternalIdBundle.of(underlyingIdentifier));
    }
    return null;
  }

  @Override
  public Void visitEquityIndexFutureOptionSecurity(final EquityIndexFutureOptionSecurity security) {
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    if (underlyingIdentifier != null) {
      _underlyings.add(ExternalIdBundle.of(underlyingIdentifier));
    }
    return null;
  }

  @Override
  public Void visitEquityIndexDividendFutureOptionSecurity(final EquityIndexDividendFutureOptionSecurity security) {
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    if (underlyingIdentifier != null) {
      _underlyings.add(ExternalIdBundle.of(underlyingIdentifier));
    }
    return null;
  }

  @Override
  public Void visitCommodityFutureOptionSecurity(final CommodityFutureOptionSecurity security) {
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    if (underlyingIdentifier != null) {
      _underlyings.add(ExternalIdBundle.of(underlyingIdentifier));
    }
    return null;
  }

  @Override
  public Void visitFxFutureOptionSecurity(final FxFutureOptionSecurity security) {
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    if (underlyingIdentifier != null) {
      _underlyings.add(ExternalIdBundle.of(underlyingIdentifier));
    }
    return null;
  }

  @Override
  public Void visitBondFutureOptionSecurity(final BondFutureOptionSecurity security) {
    final ExternalId underlyingIdentifier = security.getUnderlyingId();
    if (underlyingIdentifier != null) {
      _underlyings.add(ExternalIdBundle.of(underlyingIdentifier));
    }
    return null;
  }

  @Override
  public Void visitFederalFundsFutureSecurity(final FederalFundsFutureSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitCreditDefaultSwapIndexSecurity(final CreditDefaultSwapIndexSecurity security) {
    final ExternalId identifier = security.getReferenceEntity();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitCreditDefaultSwapOptionSecurity(final CreditDefaultSwapOptionSecurity security) {
    final ExternalId identifier = security.getUnderlyingId();
    if (identifier != null) {
      _underlyings.add(ExternalIdBundle.of(identifier));
    }
    return null;
  }

  @Override
  public Void visitFloatingRateNoteSecurity(final FloatingRateNoteSecurity security) {
    return null; //TODO the index?
  }

  @Override
  public Void visitIndexCDSSecurity(final IndexCDSSecurity security) {
    final ExternalIdBundle identifier = security.getUnderlyingIndex().resolve().getExternalIdBundle();
    if (identifier != null) {
      _underlyings.add(identifier);
    }
    return null;
  }
}


text:
import subprocess

class SlicePrinter (object):
  "Print a VelocyPack Slice prettily."

  def __init__ (self, val):
    self.val = val

  def readUInt(self, raw, size):
    x = 0
    shift = 0
    i = 0
    if size > 0:
      while i < size:
        x += int(raw[i]) << shift
        shift += 8
        i += 1
      return x
    else:
      size = -size
      while i < size:
        x += int(raw[size-i]) << shift
        shift += 8
        i += 1
      return x

  def readVarUInt(self, raw, forwards):
    r = 0
    s = 0
    while True:
      i = int(raw[0])
      r |= ((i & 0x7f) << s)
      s += 7
      if forwards:
        raw += 1
      else:
        raw -= 1
      if i & 0x80 == 0:
        return r

  def findByteLength(self, raw):
    # Raw must be a Value of type uint8_t* pointing to a vpack value
    # This finds the length of the vpack value
    typeByte = int(raw[0])
    if typeByte == 0x00:     # None
      return 0
    if typeByte == 0x01:     # empty array
      return 1
    if typeByte == 0x0a:     # empty object
      return 1
    if typeByte >= 0x02 and typeByte <= 0x05:  # array equal length subobjs
      return self.readUInt(raw+1, typeByte - 0x01)
    if typeByte >= 0x06 and typeByte <= 0x09:  # array
      return self.readUInt(raw+1, typeByte - 0x05)
    if typeByte >= 0x0b and typeByte <= 0x0e:  # object
      return self.readUInt(raw+1, typeByte - 0x0a)
    if typeByte >= 0x13 and typeByte <= 0x14:  # compact array or object
      return self.readVarUInt(raw+1, True)
    if typeByte >= 0x0f and typeByte <= 0x12:  # unused
      return 1
    if typeByte == 0x17:   # illegal
      return 1
    if typeByte >= 0x18 and typeByte <= 0x1a:
      return 1
    if typeByte == 0x1b:   # double
      return 9
    if typeByte == 0x1c:   # UTC-date
      return 9
    if typeByte == 0x1d:   # external
      return 0
    if typeByte >= 0x1e and typeByte <= 0x1f:  # minKey, maxKey
      return 1
    if typeByte >= 0x20 and typeByte <= 0x27:  # int
      return 1 + typeByte - 0x1f
    if typeByte >= 0x28 and typeByte <= 0x2f:  # uint
      return 1 + typeByte - 0x27
    if typeByte >= 0x30 and typeByte <= 0x3f:  # small int
      return 1
    if typeByte >= 0x40 and typeByte <= 0xbe:  # short string
      return 1 + typeByte - 0x40
    if typeByte == 0xbf:                       # long string
      return 9 + self.readUInt(raw+1, 8)
    if typeByte >= 0xc0 and typeByte <= 0xc7:  # binary blob
      return 1 + typeByte - 0xbf + self.readUInt(raw+1, typeByte - 0xbf)
    if typeByte >= 0xc8 and typeByte <= 0xcf:  # positive BCD integer
      return 1 + typeByte - 0xc7 + 4 + self.readUInt(raw+1, typeByte - 0xc7)
    if typeByte >= 0xd0 and typeByte <= 0xd7:  # negative BCD integer
      return 1 + typeByte - 0xcf + 4 + self.readUInt(raw+1, typeByte - 0xcf)
    if typeByte >= 0xd8 and typeByte <= 0xef:  # reserved
      return 1
    if typeByte == 0xf0:   # Custom types
      return 1
    if typeByte == 0xf1:
      return 2
    if typeByte == 0xf2:
      return 4
    if typeByte == 0xf3:
      return 8
    if typeByte >= 0xf4 and typeByte <= 0xf6:
      return 2 + self.readUInt(raw + 1, 1)
    if typeByte >= 0xf7 and typeByte <= 0xf9:
      return 2 + self.readUInt(raw + 1, 2)
    if typeByte >= 0xfa and typeByte <= 0xfc:
      return 2 + self.readUInt(raw + 1, 4)
    if typeByte >= 0xfd and typeByte <= 0xff:
      return 2 + self.readUInt(raw + 1, 8)
    return 4712

  def to_string(self):
    vpack = self.val["_start"]    # uint8_t*
    length = self.findByteLength(vpack)
    if length == 0:
      return "External" if int(vpack[0]) == 0x1d else "NoneSlice"
    b = bytearray(length)
    for i in range(0, length):
      b[i] = int(vpack[i])
    p = subprocess.Popen(["arangovpack", "--print-non-json"],
                                         stdin=subprocess.PIPE,
                                         stdout=subprocess.PIPE)
    s, e = p.communicate(b)
    return s.decode("utf-8")

def str_lookup_function(val):
  lookup_type = val.type
  if lookup_type.tag == "arangodb::velocypack::Slice" or \
     lookup_type == "arangodb::velocypack::Slice":
    return SlicePrinter(val)
  if str(lookup_type).find("velocypack::Slice") >= 0 or \
     str(lookup_type).find("VPackSlice") >= 0:
    return SlicePrinter(val)
  return None

gdb.pretty_printers.append(str_lookup_function)


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@mipmap/ios_thumb_disable" android:state_enabled="false"/>
    <item android:drawable="@mipmap/ios_thumb"/>
</selector>


text:
package lv.ctco.cukes.http.matchers;

import io.restassured.response.Response;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeDiagnosingMatcher;

import static java.lang.String.format;

public class StatusCodeMatcher extends TypeSafeDiagnosingMatcher<Integer> {

    private final Integer expectedStatusCode;
    private final Response response;
    private final boolean appendBody;
    private final Integer maxSize;

    public StatusCodeMatcher(Integer expectedStatusCode, Response response, boolean appendBody, Integer maxSize) {
        this.expectedStatusCode = expectedStatusCode;
        this.response = response;
        this.appendBody = appendBody;
        this.maxSize = maxSize;
    }

    @Override
    protected boolean matchesSafely(Integer statusCode, Description description) {
        description.appendText(format("was \"%d\"", statusCode));

        if (appendBody) {
            final String body = response.body().asString();
            final int size = body.length();

            if (response.getContentType().equals("application/octet-stream")) {
                description.appendText(" with body <binary>");
            } else if (maxSize != null && size > maxSize) {
                description.appendText(" with body <exceeding max size to show>");
            } else {
                description.appendText(format(" with body:\n\"\"\"\n%s\n\"\"\"", body));
            }
        }

        return expectedStatusCode.equals(statusCode);
    }

    @Override
    public void describeTo(Description description) {
        description.appendText(format("\"%d\"", expectedStatusCode));
    }
}


text:
package adf.util.compatibility.provider;

import adf.util.compatibility.RouteSearcher;

public interface RouteSearcherProvider {

    public RouteSearcher getRouteSearcher();
}


text:
This page strategy is a slight variant on html5hbbtvhybrid in that it will call the app.show() if it exists.
This is all temp stuff.


text:
import pytest
import fiona
from fiona.drvsupport import supported_drivers, _driver_supports_mode
from fiona.errors import DriverError
from .conftest import driver_extensions
from fiona.env import GDALVersion

def test_bounds_point():
    g = {'type': 'Point', 'coordinates': [10, 10]}
    assert fiona.bounds(g) == (10, 10, 10, 10)

def test_bounds_line():
    g = {'type': 'LineString', 'coordinates': [[0, 0], [10, 10]]}
    assert fiona.bounds(g) == (0, 0, 10, 10)

def test_bounds_polygon():
    g = {'type': 'Polygon', 'coordinates': [[[0, 0], [10, 10], [10, 0]]]}
    assert fiona.bounds(g) == (0, 0, 10, 10)

def test_bounds_z():
    g = {'type': 'Point', 'coordinates': [10, 10, 10]}
    assert fiona.bounds(g) == (10, 10, 10, 10)

ignore_write_drivers = set(['CSV', 'GPX', 'GPSTrackMaker', 'DXF', 'DGN', 'MapInfo File'])
write_drivers = [driver for driver, raw in supported_drivers.items() if _driver_supports_mode(driver, 'w') and driver not in ignore_write_drivers]

@pytest.mark.parametrize('driver', write_drivers)
def test_bounds(tmpdir, driver):
    """Test if bounds are correctly calculated after writing

    """
    if driver == 'BNA' and GDALVersion.runtime() < GDALVersion(2, 0):
        # BNA driver segfaults with gdal 1.11
        return

    extension = driver_extensions.get(driver, "bar")
    path = str(tmpdir.join('foo.{}'.format(extension)))

    with fiona.open(path, 'w',
                    driver=driver,
                    schema={'geometry': 'Point',
                            'properties': [('title', 'str')]},
                    fiona_force_driver=True) as c:

        c.writerecords([{'geometry': {'type': 'Point', 'coordinates': (1.0, 10.0)}, 'properties': {'title': 'One'}}])

        try:
            bounds = c.bounds
            assert bounds == (1.0, 10.0, 1.0, 10.0)
        except Exception as e:
            assert isinstance(e, DriverError)

        c.writerecords([{'geometry': {'type': 'Point', 'coordinates': (2.0, 20.0)}, 'properties': {'title': 'Two'}}])

        try:
            bounds = c.bounds
            assert bounds == (1.0, 10.0, 2.0, 20.0)
        except Exception as e:
            assert isinstance(e, DriverError)


text:
package esilatest

/*
Requested page does not exist */
type GetCharactersCharacterIdAssetsNotFound struct {
	/*
	 error message */
	Error_ string `json:"error,omitempty"`
}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<title>infografies de la realitat*: PAGETITLE</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="keywords" content="Informació classe treballadora">
		<meta name="author" content="Comunistes de Catalunya">

		<meta name="geo.region" content="Catalunya">
		<meta name="geo.placename" content="Barcelona">
		<meta name="geo.position" content="41.426812;2.234972">
		<meta name="ICBM" content="41.426812;2.234972">

		<meta name="twitter:card" content="summary">
		<meta name="twitter:site" content="@larealitat">
		<meta name="twitter:title" content="PAGETITLE">
		<meta name="twitter:description" content="pagedescription">
		<meta name="twitter:image" content="http://codi.realitat.cat/src/png/iconrealitat.jpg" />

		<link href="http://codi.realitat.cat/src/css/styles.css" rel="stylesheet" media="screen">
		<link href="http://codi.realitat.cat/src/css/anime.css" rel="stylesheet" media="screen">
		<link href="http://codi.realitat.cat/src/css/realskin.css" rel="stylesheet" media="screen">

		<link href="http://codi.realitat.cat/src/css/print.css" rel="stylesheet" media="print">

		<link href="http://codi.realitat.cat/src/css/noscript.css" rel="stylesheet" media="screen">

		<link rel="alternate" type="application/rss+xml" title="rss" href="http://bloc.realitat.cat/feeds/posts/default">

		<link rel="apple-touch-icon" sizes="180x180" href="http://codi.realitat.cat/src/ics/apple-touch-icon.png">
		<link rel="icon" type="image/png" sizes="32x32" href="http://codi.realitat.cat/src/ics/favicon-32x32.png">
		<link rel="icon" type="image/png" sizes="16x16" href="http://codi.realitat.cat/src/ics/favicon-16x16.png">
		<link rel="manifest" href="http://codi.realitat.cat/src/ics/manifest.json">
		<link rel="mask-icon" href="http://codi.realitat.cat/src/ics/safari-pinned-tab.svg" color="#dd0000">
		<link rel="shortcut icon" href="http://codi.realitat.cat/src/ics/favicon.ico">
		<meta name="apple-mobile-web-app-title" content="realitat*">
		<meta name="application-name" content="realitat*">
		<meta name="msapplication-config" content="http://codi.realitat.cat/src/ics/browserconfig.xml">
		<meta name="theme-color" content="#ffffff">

				<input class="toggletrigger" type="checkbox" id="mob-nav" name="mob-nav" aria-hidden="true" hidden>
				Menú

					realitat*
					Articles
					Notícies
					Publicacions
					Les Arrels
					Sobre nosaltres
					<form class="form-search" action="http://www.google.com/cse">
						<input type="hidden" name="cx" value="007620493827235173837:p9bytcfv9gu">
						<input type="text" name="q" class="terms squared" placeholder="cerca">
						<input type="submit" name="sa" class="search" value="·">
					</form>

PAGETITLE

				realitat* /
				Articles /
				<Blogger>PAGETITLE</Blogger>

www.realitat.cat

Articles

Notícies

Publicacions

les Arrels

Sobre nosaltres

						@larealitat a:
						Twitter |
						Facebook |
						Google + |
						Telegram

						Informa'ns:
						de Convocatòries |
						de Notícies

edita

Comunistes de Catalunya

Les coses són senceres allò que aparenten, i darrera d'elles... no hi ha res.

					Jean-Paul Sartre

					 2015 Comunistes de Catalunya
					(By-nc-sa)
					<adress>carrer Liuva, 39-45, Barcelona</adress> | (0034) 93 318 42 82
					info@realitat.cat
					 Dipòsit legal: B-46492-88
					Avís legal
					Codi font

				X

Col·labora!

					Formulari de Contacte

Contacta amb la redacció de la realitat*

					Formulari de Convocatòries

Fes-nos arribar convocatòries d'actes i mobilitzacions

					Formulari de Notícies

Informa'ns d'allò que passa al teu voltant

ajuda'ns a conèixer i transformar la realitat*


text:
<?php
namespace app\models;
class Words extends \lithium\data\Model {

}
?>


text:
package au.org.aurin.wif.restclient;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.springframework.web.client.HttpClientErrorException;
import org.testng.Assert;
import org.testng.annotations.Test;

import au.org.aurin.wif.config.IntegrationTestConfig;
import au.org.aurin.wif.io.SslUtil;
import au.org.aurin.wif.model.allocation.AllocationLU;
import au.org.aurin.wif.svc.WifKeys;

/**
 * The Class AllocationLUServiceRestIT.
 */
@ContextConfiguration(locations = { "/test-integration-client-context.xml" })
public class AllocationLUServiceRestIT extends AbstractTestNGSpringContextTests {

  /** The allocation lu service client. */
  @Autowired
  private AllocationLUServiceClient allocationLUServiceClient;

  /** The project service client. */
  @Autowired
  private ProjectServiceClient projectServiceClient;

  /** The allocation lu id. */
  private String allocationLUId;

  /** The role id. */
  private final String roleId = WifKeys.TEST_ROLE_ID;

  /** The integration test config. */
  @Resource
  private IntegrationTestConfig integrationTestConfig;

  /** The allocation lu label. */
  private final String allocationLULabel = "allocationLUTest"
      + System.currentTimeMillis();

  /** The wif project id. */
  String wifProjectId = WifKeys.TEST_PROJECT_ID;

  /**
   * Creates the allocation lu.
   *
   * @throws Exception
   *           the exception
   */
  @Test(enabled = false, groups = { "restclienttest", "rolerest", "projectrest" })
  public void createAllocationLU() throws Exception {
    SslUtil.trustSelfSignedSSL();
    final AllocationLU allocationLU = new AllocationLU();
    allocationLU.setLabel(allocationLULabel);
    allocationLU.setFeatureFieldName("name");

    allocationLUId = allocationLUServiceClient.createAllocationLU(roleId,
        wifProjectId, allocationLU);
    Assert.assertNotNull(allocationLUId);
  }

  /**
   * Gets the allocation lu.
   *
   * @return the allocation lu
   * @throws Exception
   *           the exception
   */
  @Test(enabled = false, groups = { "restclienttest", "rolerest", "projectrest" }, dependsOnMethods = { "createAllocationLU" })
  public void getAllocationLU() throws Exception {
    final AllocationLU allocationLU = allocationLUServiceClient
        .getAllocationLU(roleId, wifProjectId, allocationLUId);
    Assert.assertEquals(allocationLU.getLabel(), allocationLULabel);
  }

  /**
   * Update allocation lu.
   *
   * @throws Exception
   *           the exception
   */
  @Test(enabled = false, groups = { "restclienttest", "rolerest", "projectrest" }, dependsOnMethods = { "getAllocationLU" })
  public void updateAllocationLU() throws Exception {
    final AllocationLU allocationLU = allocationLUServiceClient
        .getAllocationLU(roleId, wifProjectId, allocationLUId);
    allocationLU.setLabel("allocationLU REST test");
    allocationLUServiceClient.updateAllocationLU(roleId, wifProjectId,
        allocationLUId, allocationLU);

    final AllocationLU tmp = allocationLUServiceClient.getAllocationLU(roleId,
        wifProjectId, allocationLUId);
    Assert.assertEquals(tmp.getLabel(), "allocationLU REST test");
  }

  /**
   * Gets the allocation l us for project.
   *
   * @return the allocation l us for project
   * @throws Exception
   *           the exception
   */
  @Test(enabled = false, groups = { "restclienttest", "rolerest", "projectrest" }, dependsOnMethods = "updateAllocationLU")
  public void getAllocationLUsForProject() throws Exception {
    final List<AllocationLU> list = allocationLUServiceClient
        .getAllocationLUsForProject(roleId, wifProjectId);
    Assert.assertNotEquals(list.size(), 15);
  }

  /**
   * Delete allocation lu.
   *
   * @throws Exception
   *           the exception
   */
  @Test(enabled = false, groups = { "restclienttest", "rolerest", "projectrest" }, dependsOnMethods = { "getAllocationLUsForProject" }, expectedExceptions = HttpClientErrorException.class)
  public void deleteAllocationLU() throws Exception {
    allocationLUServiceClient.deleteAllocationLU(roleId, wifProjectId,
        allocationLUId);
    Assert.assertNull(allocationLUServiceClient.getAllocationLU(roleId,
        wifProjectId, allocationLUId));
  }

}


text:
// +build go1.5

// iccp == IC(4f) C(rypto) P(rotocol)
package iccp

import (
	"github.com/unix4fun/ic/ickp"
	"github.com/unix4fun/ic/icutl"
	"golang.org/x/crypto/nacl/secretbox" // nacl is now here.
)

/*
 * Here we start the protocol definition
 */

const (
	msgHdrPK = "PK"
	msgHdrAC = "AC"
	msgHdrKX = "KX"
)

func CreateACContextWithInputEntropy(channel []byte, inputEntropy []byte) (context *ickp.SecretKey, err error) {
	context = new(ickp.SecretKey)

	context.SetNonce(0)
	//context.nonce = 0
	context.SetBob(channel)
	//context.bob = channel
	context.Overhead = secretbox.Overhead

	shaEntropy, err := icutl.HashSHA3Data(inputEntropy)
	if err != nil {
		//return nil, acprotoError(-1, "CreateACContextWithInputEntropy().HashSHA3Data(): ", err)
		return nil, &icutl.AcError{Value: -1, Msg: "CreateACContextWithInputEntropy().HashSHA3Data(): ", Err: err}
	}

	context.SetKey(shaEntropy)
	//copy(context.key[:], shaEntropy)
	return context, nil
}


text:
<!doctype html>

	<meta charset="utf-8">
	<title>BnC contactpagina</title>

	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
	<link rel="stylesheet" href="../css/reset.css">
	<link rel="stylesheet" href="../css/main.css">
	<link rel="icon" href="../img/favicon.png">
	<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700" rel="stylesheet">
	<meta name="keywords" content=" Style guide, Thomas, ArteveldeHS "/>
	<meta name="description" content=" Bits n' Codes "/>
	<meta name="author" content="Thomas Hayen"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

		<input class="menu-btn" type="checkbox" id="menu-btn" />

Home

Diensten

Portfolio

Over ons

Contact

Home

Diensten

Portfolio

Over ons

Contact

E-mails

thomas.hayen@hotmail.com

erik.wal@hotmail.com

jonathan.van.eeker@hotmail.com

elise.wever@hotmail.com

marianne.den.haven@hotmail.com

loic.nguyen@hotmail.com

Locatie

Voor enige vragen

Leopold II laan 12, 9000 Gent

04 123 456 78 | +32 123 456 78

bitsncodes@hotmail.com

Neem contact op met ons

		<form>

				<input type="text" id="input-name" placeholder="Naam Voornaam" required>
				<input type="email" id="input-email" placeholder="E-mailadres" required>
				<input type="text" id="input-subject" placeholder="Onderwerp" required>

				<textarea name="message" type="text" id="input-message" placeholder="Bericht" required></textarea>

			<button type="submit" value="submit">Verzenden</button>
		</form>

© Bits n' Codes


text:
<<<<<<< HEAD
Nadpisywaæ pliki?

Je¶li zaznaczono tê opcjê, pakiet zostanie zainstalowany nawet wtedy, gdy
zawiera pliki koliduj±ce z ju¿ zainstalowanym pakietem. Istniejêce pliki
zostan± nadpisane przez nowe podczas instalacji.
=======
Nadpisywać pliki?

Jeśli zaznaczono tę opcję, pakiet zostanie zainstalowany nawet wtedy, gdy
zawiera pliki kolidujące z już zainstalowanym pakietem. Istniejęce pliki
zostaną nadpisane przez nowe podczas instalacji.
>>>>>>> upstream/master


text:
import numpy as np

class Scaler(object):
    """
    Iterative estimation of row and column centering/scaling
    using the algorithm from page 31 of:
        Matrix Completion and Low-Rank SVD via Fast Alternating Least Squares
    """

    def __init__(
            self,
            center_columns=True,
            scale_columns=True,
            min_value=None,
            max_value=None,
            verbose=True):
        self.center_columns = center_columns
        self.scale_columns = scale_columns
        self.min_value = min_value
        self.max_value = max_value
        self.verbose = verbose

        self.column_centers = None
        self.column_scales = None

    def fit(self, X):
        if self.center_columns:
            self.column_centers = np.nanmean(X, axis=0)
        if self.scale_columns:
            self.column_scales = np.nanstd(X, axis=0)
            self.column_scales[self.column_scales == 0] = 1.0
        return self

    def transform(self, X):
        X = np.asarray(X).copy()
        if self.center_columns:
            X -= self.column_centers
        if self.scale_columns:
            X /= self.column_scales
        return X

    def fit_transform(self, X):
        self.fit(X)
        return self.transform(X)

    def inverse_transform(self, X):
        X = np.asarray(X).copy()
        if self.scale_columns:
            X *= self.column_scales
        if self.center_columns:
            X += self.column_centers
        return X

class BiScaler(object):
    """
    Iterative estimation of row and column centering/scaling
    using the algorithm from page 31 of:
        Matrix Completion and Low-Rank SVD via Fast Alternating Least Squares
    """

    def __init__(
            self,
            center_rows=True,
            center_columns=True,
            scale_rows=True,
            scale_columns=True,
            min_value=None,
            max_value=None,
            max_iters=100,
            tolerance=0.001,
            verbose=True):
        self.center_rows = center_rows
        self.center_columns = center_columns
        self.scale_rows = scale_rows
        self.scale_columns = scale_columns
        self.min_value = min_value
        self.max_value = max_value
        self.max_iters = max_iters
        self.tolerance = tolerance
        self.verbose = verbose

    def estimate_row_means(
            self,
            X,
            observed,
            column_means,
            column_scales):
        """
        row_center[i] =
        sum{j in observed[i, :]}{
            (1 / column_scale[j]) * (X[i, j] - column_center[j])
        }
        ------------------------------------------------------------
        sum{j in observed[i, :]}{1 / column_scale[j]}
        """

        n_rows, n_cols = X.shape

        column_means = np.asarray(column_means)
        if len(column_means) != n_cols:
            raise ValueError("Expected length %d but got shape %s" % (
                n_cols, column_means.shape))
        X = X - column_means.reshape((1, n_cols))
        column_weights = 1.0 / column_scales
        X *= column_weights.reshape((1, n_cols))
        row_means = np.zeros(n_rows, dtype=X.dtype)
        row_residual_sums = np.nansum(X, axis=1)
        for i in range(n_rows):
            row_mask = observed[i, :]
            sum_weights = column_weights[row_mask].sum()
            row_means[i] = row_residual_sums[i] / sum_weights
        return row_means

    def estimate_column_means(
            self,
            X,
            observed,
            row_means,
            row_scales):
        """
        column_center[j] =
        sum{i in observed[:, j]}{
            (1 / row_scale[i]) * (X[i, j]) - row_center[i])
        }
        ------------------------------------------------------------
        sum{i in observed[:, j]}{1 / row_scale[i]}
        """
        n_rows, n_cols = X.shape
        row_means = np.asarray(row_means)

        if len(row_means) != n_rows:
            raise ValueError("Expected length %d but got shape %s" % (
                n_rows, row_means.shape))
        column_means = np.zeros(n_cols, dtype=X.dtype)

        X = X - row_means.reshape((n_rows, 1))
        row_weights = 1.0 / row_scales
        X *= row_weights.reshape((n_rows, 1))
        col_residual_sums = np.nansum(X, axis=0)
        for j in range(n_cols):
            col_mask = observed[:, j]
            sum_weights = row_weights[col_mask].sum()
            column_means[j] = col_residual_sums[j] / sum_weights
        return column_means

    def center(self, X, row_means, column_means, inplace=False):
        n_rows, n_cols = X.shape
        row_means = np.asarray(row_means)
        column_means = np.asarray(column_means)
        if len(row_means) != n_rows:
            raise ValueError("Expected length %d but got shape %s" % (
                n_rows, row_means.shape))
        if len(column_means) != n_cols:
            raise ValueError("Expected length %d but got shape %s" % (
                n_cols, column_means.shape))
        if not inplace:
            X = X.copy()
        X -= row_means.reshape((n_rows, 1))
        X -= column_means.reshape((1, n_cols))
        return X

    def rescale(self, X, row_scales, column_scales, inplace=False):
        if not inplace:
            X = X.copy()
        n_rows, n_cols = X.shape
        X /= row_scales.reshape((n_rows, 1))
        X /= column_scales.reshape((1, n_cols))
        return X

    def estimate_row_scales(
            self,
            X_centered,
            column_scales):
        """
        row_scale[i]**2 =
        mean{j in observed[i, :]}{
            (X[i, j] - row_center[i] - column_center[j]) ** 2
            --------------------------------------------------
                        column_scale[j] ** 2
        }
        """
        n_rows, n_cols = X_centered.shape
        column_scales = np.asarray(column_scales)
        if len(column_scales) != n_cols:
            raise ValueError("Expected length %d but got shape %s" % (
                n_cols, column_scales))
        row_variances = np.nanmean(
            X_centered ** 2 / (column_scales ** 2).reshape((1, n_cols)),
            axis=1)
        row_variances[row_variances == 0] = 1.0
        assert len(row_variances) == n_rows, "%d != %d" % (
            len(row_variances),
            n_rows)
        return np.sqrt(row_variances)

    def estimate_column_scales(
            self,
            X_centered,
            row_scales):
        """
        column_scale[j] ** 2 =
          mean{i in observed[:, j]}{
            (X[i, j] - row_center[i] - column_center[j]) ** 2
            -------------------------------------------------
                        row_scale[i] ** 2
        }
        """
        n_rows, n_cols = X_centered.shape
        row_scales = np.asarray(row_scales)

        if len(row_scales) != n_rows:
            raise ValueError("Expected length %s, got shape %s" % (
                n_rows, row_scales.shape,))

        column_variances = np.nanmean(
            X_centered ** 2 / (row_scales ** 2).reshape((n_rows, 1)),
            axis=0)
        column_variances[column_variances == 0] = 1.0
        assert len(column_variances) == n_cols, "%d != %d" % (
            len(column_variances),
            n_cols)
        return np.sqrt(column_variances)

    def residual(self, X_normalized):
        total = 0
        if self.center_rows:
            row_means = np.nanmean(X_normalized, axis=1)
            total += (row_means ** 2).sum()

        if self.center_columns:
            column_means = np.nanmean(X_normalized, axis=0)
            total += (column_means ** 2).sum()

        if self.scale_rows:
            row_variances = np.nanvar(X_normalized, axis=1)
            row_variances[row_variances == 0] = 1.0
            total += (np.log(row_variances) ** 2).sum()

        if self.scale_columns:
            column_variances = np.nanvar(X_normalized, axis=0)
            column_variances[column_variances == 0] = 1.0
            total += (np.log(column_variances) ** 2).sum()

        return total

    def clamp(self, X, inplace=False):
        if not inplace:
            X = X.copy()
        if self.min_value is not None:
            X[X < self.min_value] = self.min_value
        if self.max_value is not None:
            X[X > self.max_value] = self.max_value
        return X

    def fit(self, X):
        X = self.clamp(X)
        n_rows, n_cols = X.shape
        dtype = X.dtype

        # To avoid inefficient memory access we keep around two copies
        # of the array, one contiguous in the rows and the other
        # contiguous in the columns
        X_row_major = np.asarray(X, order="C")
        X_column_major = np.asarray(X, order="F")

        observed_row_major = ~np.isnan(X_row_major)
        n_observed_per_row = observed_row_major.sum(axis=1)
        n_empty_rows = (n_observed_per_row == 0).sum()

        if n_empty_rows > 0:
            raise ValueError("%d rows have no observed values" % n_empty_rows)

        observed_column_major = np.asarray(observed_row_major, order="F")
        n_observed_per_column = observed_column_major.sum(axis=0)
        n_empty_columns = (n_observed_per_column == 0).sum()
        if n_empty_columns > 0:
            raise ValueError("%d columns have no observed values" % (
                n_empty_columns,))
        # initialize by assuming that rows are zero-mean/unit variance and
        # with a direct estimate of mean and standard deviation
        # of each column
        row_means = np.zeros(n_rows, dtype=dtype)
        row_scales = np.ones(n_rows, dtype=dtype)

        if self.center_columns:
            column_means = np.nanmean(X, axis=0)
        else:
            column_means = np.zeros(n_cols, dtype=dtype)

        if self.scale_columns:
            column_scales = np.nanstd(X, axis=0)
            column_scales[column_scales == 0] = 1.0
        else:
            column_scales = np.ones(n_cols, dtype=dtype)

        last_residual = self.residual(X)
        if self.verbose:
            print("[BiScaler] Initial log residual value = %f" % (
                np.log(last_residual),))
        for i in range(self.max_iters):
            if last_residual == 0:
                # already have a perfect fit, so let's get out of here
                print("[BiScaler] No room for improvement")
                break

            assert len(column_means) == n_cols, \
                "Wrong number of column means, expected %d but got %d" % (
                    n_cols,
                    len(column_means))
            assert len(column_scales) == n_cols, \
                "Wrong number of column scales, expected %d but got %d" % (
                    n_cols,
                    len(column_scales))
            assert len(row_means) == n_rows, \
                "Wrong number of row means, expected %d but got %d" % (
                    n_rows,
                    len(row_means))
            assert len(row_scales) == n_rows, \
                "Wrong number of row scales, expected %d but got %d" % (
                    n_rows,
                    len(row_scales))

            if self.center_rows:
                row_means = self.estimate_row_means(
                    X=X_row_major,
                    observed=observed_row_major,
                    column_means=column_means,
                    column_scales=column_scales)
            if self.center_columns:
                column_means = self.estimate_column_means(
                    X=X_column_major,
                    observed=observed_column_major,
                    row_means=row_means,
                    row_scales=row_scales)

            X_centered = self.center(
                X,
                row_means,
                column_means)
            if self.scale_rows:
                row_scales = self.estimate_row_scales(
                    X_centered=X_centered,
                    column_scales=column_scales)
            if self.scale_columns:
                column_scales = self.estimate_column_scales(
                    X_centered=X_centered,
                    row_scales=row_scales)

            X_normalized = self.rescale(X_centered, row_scales, column_scales)
            residual = self.residual(X_normalized)
            change_in_residual = last_residual - residual
            if self.verbose:
                print("[BiScaler] Iter %d: log residual = %f, log improvement ratio=%f" % (
                    i + 1,
                    np.log(residual),
                    np.log(last_residual / residual)))
            if change_in_residual / last_residual < self.tolerance:
                break
            last_residual = residual
        self.row_means = row_means
        self.row_scales = row_scales
        self.column_means = column_means
        self.column_scales = column_scales

    def transform(self, X):
        X = np.asarray(X).copy()
        X = self.center(X, self.row_means, self.column_means, inplace=True)
        X = self.rescale(X, self.row_scales, self.column_scales, inplace=True)
        return X

    def inverse_transform(self, X, inplace=False):
        X = np.asarray(X)
        if not inplace:
            X = X.copy()
        X = self.rescale(
            X,
            1.0 / self.row_scales,
            1.0 / self.column_scales,
            inplace=True)
        X = self.center(X, -self.row_means, -self.column_means, inplace=True)
        return self.clamp(X)

    def fit_transform(self, X):
        self.fit(X)
        return self.transform(X)


text:
class Respect::ArraySchema::JSON

  #  Runs the validation against the value and returns a sanitized representation
  #  of the value passed.
  #
  def represent(value, schema, options = {})
    if value.nil?
      if schema.options[:allow_nil]
        return nil
      else
        raise Respect::ValidationError, "object is nil but this #{self.class} does not allow nil"
      end
    end

    raise Respect::ValidationError, "object is not an array, and ArraySchema expects it to be a collection" if (!value.nil? && !value.is_a?(Array))

    value.map do |entry|
      if entry.respond_to?(:represent)
        entry.represent(:json, options)
      else
        entry
      end
    end
  end

  def parse(value, schema, options = {})
    if value.nil?
      if schema.options[:allow_nil]
        return nil
      else
        raise Respect::ValidationError, "object is nil but this #{self.class} does not allow nil"
      end
    end

    value
  end

  #  Compiles representer code that writes the value into +result+ variable.
  #
  def compile_representer!( via, schema, from, to )
    var = ::Proper::Api::Entity.random_variable!
    code = "#{var} = #{from}\n"

    code << "if #{var}.nil?\n"
    code << "raise Respect::ValidationError.new(\"Found nil under \#{_field_name} for object \#{_object}\")\n" unless schema.allow_nil?
    code << "#{to} = nil\n" if schema.allow_nil?
    code << "else\n"

    var2 = ::Proper::Api::Entity.random_variable!

    code << "#{to} = #{var}.map do |#{var2}|\n"
    code << "#{var2}.respond_to?(:represent) ? #{var2}.represent( :json, options ) : #{var2}\n"
    code << "end\n"

    code << "end\n"

    code
  end

  #  Compiles representer code that writes the value into +result+ variable.
  #
  def compile_parser!( via, schema, from, to )
    var = ::Proper::Api::Entity.random_variable!
    code = "#{var} = #{from}\n"

    code << "if #{var}.nil?\n"
    code << "raise Respect::ValidationError.new(\"Found nil under \#{_field_name} for object \#{_object}\")\n" unless schema.allow_nil?
    code << "#{to} = nil\n" if schema.allow_nil?
    code << "else\n"

    var2 = ::Proper::Api::Entity.random_variable!

    code << "#{to} = #{var}.map do |#{var2}|\n"
    code << "#{var2}\n"
    code << "end\n"

    code << "end\n"

    code
  end

end


text:
class RemoveAdminVisibleFromExpenseGroup < ActiveRecord::Migration[4.2]
  def change
    remove_column :expense_groups, :admin_visible, :boolean, default: false
  end
end


text:
using System;
using NiL.JS.Expressions;
using NiL.JS.Statements;

namespace NiL.JS.Core
{
    /// <summary>
    /// AST nodes visitor.
    /// </summary>
    /// <typeparam name="T">Type of return value</typeparam>
#if !(PORTABLE || NETCORE)
    [Serializable]
#endif
    public abstract class Visitor<T>
    {
        internal protected abstract T Visit(CodeNode node);

        internal protected virtual T Visit(Addition node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(BitwiseConjunction node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ArrayDefinition node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Assignment node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Call node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ClassDefinition node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Constant node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Decrement node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Delete node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(DeleteProperty node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Division node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Equal node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Expression node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(FunctionDefinition node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Property node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Variable node)
        {
            return Visit(node as VariableReference);
        }

        internal protected virtual T Visit(VariableReference node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(In node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Increment node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(InstanceOf node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Expressions.ObjectDefinition  node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Less node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(LessOrEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(LogicalConjunction node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(LogicalNegation node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(LogicalDisjunction node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Modulo node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(More node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(MoreOrEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Multiplication node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Negation node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(New node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Comma node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(BitwiseNegation node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(NotEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(NumberAddition node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(NumberLess node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(NumberLessOrEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(NumberMore node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(NumberMoreOrEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(BitwiseDisjunction node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(RegExpExpression node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(SetProperty node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(SignedShiftLeft node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(SignedShiftRight node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(StrictEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(StrictNotEqual node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(StringConcatenation node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Substract node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(Conditional node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ConvertToBoolean node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ConvertToInteger node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ConvertToNumber node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ConvertToString node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(ConvertToUnsignedInteger node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(TypeOf node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(UnsignedShiftRight node)
        {
            return Visit(node as Expression);
        }

        internal protected virtual T Visit(BitwiseExclusiveDisjunction node)
        {
            return Visit(node as Expression);
        }
#if !(PORTABLE || NETCORE)
        internal protected virtual T Visit(Yield node)
        {
            return Visit(node as Expression);
        }
#endif
        internal protected virtual T Visit(Break node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(CodeBlock node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(Continue node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(Debugger node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(DoWhile node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(Empty node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(ForIn node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(ForOf node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(For node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(IfElse node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(InfinityLoop node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(LabeledStatement node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(Return node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(Switch node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(Throw node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(TryCatch node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(VariableDefinition node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(While node)
        {
            return Visit(node as CodeNode);
        }

        internal protected virtual T Visit(With node)
        {
            return Visit(node as CodeNode);
        }
    }
}


text:
**IvyRepo** contains the tool chain to populate the
[Nepherte Ivy Repository](https://www.nepherte.be/ivy). This includes the
packaging instructions for all hosted artifacts. Browse this repository for a
current list of build files. Keep on reading for more info on the tool chain.

    Usage: IvyRepo.bat [-h] <command> <artifact>
    Script to manage the Nepherte Ivy Repository

        -h,--help    Print out a help message with examples
        <command>    Possible values are resolve, install and publish
        <artifact>   The artifact id as organisation:module:revision

Introduction
------------
This repository is made possible by the Ivy
[Packager Resolver](http://ant.apache.org/ivy/history/2.0.0/resolver/packager.html).
This resolver supports downloading, extracting and packaging artifacts from
upstream repositories. It allows for a clear separation between artifact
meta-data and actually hosting them.

For every artifact in the online repository, there is an Ivy module definition
(`ivy.xml`) that contains the artifact meta-data, plus instructions on where to
download and how to extract them (`packager.xml`).

The tool chain can read the artifact meta-data and build instructions. The
repackaged artifacts are published in an artifact repository, on which projects
can rely for resolving their dependencies.

Installation
------------
Follow these steps to install the tool chain:

1. Install [Ant](https://ant.apache.org/) into the `ANT_HOME` folder
2. Download [Ivy](https://ant.apache.org/ivy/) to the `USER_HOME\.ant\lib` folder
3. Use [Git](https://git-scm.com/) to clone this repository to your computer
4. Configure the [Online Resolver](#online-resolver) for your repository

#### Prerequisites
The tool chain relies on Ant to run the available commands. Make sure to set the
environment variable `ANT_HOME`. Ant in turn depends on the presence of a Java
Runtime Environment, available under `JAVA_HOME` or on the system `PATH`.

The tool chain does not automatically download Ivy or its dependencies. The jars
must be available in `USER_HOME\.ant\lib` or the script will not work. The
variable `IVY_HOME` eventually determines the location in which to cache
resolved artifacts.

Getting Started
---------------
The executable `IvyRepo.bat` can be used to manage an online Ivy repository:
from building artifacts to publishing them. It makes upgrading artifacts to
newer versions very easy. Out-of-the-box only artifacts in this git repository
are supported, but new artifacts can be added in the blink of an eye.

#### Resolving Artifacts
To download and build an ivy artifact, use the following command:

    IvyRepo.bat resolve <organisation>:<module>:<revision>

#### Installing Artifacts
To install an artifact into the staging repo, use the following command:

    IvyRepo.bat install <organisation>:<module>:<revision>

#### Publishing Artifacts
To publish an artifact into the online repo, use the following command:

    IvyRepo.bat publish <organisation>:<module>:<revision>

Configuration
-------------
Changing the behavior of the tool chain boils down to configuring the upstream
resolver (`packager`), the local resolver (`filesystem`), or the online resolver
(`sftp`). Each resolver has a dedicated configuration file.

It is also possible to switch out these resolvers - say your online repository
is not accessible via sftp - by directly editing the Ivy settings file
(`ivysettings.xml`).

#### Source Resolver
The source resolver (`packager`) reconstructs artifacts based on upstream
sources by reading the Ivy meta-data (`ivy.xml`) and packaging instructions
(`packager.xml`) in the source repository, which defaults to `src/repo`.

The location of the source repository is specified by the directory
`pkg.repo.dir` in `packager.properties`. The exact location of the Ivy
meta-data and packaging instructions are specified by `pkg.repo.pattern`.

#### Local Resolver
The local resolver (`filesystem`) acts as a staging area before publishing
artifacts online. It is highly recommended to try this local repository first
before committing anything to your online repository. The target directory
defaults to `target/repo`.

The location of the local repository is specified by the directory
`stage.repo.dir` in `staging.properties`. The exact location and names of the
artifacts are determined by `stage.repo.pattern` and `stage.artifact.pattern`.

#### Online Resolver
The online resolver (`sftp`) defines the online repository that hosts the
published artifacts. The configuration file `sftp.properties` contains the
credentials to connect to the online repository. Make sure to update them.


text:
{
  var res = transform(code, {
    sourceMap: true,
    plugins: opts.plugins
  });
  assert.notEqual(
    res.map.mappings,
    "",
    "expected to generate sourcemap for: " + code
  );
}